[gameprogrammer] Re: advanced game

That'd work well if the path was made with vectors, I think that in Sonic
they actually used a trick with radians (where the angle of a point in a
circle is proportional to the arc size starting from some other point)
because all the ever used, at least in the first games, was circles, half
circles and quarter circles (before just making it 90° from the ground). The
derivation trick actually would work, but you'd need a vector that'd
describe how the floor works, the more detailed the vector, the better it
is, but the more memory it takes. The more derivations per second add more
smoothness but the more cpu intensive it becomes.
You could make it "simpler" on the cpu by, instead of having a general
derivator function you'd use prefefined functions (circle, sine, quadratic,
1/x, etc.) to draw the vectors that describe the dimensions of the ground,
and just use brute force derivation (which is faster, really) for those
things.
Finally you could use this vectors to know when a character hits, another
thing you might want to think is, notice how in the circles sonic would go
through them under certain conditions and on them if you where going fast
enough? Well maybe you want to have something like that, that under certain
conditions vector maps change. Dunno if this helped, hoped it did.

On 4/29/07, Chris Nystrom <cnystrom@xxxxxxxxx> wrote:

On 4/27/07, Yasser Gonzalez <yassergs@xxxxxxxxxxxxxxx> wrote:
> To Paul Smith:
>
> It seems that you have an idea of how to do.
>
> Colud you tell me how should be with a mountain, for example?????

I have never programmed anything like this before, but how about
something like how in calculus where you take a curve and split it
into smaller straight lines?

I am thinking of a data array with an index of how far you are across
the surface of the mountain. If you go left or right you go up or down
the array. An element of the data in the array can be the location and
angle to draw the sprite. Simple to do and not a lot of math would be
required. You could probably just eyeball it.

Increase the granularity for improved display vs less performance.

An plus to this would be that it would be easy to incorporate other
terrain elements in the model.

Just an idea of how I might try a first implementation. Best of luck,

Chris

--
E-Mail: Chris Nystrom <cnystrom@xxxxxxxxx>
Saving the world from web programming.
http://www.newio.org/ - AIM: nystromchris

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html



Other related posts: