Posted 27 February 2012 - 12:04 AM
I'm working with a platformer game with a grid based system, all tiles and such lie on a 16x16 grid (and are destructible, terraria style). The idea is it's based on an alien planet and the player has to be careful about creating bases that have a solid air supply and such. Each cell in the grid is going to have an "air level" stored in a seperate ds_grid from the terrain one. There'll be objects that pump out air, and I want it to travel semi-realistically so it'll build up pressure in sealed off areas.
The player will need a basic pressure or air value in a grid cell to be able to breath, so by creating a sealed off base and creating objects to make air they'll be able to breath in their environment.
The problem is, how should I go about making these objects fill up the grid spaces around them with air? I was first considering looping through objects that do this and having loop propogating out in a flood fill fashion, but I'm not sure if that'd work so well. My other idea is to loop through each grid cell, and if it's got a higher pressure than surrounding cells move air into them. The issue with this is the speed, and also the fact that it'd travel too far from a source- I'd only want it to be able to pressurize say, 10 cells radius or whatever, but this system would have cells with tiny pressures all over, which is not really a huge problem but isn't a very neat solution.
Posted 27 February 2012 - 12:41 AM
Advanced solutions would mean to store maximum distance which air can travel... but hey, even real air doesn't work like that.
Edited by YellowAfterlife, 27 February 2012 - 12:42 AM.
Posted 27 February 2012 - 03:55 AM
Dual-Quaternion Skinning - Modifying vertexes in GM is slow. This simple vertex shader does the job both quickly and well.
Posted 27 February 2012 - 07:50 PM
Not sure GM by itself is up to the challenge, even with the trickiest code, but I haven't really looked into it since this article first appeared in Game Developer Magazine in 2007. Perhaps if your needs are modest a solution might be practical.
Ron Fedkiw (cited above) has done some cutting edge work with high speed CFD that you might find interesting.
This paper is a good place to start.
If any of my posts contain broken images or links, I can probably supply them for you. PM with a link to the post.