Monday, May 8, 2017

A silly mistake I made today, and why you should always think through your code.

That moment when you thought something would be easy to implement and then it broke all the old code. :(

This is a great example of a "simple to think about, hard to implement" game mechanic.  It sounds great on paper but has a very fatal flaw when implemented that I didn't catch.

The short version of the mechanic is that

1- The level has torches around it that can be lit up by the player.
2 - The objects loaded in when the level is built are hidden at first, and when a torch is lit, it enables a list of objects to show themselves.  (Each torch has previously scanned to build this list at the start of the level).
3 - The player can light their own "torch" to reveal objects nearby as they wander the level, and use this torch to light the unlit ones.

The system worked great but it had a major flaw.  I recently introduced the player being able to carry a dynamic light source around, and that broke everything.

The player controlled object has to erase it's own trail, because if the player moves away from something dark it should hide itself again.  Otherwise the player's light source just becomes a fancy paintbrush that reveals everything in the level.

But in adding that bit, the player is now overwriting the previously lit objects.

The result is that lighting a torch and then moving away will hide the objects again even though the torch right next to them is still lit.  Doh! x_x

I got a few ideas how to go about fixing it.  The tricky part is to do it without needing to always re-find the objects they lit up, as that's the main memory hog of the system.  But I need a break for now.  My current fix idea is to have the torches "tag" objects as "skip hiding this one", since in this system (for now) the torches never turn off again.

In the end, it will probably cost me an extra few minutes tomorrow to fix.  However, it's a great example of why planning is very important.

Anyway, I just thought it might be fun to share this little game mechanic planning mishap.  This is why testing your ideas out on paper is so important, as well as running over all combinations of game elements during the design.

Remember to check out Drake at https://darkgriffin.itch.io/drake if you haven't played it yet!  It's the latest game I've made and I'd love some help sharing it around to new players!

Tuesday, April 4, 2017

Drake is out!

Playable in web flash, and if you donate 5.00 or more you get downloads of both flash and windows executable form that you can keep forever and play offline.

https://darkgriffin.itch.io/drake


I really could use some help spreading this game around.  In order to be a success I need as many people as possible to see it, play it, and share it.  Your donations will go directly to me and supporting my game development in the future, I promise!

I also greatly need some feedback on the price.  This is my first game launch, and while I think the current donation download price is fair for the amount of content given, it may very well not be.  I'm operating in the dark and within the very narrow amount of games I have been able to afford myself on the lower end of the market.  While I would feel 5 is a fair price were I to buy the game for offline play, I don't know how others feel about that.

Anyway, enough about me!  Go play the game!  And please share the link with your friends!