Skip to main content

On Room Enter

Over the weekend I was doing some work on the game for my son and ran into a situation where I needed to have an object start hidden from the player.  In the current pipeline with Inkscape I use python and the command line arguments to export out all of the pieces that I need.  This has been awesome for iteration and adding new things to rooms.  

The rub is that the object needs to be visible in the SVG file when it exports otherwise it exports and empty png image.

There are some ways I could get around it in the pipeline but I wanted a much more useful solution.  I opted for putting in two new functions to my logic "on_enter" and "on_exit".  Then added the execution code right before and after the main logic processing code.

On_Enter is run when a new room is entered.  I already track the current room and the last room so the logic triggers were already there now I just loop over all the logic attached to that node and I'm done.  I do the same on the other end where I run logic when a room is being exited.  The thing I like about this is that it allows me to then do all of my object setup right in the logic where it used so I don't need to jump between applications.  Art and layout are coupled into one single working environment, game logic and settings now exist in the same spot.  So everything feels very organic so far.

The idea of 'on_enter' and 'on_exit' is nothing new at all and pretty standard practice but this was by far the easiest time I have ever had in implementing it in a project.  In total it took me about 5 minutes to setup on the engine side and about 10 minutes to make the new logic nodes for the logic editor.  I attribute this to the data heavy approach I took on designing the engine.  All in all I am finding this approach is really working for me mentally.  I seem to have a much easier time reasoning about the entire project with this design approach.

Comments

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.

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.  When you build the map you get a single static mesh that you can export…

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.