3DWorld (76/293)

From:Steven Dobbs
Date:16 Apr 2000 at 12:30:33
Subject:Re: Crazy Taxi engine details

Hello Paul

> Anyway, there are a few things that are of particular interest. Firstly=
,
> the levels are very big. It takes quite a long time to get from one sid=
e
> to the other. Obviously a lot of objects and textures are reused, but I
> was wonder about the coordinate system used. It would be impossible to
> use one single origin point I think, you would need some seriously big
> numbers to deal with it. More likely I think is that the level is split
> into sections, each with it's own origin that is used for all the
> various objects in it. However, there must be some overlap to allow
> object to get transported to other zones, or perhaps the objects jump
> coordinate systems? I'll have to try pushing something from one end of =
a
> city to another..
>=20

well ints are big =B12billion. If you had doubles that would enable you t=
o
easily map a city. doubles are sometimes faster than floats btw - they se=
em
to be on the 040 anyway.

> The next thing is the physics engine used for objects like cars and
> boxes. It allows objects to tumble and fall realistically and roll
> along. It's quite spectacular when several boxes go flying and bounce
> away. I'd like to hear peoples ideas on how to impliment such an engine.
> Note that object bounce off the ground and off each other, so you need
> loads of collision detection, but it need not be 100% accurate as thing=
s
> happen very fast.
>=20

theres a couple of ways, none of which I have perfected yet so take what =
i
say with some caution :O). you know where the centre of mass of an object
is and you know where an objects verticies is. The penetration of that
point and anothers polygon then enables you to calculate the linear and
rotational force on the c.m. You can then do momentum+angular momentum
calculation. At the end you get a modified momentum vector and a new axis
of rotation.

the other way is similar. again you look at the penetration of a point. T=
he
more it penetrates, the higher its force, like a spring. the object can b=
e
modeled as a collection of atoms that are sprung to each other - like
latice simulations in physics - it means that a force on one will then be
applied to all others and the object will move and tumble. For what its
worth, for my game I'm trying to perfect the former.

> The next thing is the car you drive. This used the very fast collision
> detection too. Each wheel seems to independantly checked, as well as th=
e
> body. You can drive over buildings (on the roof), barriers (if you land
> on them) and even other cars. You can't flip the car upside down, but I
> don't think that's a limitation of the engine, more of the gameplay.
> Again, this comes back to the collision detection, how do you manage so
> much of it so quickly with such accuracy (it's not perfect, but very
> nearly)?
>=20

it might know by LUT, what buildings are in each zone, so it only has to
detect colisions with them. Then there is the cars, but they can be
presorted as well to which of the many cars are likely to colide, then th=
e
pixel perfect collision detection can be used.

> Oh, and the people standing around seem to be able to predict where you=
r
> car will go and if it will hit them. Is there a good algo for this?
>=20

On Beyond2000, there was a short piece about an industrial traffic
simulation, the sort of things it considered for overtaking and stuff was
gap acceptance. Each car if the gap is big enough will travel into a flow
of traffic or overtake, but all will brake if something comes a head of
them, they all have individual tailing distances too.

> Finally, the other traffic. The cars stop at traffic lights, make prope=
r
> turns, drive realistically etc. The big tankers even look realistic,
> bending in the middle where the cab joins the trailer. Has anyone got
> any good ideas on how to manage something like this? I'd set up routes
> around the roads and have cars stick to them. Traffic lights would be
> done by putting an invisible obstacle in front of the junction, and the
> cars would naturally stop before hitting it due to their AI.
>=20

if you can perfect the colision response system, then you'll have all the
physics to simulate trailers.

Regards
Steven Dobbs
"AMIGA Farm"