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.


Comments

Popular posts from this blog

Level Buddy | Blender Addon

An old-school CSG inspired level editor add-on for Blender 3D. The add-on is still very much a work in progress but fairly solid for blocking spaces super quickly.  Just because graphic fidelity has gotten insanely good and hyper detailed doesn't mean we shouldn't look back how older games were put together, at least that is my opinion.  One thing I always come back to is how quickly the tools in the first 2 versions of Unreal Ed 2 and Doom level editors allowed anyone to block out a level, iterate on feedback or try an idea out.  So I just took some time to put together a similar pipeline right in my 3d package of choice.  I wanted to keep it simple and quick to try out level design ideas.  You can use it for simple white boxing of your level, break it up into multiple static meshes and import them into your game engine of choice or  you can use that as your starting point to start more detailed modeling ....

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.

Rocky Terrain | Blender Internal Rendering

I saw a really awesome render of some rocks the other day and was inspired to see if I could recreate a version of my own of some rocky terrain so I made this little scene.  The scene was modled, rendered and composited in Blender 3D .  It is a very simple scene and made just for fun in a couple of hours.  The rocks are all subsurface cube objects that I run a noise displacement map on using the world coordinates.  This allowed me to just make instances of the cube and drag them around the scene to get different rock shapes.  Some of the rocks needed to be scaled to get some more size variation but that is pretty much the only thing that is different about them other then their positions.  It was actually really fun to just move the cube around the scene and watch these random rock shapes form.  After the layout was done I added in some particle grass to break the ground up.  Not enough time was spent on the grass so it looks pretty bad ...