Skip to main content

Logic Flow

Over the weekend I expanded upon the logic processing or my game engine.  Originally it would process all of the logic for the current room (a level essentially), actors in the current room and any logic scripts held in a global list.  When a new room is entered all logic not contained in the global list is dumped and the new room and actor logic is run.

There are functions to load and stop global logic so if I needed to kick off logic that would process across multiple rooms that is very easy to do.  But I hit an issue putting together a new room that needed to have more complex logic that was executed only in that room.

I could make a script that is run globally but I would need to make sure to kill it when the player exits the room.  This is not a problem but it does leave plenty of room for error if you forget to kill it when the room exits.

Introducing "local logic" all the flexibility of "global logic" but with out the need to clean up.  The local logic gets emptied any time the room changes.  Now I can kick off scripts on the local level and not have to worry about cleanup though I still have the power to kill the script at anytime.  Now you can break up the logic into many smaller pieces and start and stop them through the main room script.  Its like Lego but with game logic.


Popular posts from this blog

Plunder Bunny | Flash Game Character Mockups

Another collection of design/mockup sheets for a personal project.  The game was a very simple 2D platformer in the vain of Super Mario.  I got pretty far with the game but ended up getting busy with some contract work and the project feel into the ever growing abyss of personal projects.  When I get some more free time I'd like to try and re-visit it.

The visuals were really fun to work on.  Inkscape was used to flesh out my initial sketches.  Each character was broken up into pieces like a paper puppet.  After Saving the pieces out at high resolution they would then be put back together in Blender 3D where they would be animated.

Random Level Generation

The level generation system in This Is Dungeon uses a few different ideas to produce the final levels but I'm just going to go over the first right now.  Levels are generated using the Dungeon-Building Algorithm by Mike Anderson.  This algorithm is very simple to implement and gives really good results.  The levels generate very quickly and the player is guaranteed to be able to reach every room of the level.

After playing around with the generated levels in game I started wanting to be able to break the map up into multiple sections.  Since the features are built one at a time from a previously built room I realized I could just tell the generator how many sections I wanted to break the map up into and divide that by the number of rooms it was trying to generate.  The result being the number of rooms that should go into each section.  With that info you just keep track of the rooms already built and when that number equals the number of rooms per section pick a wall tile that ca…

Mega Cow | Video Game Mockup

We All Have Crazy Game Ideas...This Is Just One Of My Own

Yup its a giant mutant cow... Using Inkscape I made this game mockup after watching some MST3K late one night.  I thought it would be fun to play a game where you were the giant creature causing all of the destruction.  That is the reason the giant cow is on the right of the screen instead of the left. The player would move through the level from the right to the left, the opposite of pretty much every scrolling game... looks good in my head but might not work in actual game play.  Below are some images showing the progression from rough sketch to final mock-up.