Re: TIB: Gee, It's quiet here


[Prev][Next][Index][Thread]

Re: TIB: Gee, It's quiet here




> Yuck! That equation looks like a headache.
I emphasized a good model for the terrain rather than neatness.  It 
performs remarkably well;

>> r(x,c)=c[1]*sin(c[2]*x)+c[3]*cos(c[4]*x)+c[1]+c[3]
The equation, used only once, uses the list c to control its size before 
storing into a list.  One special thing about the function is that it 
ensures that the terrain will never be less than zero and no tanks will 
start off below the screen.   I'm sure some of you are thinking "It 
would be ridiculous to create a list with one element for every pixel!"  
I didn't do it for every pixel, but I skipped every other pixel on the 
graph when drawing the function and used a list only half as long as the 
screen (although it is still over 100 elements long in my case)

> In my game I calculated the next point that would be turned on, and
> then did a pixel-test to see if the point was already on. I though
> about have a list that had 94 elements (one for the height of the
> terrain at each X value), but it seemed like a waste of space. The
> test would have had to be if y<=L1(x)). There didn't, and still
> doesn't, seem any benefit to having the extra list. Again, why not
> just use the pixel-test?

When I draw the terrain, it appears as a graph, with nothing appearing 
below it.  I kind of like the resulting brightness of the screen, and 
the fact that the terrain is smooth adds to its appearance.
 
Maybe I should write some test programs that store my terrain data to 
the screen alone, featuring those ideas and making it work with divots 
(create explosion, test for pixels above explosion, move the pixels to 
the bottom of the explosion).  Keep in mind that if I do it, I cannot 
use tracers on my projectiles, or else they could blow up in midair!  
That is not a very pleasant combination to mix, but it does indeed 
answer a few other questions (like "how can you model a terrain that 
suspends some of its dirt?" or "What can you do to reduce the memory 
needed for the game?")  I'll also be unable to redraw the screen once a 
tank gets destroyed, but will have to find a way to remove it without 
damaging the terrain.

Tavis

> Jody Snider
> jody1@alaska.net

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com