Enemies

So I have been on a bit of hiatus towards the end of this summer.  No excuses, just not a lot of hobbyist programming going on at night.  Well that all changed today when I decided to take a 3 hour chunk of time and dedicate myself to finishing something important in the game.  The result?  Enemies which chase the player.

Of course, whenever I add something to the game I stress test it.  The result is a scary form of flocking behavior when several dozen spheres (the collision model used by Whirlygigs) come after my marble.  Their target is quite simple (seen as a small red dot), it is merely where my marble will be in the future, at their level.

As cool as this is, it is not 100% done yet.  The enemy behavior has little quirks in it, and they will happily roll right off an edge to get to you.  I believe I will have to make it a bit more complicated but it must be done…  If the path to the player is safe (no missing tiles), the target itself is a pass-through target, meaning the enemy can barrel ahead as fast as it wants.  If the path to the player is not safe then the target is a stop-at target similar to what Random Whirlygigs do.  I’m sure there are other problems with the system, but it works well at a basic level.

The only big problem I see with seeking enemies, is if they are all clumped together pushing against the wall or some other immovable object, the framerate of the game drops dramatically due to the physics engine.  I’m still trying to figure out how to remedy this through code, but for now the level designs will simply not contain the potential for this scenario (dozens of enemies pushing each other into a corner).

Happy 2 Year Birthday to Funcygames Blog!

Hey there!  This blog started exactly two years ago today.  The game has come a long way.  Not as far as I had planned, but we have still made some good progress.  Who knows?  Perhaps when this game is done it won’t have to be played in an emulator? 🙂

No new demo available to celebrate, unfortunately.  Progress has been a little slow in June but I should be back on track shortly.  I added a box for a moveable object, I may add more sizes of boxes, for variety and different uses.  I may make some sweeping improvements to the Enemy AI before I add the chasing behavior, that will make it take longer but in the end I think it will make for a better system.  I am thinking about modifying the Restart widget process. so when the player restarts after falling certain moveable objects will be reset as well.

Videos of new stuff should come about in the next couple of weeks.

Surrounded by the Enemy

I’ve made enemies available in the editor.  It didn’t take too long, I mirrored what is done for Widgets (i.e. duplicate code).  Since I always add new things to the game engine with the editor in mind, I simply had to start storing the enemy data in the Level file and bam there they were.

What’s next?  To finish off enemies for the beta I would like to work on types that chase the player, both a giant evil ball and a new enemy type that pushes the marble upward (think intelligent tornado).  I may play with some more moveable items and put in the ball, the box, and a wedge.  I’m sure some other shapes will come out of user suggestions or if I see the need for one.  I also have to make sure they disappear when falling off the level.

Really all the major pieces are in, what is left is fine-tuning, adding content, and some polish to the game.  Of course that could be another 2 years worth of work, easy!

Here are the latest numbers:
Marble Maze Game: 7159 lines of code
Maze Editor: 8101 lines of code

I Like To Move It, Move It

So I just added moveable objects. These are important for most physics-based platformers, as they open up a bunch of puzzles for the player to solve. Right now the shapes I have planned are box, plank, and marble. The box and plank can be used as a bridge, the plank can be used as a ramp, and the marble can be used to possibly trigger certain things (land on a switch?).

Next I’ll work on getting enemies into the Editor, which shouldn’t be too bad since they are just like widgets and specials in that regard. And I am looking into adding the ability for some widgets to go on certain slopes. This will mainly be for speed arrows but I’m opening it up to other types, whatever they may be in the future.

More Progress To Come

So I beefed up the To Do List, to be more accurate in what I’m planning to do for the “Beta” version. A few more widgets were added. I might even add a “damage” tile to the list. For most maps this would be a “lava” type tile, although perhaps something else could be for other maps (poison, electrical, etc.) Whatever it is, it would have to be animated, which is something these tiles do not do yet. I’ll have to look into what I need to do for that. I think it is merely changing an image reference for the landscape object, which won’t be too bad.

Next is moveable objects for some fun physics puzzles, and putting enemies in the editor. Enemies shouldn’t be too bad now that I’ve got the Widget/Special system defined. After those items there are some big editor improvements, such as widget popups and level info popup. The level info popup screen will be a big screen with all the level “options” on it. User can pick a theme, camera types available, goal type (require all gems, time limit, etc.), and all sorts of other things.

Lots of work ahead.