-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|660|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Blogs Home -> Blogs


 
Jayenkai
Created : 09 May 2008
Edited : 12 May 2008
System : Mac

Whoosh!



Right off the bat, I'll say the following!
I don't want to step on what DrOnuki's working on! It's just his absolute lack of track editor made me wonder how hard it would really be to create one.

About a week ago, I started playing about with one, and.. To be honest, it didn't really work out too well.
I might've ended up with a nice corkscrew effect, but it was still a flat track, and I couldn't really do anything nice with it.

So, last night, I restarted the project...


First off, make a pivot in the center.
From that, add extra pivots around it, which form the base of your track..
That is.. You want to make this shape with the pivots.

\____/

Tie them all together so they're parented to the central point.

Next use the MoveEntity and TurnEntity commands to twist the central pivot in the form of your track.

All the other points will move along with it, so use EntityX,Y and Z to grab their locations.
Turn those locations into vectors, make up triangles between them, and add textures along the way..

Result..


So far the track editor's far from perfect, and is simply a Hit left to turn left 45 degrees, up to go up, etc type thing.
It's insanely easy to create tracks that don't ever loop properly, too, So I'll spend the next few hours trying to get a decent editor up and running, and then we'll see about making some sort of game out of things.

Luvly stuff!
More to come? (Or I'll probably forget all about it!!)

 

Comments


Friday, 09 May 2008, 13:05
Scherererer
that's really cool! just in time for speedracer too, now i'd just like to see a game with a car that can make those loops! (have fun adding centripetal physics -- i have enough trouble doing it for class!)

|edit| why are there so many surfaces? |edit|
|edit| maybe you could segment the track when you export it, and then EntityVisible the segments in and out based on where you've driven to |edit|
Friday, 09 May 2008, 15:08
Jayenkai
So many surfaces is due to there being lots of curvey stuff going on
.. Well, that and my general "Jay sucks at 3D" stuff!


To illustrate, the track is built of lots and lots of "panels".
The blue rectangle above shows you a single panel.
It's it's own little surface, with it's own set of vectors and triangles.
I'm not sure if it's better to make a lot of surfaces, or to just dump everything into one surface.. I'll figure that out later, or you can all let me know!

There's also reverse surfaces, too...
So, it all adds up pretty quickly!


At the moment, I'm not really worried about the amount of stuff onscreen! I might do later on, but for now the more complex test tracks are still running nice and smooth on my rubbishy Celeron system, so.. ..?!


And, as for the actual physics involved..
....

Well, I'm still calling it a track editor, right now
Friday, 09 May 2008, 19:31
Jayenkai
I spent a good half hour or so working out that "Surface" issue..
Then I realised something odd.
The top of the track didn't seem to have any more surfaces, the more I added.
Turns out, if you addmesh one mesh into another, it throws all it's surfaces into one..
So, TopMesh and BottomMesh are now blended into TotalMesh, and.. bingo..

Surfaces is now 2!
One for the top.. One for the bottom!

Does that help?

Who knows!!!
Friday, 09 May 2008, 20:03
Jayenkai
And, as if to say "Wooooooo!", here's a nice screeny of an incredibly complex track!



That track has 3000 pieces to it.. (with each loop being made up of about 36 pieces)
That's as good as my onboard gfx card can handle..
If I go to 4000, it doesn't show up!!

Tomorrow I'll be testing it out on the rubbishy celeron, and seeing if that can cope.

Either way, 3000's plenty enough to make a decent sized track.


Tired, now!