Archive for the 'water' Category

APEs, Motors and Floaters, Oh My!


So, I spent some time getting back to PP:AFAA today and worked out some hacky solutions to the floaters. Getting buoyancy to look good was actually fairly challenging for my tiny brain, however I created a fairly convoluted algorithm which should supply all the requirements for the prof. This got me thinking hard about the purpose (porpoise? haha!) of Melba Toast and what exactly I am trying to accomplish with the engine. The original intention of the engine was to create a fast, reusable codebase which I could go back to for multiple games and maybe share with other developers (though i’d probably have to start commenting…) who are trying to accomplish similar goals. This is especially important for Intuition as our goal is to create multiple games on a shorter time frame in order to iterate on lots of cool ideas, find a broad market and have fun.

The problem is that engine development is not quick, it takes a lot of work and research to find optimal algorithms for every facet of functionality, and while I can work with the unfinished engine to create quick games like PP:AFAA, I have to fill in the missing functionality with hacks which don’t take as long to research and work fine enough in the mean time. So this gets to my point, which is I am struggling with deciding whether to take a longer time to write solid code now and take a lot longer on development for negligible short term benefits (i.e. PP:AFAA don’t really NEED collision based on separation of axis theorem or a spring system) or do I just hack it up and get it out the door? I need to learn how to do it the hard way, but I’m also a lazy american who wants it and wants it now.

The obvious third option is to use an open source physics library like APE or Motor (though i’m not sure Motor is going to be freely available) though the obvious down side of third party physics solutions is that they are not tailor made to my specific problems and I don’t know their interfaces…

For now I’m hacking it, and if I need to I’ll fix up the code later. That’s generally the accepted choice of game development, from what I understand, but as a programmer I still hate writing code I know is bad and needs to be replaced.

Waves and Toasty Stuff

We’ve been working full steam on PP:AFAA tonight, and I’ve finally gotten back on track with Melba Toast and breaking out teh codez. I actually started out on prototyping water yesterday and thought I’d have an easy time of getting some wave action going… Boy was I wrong.

Actually in theory, it would have been pretty simple to just throw a line on the screen and use a sine wave to do some nice wave effects and the just move on. However, I have decided to use Melba Toast in the most responsible manner possible and that means avoiding shitty shortcuts and hacks. I determined that I wanted my water to be a tile, which means it has to be subjected to all the culling algorithms I wrote for my MelbaTiles. This set me right in the face of one of the two problems my tile engine currently has, the other of which is I have no faculty for actors which are able to move across the tile sectors (see Tile engine tutorial to get an idea of how the tile system works), and I only register tiles with the sector that contains their registration point, i.e. the upper left corner. This second issue is a problem for any tile which overlaps two sectors or especially tiles which are larger than a sector. I decided that the water shouldn’t be split up into multiple objects, a decision I may change later for efficiency, which forced me to solve the problem of super sized tiles before I could even make my water show up on the screen.

So anyway, I came up with 14 different cases of tile orientation on a single sector and was about to write up a massive nested if() clusterfuck when I remembered the collision lessons the Metanet Software crew (makers of N, check it out) released. Using their “Maths”, I was able to reduce the statement to about 8 lines of code and was very pleased with myself.

Long story short, there is no longer a limit to the size of tiles Melba Toast can support, and we got neato water effects, though it’s not too dynamic at the moment. You can use the arrow keys to scroll around, but you can get lost quick.

Also, tilde brings down the console, though the only command right now is fps.



-->