Modify vertices after object creation?

Previous topic - Next topic

kwagner

#15
Thanks, that is how I ended up doing it, though at first I had autonormals and that was probably causing some slowness as well.

erico: I always like good music to go with programming :)

There's definitely some optimizations I can do, such as increase the size of segments in the distance, but for now it works well enough.

Had to wait overnight for the vids to upload and process, but here they are:
10 lines per segment: http://youtu.be/k7P5SibwVHs
20 lines per segment: http://youtu.be/TgbFcqDf8zk
30 lines per segment: http://youtu.be/k_Jnl8bUGzQ
some notes:
- the stuttering I think is from using FRAPS (probably dumping info to disk). When it's not on, the demo doesn't do that.
- in the 10 lines per segment video, I move the camera around at the end to show the true 3d nature of the pseudo-3d track, and the advantage of going this way (instant change in perspective). I forgot to turn the camera, though that works as well and is useful at certain angles.
- I didn't take the time to change the texture coords for different segment sizes, so that's why the road looks squished or stretched depending on length.
- there's more warping/distortion than there should be on the segment closest to the camera. I struggled with that one a bit, and have some fixing to do on it still. I was hitting some odd drawing results for some reason when I crossed z=0 into the negatives. I didn't want to get bogged down on that issue so I made a workaround for now.
- the cars float a little, and don't adjust their pitch for the road. I wasn't able to get the scaling as right on as I did when I was using sprites, something I'll fiddle with later on.

erico

The movement is great, the notion of a road going is spot on.
I noticed the camera sometimes move abruptly, some easy-in-out would come nice, but I guess that is for later.
You could also try some little Z rotation when on a curve and speed is high.

With the current system, can you do mountains or hills on the side road?

All looking and moving really nice, what is your plan for the game? Lotus type racer?


kwagner

Thanks :)

Yeah the demo was tied to framerate, no smoothing, so that could have been some of what you saw. It was also somewhat fixed in view, which will definitely be improved upon. Lots of areas for improvement.

Mountains or hills could be done by replacing the flat striped area with some pyramid shapes or a few more polygons. I want to add things like a bridge over water, guard rail, and some mountains and hills along with objects on the sides to give it some flavor, as well as road splits and merges for branching choices.

The ultimate goal would be to make something that puts these games in a blender: road rash, outrun, san fransisco rush 2049, f-zero, and similar

kwagner

Hi again :) Just an update on how things have progressed:

I redid everything in a new project after doing prototyping, and then of course proceeded to mess up the cleanliness of it when testing new things :D My main concern was handling multiple roads. I've seen lots of pseudo3d roads online, but not many implementations of road splits. I tried several options, but settled on the one I will show below. While it has some limitations, I think clever map design will hide most of them :whistle:

Some videos:
first: http://youtu.be/lRQxHKE_NT4
This shows off height changes between road branches, as well as texture changes on the sides of the map (road texture could change in a similar manner). Ignore the jumpiness of the vertical changes, I didn't put any smoothing on it yet.
Second: http://youtu.be/7qFWum5kwPw
This shows another branch at the same time (you can have up to 5 roads on the screen at once), veering off to the left through a curve and then when it straightens out again. In a future update I'll combine both of these functions to create "overpasses" to take cars from one side of the map to the other above the 'ground' roads.

erico

Looks great!

I take your car is able to race on the dirty like on LOTUS right? No invisible walls.
If that is the case, how are you going to turn off the branched road? Is that possible or am I going nuts?

kwagner

Thanks!

Yup, no invisible walls. I'll have some rudimentary "sliding down slope" physics for handling varying terrain. Of course there will be trees and fences and other objects in the way that might prevent the player from changing branches, but otherwise it should be freeform.

In the method I settled on, all branches follow the curves of the "master" road. The idea would be more for forks in the road as 'shortcuts' or bridges or pit stops than for a T intersection, for example. This keeps multiplayer (which is a goal) simpler in terms of tracking all cars and objects with x/y/z in a linear fashion. I can make use of the terrain in between roads (and spread the roads very far apart) to make it "feel" like it's independent, like in road rash or similar games where there's branch options which then meet back up later on (with some mountain-y terrain in between). I also want to use the branches as a more conscious "making choices" mechanism, where a powerup might be on one branch and danger on another.

erico

Great idea, specially considering multiplayer.
Water, tunnels, cross roads possible too?
You could add maybe jumps? Like a broken bridge or a ramp? (less mario, less trunk on lotus but more physiky?
Just some ideas.

kwagner

Yes, yes, and yes :) All things I have planned and want to implement (and things which I wasn't able to make look right in my 2d versions previously). I think the jump to 3d for display will make some of those much easier to work with. Jumps/ramps are an interesting addition too, and shouldn't be too hard since I'm dealing with "y-axis physics" already. My next hurdle is to make bridge sections, which I will then improve into roads being able to cross over each other.