Archive

Vehicles

I got a basic vehicle going tonight. It still needs some serious tweaking (as does everything with ODE), but it’s usable.

It’s quite difficult to drive at the moment, with a tendency to fall over at high speeds when cornering. While I understand this is correct with regard to the physics simulation, it’s a bit annoying. With that said, I do have some fairly sharp inclinations that I was trying to drive up. Perhaps that would happen in real life as well.

I’ll probably have to resort to some nasty hacks like applying a downward force to the wheels when they’re touching the ground, or something. Oh well, I’m not going for realism :P

Physics #2

I got physics working on my terrain mesh tonight!

I only have barrels at the moment, no vehicles. However, this is due to deficiencies in other parts of my server, not the physics module. Once I improve that (which shouldn’t take very long, it’s just annoying to do at 2am), I’ll finally have the jeep in this old pic working.

A few other notes

  • The barrels in those screenshots are actually being simulated as spheres, despite the red box outline. Yeah, I know. Spheres roll better, though :)
  • The very first barrel I created when the system was working well enough to let it go anywhere got some fairly serious speed (and air!), taking a good ~10min to come to rest. As the crow flies, it traveled 15.3km.
  • I should perhaps make the gravity stronger. I suspect this is not how barrels are supposed to act.
  • That old screenshot I linked above looks really primitive looking compared to the current system. And it’s only 10 days old!

Tree placement

I spent a long time fighting with ODE tonight. I think I’ve finally got a handle on it, but it’s too late at night to bother doing any more with it. So, in lieu of fancy physics stuff, enjoy some pictures of trees, placed with a slightly better algorithm than ‘the center of the terrain patch’. Those closeups of the tree really show how awful the model is, though :(

Hopefully I won’t run into too many more problems with ODE, and I’ll have vehicles soon :)

Physics and noise.

In the last few days I’ve been writing the beginnings of the Universe server. I’ve run into a few issues along the way, mostly to do with the physics engine I’m using. Typically when I’m setting up physics for a terrain, I simply make one big triangle mesh that covers the entire terrain - nice and simple, and it works fairly well. However, the internet informed me that ‘very large terrains’ took ~20 seconds to pre-calculate physics information, and used 100mb of RAM.

Their definition of ‘very large’ was 1024×1024. Assuming I use my standard resolution of 1unit == 1meter, I would have a terrain of about 500000×500000. While I didn’t try it, I predict it would end badly.

My idea currently is to create a small trimesh under every physics-enabled object, and move it around as needed, syncing to the heights of the various bits of ground. I haven’t got that far yet, but I am making a triangle mesh that I can drop things on and have them kinda work (hey, it’s harder than it sounds!).

I also tweaked the noise parameters a bit more. The terrain is a bit more interesting looking now.

Finally I added ‘cool-cam’. This is from an article I read a while back on TheDailyWTF, and I think it’s quite a neat idea. Basically it’s just an automated camera that hunts down interesting things and looks at them for a while. With any luck I can get it to run on the big display wall :)

New textures #2

I did some more work on the new texturing system today. It’s looking a bit better now - I modulate the height value of the terrain with some perlin noise, so you don’t get the nasty lines of textures along a certain altitude that you used to. People who actually go outdoors on a regular basis tell me that this is much more realistic looking.

I also have trees now. Yes, they look awful. No, they are not permanent - a nice L-systems-based procedural generation system is in the pipeline, and will be replacing them ASAP. The things that are in there now are models from Quake1, or something, and are about 10 triangles each. Fast to render though…

The current placeholder models are very good at one thing - giving the eye something to judge the sense of scale with. Hopefully this will quell the persistant ‘what a small world you have!’ comments :)