Wednesday, May 30, 2012

you'll never get out of this maze

Did some additional refactoring to the core player movement code tonight, revisiting it for probably the first time since I wrote it during the Ludum Dare jam. Being code written under time pressure, it was pretty messy, although not totally unreadable. The vector math for moving the ball around the cube surface turned out to be fairly simple in the end, if a bit counterintuitive in a couple spots.

Removing Debug.Log code and some of the spatial conversions I was making to make things more suitable for debug output really sped up maze generation time. It went from generating a 7x7x7 cube maze in about 4 seconds on my PC (this is with some other optimizations I had done earlier), down to less than two. That data structure I mentioned in an earlier post seems to be really doing its job, because maze generation time appears to not have any exponential characteristics. I was able to go up to 15x15x15 and higher with hardly any additional performance hit.

Of course, this is all on a high-powered PC, and not on any target device. One of the next things to do is to implement the accelerometer code, which shouldn't be much trouble in and of itself; however, I have not tested this at all using accelerometer-based movement. It's all been direction key movement so far, so I may have to do a bit of tuning to get that right.

Aside from that, there's still the matter of are we munching dots, escaping ghosts, finding an exit, or some combination thereof. I'm thinking the testing on an actual mobile device will yield some clues as to what would most make sense as far as the overall theme of the content of the game.  That said, I would like to post an updated version of my Ludum Dare entry, which would still be themed around the idea of “Tiny World”, and would necessarily involve collecting all the dots in the maze –  only this updated version would have randomly generated mazes that could be of just about any size, but given the theme I may just peg it at the smallest one possible and maybe work with that :)

No comments:

Post a Comment