Sign in to follow this  

How can i make a scene like "GTA" or "True Crime: Streets Of LA"?

This topic is 4744 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The idea of this question, is implementing a scene that can render one huge stage ( a complete city ) without pausing the game. to clearify what i want exactly first i know that GTA loads a small section of the world from the hard drive at startup, then as the player wanders through the world, it loads the sections that the player is moving to - before he get there -. and because of memory limitions, it frees the sections that the player moved out of it. second it's obvious to the eye that there is some kind of LOD technique, i.e Loaded sections have different levels of details which means that the section you're standing in, is highly detailed, - for example you can see windows and doors edges -, while far sections - far but still viewable to the player - contain only boxes with special textures that make them appear as buildings. the thing that i don't know is how they do the rendering and ColDet stuff that fast. what is the algorithm involved in all of this? cuz ( OCtree or Bsp ) don't seem to serve this matter!! they are static methods, and must be computed for all the scene as one peice. - not sure about that, but that's what i know -. the other thing, can i design the world on any editor, or i must have\do a specialized editor? I wish the answer be as an algorithm, a detailed one please. some dataflow diagram would be a great thing to have. or a link to an article that discuss such a matter. or a tutorial with a complete code example. or all of them ofcourse

Share this post


Link to post
Share on other sites
Quote:
I wish the answer be as an algorithm, a detailed one please.
some dataflow diagram would be a great thing to have.
or a link to an article that discuss such a matter.
or a tutorial with a complete code example.
Maybe some folks round here have some links, but that list is a bit optimistic - a huge amount of research goes into this sort of graphics, and it's often more a case of many simple algorithms working in harmony rather than one big "I do everything" algorithm.

I did read an article (haven't got the link anymore) about the recent Spiderman game for the PS2 (and I think its similar to what I heard about one of the Driver/Midtown-Madness type games) is that the collision/animation updates are done by using a "bubble" around the player.

By that, the geometry is paged in/out of memory as you already know - but all local objects are culled by a local ellipse to limit how much work the engine has to do per frame. Only objects within this region get their physics/animation updated for example.

The important thing to note there is that objects outside of this bubble aren't necessarily looked at on most frames. This is evident in GTA games through the lack of continuity with the pedestrians/traffic that you encounter.

Quote:
the other thing, can i design the world on any editor, or i must have\do a specialized editor?
You might be able to retrofit an existing editor (such as Max) using plugins, but it entirely depends on what your code is expecting to work with. If you can get your engine to work with .3ds models (for example) then you can use MAX, but if you need a highly pre-processed dataset with a very specific data layout (to improve paging/streaming of new data) then its quite likely you need some custom tools.

hth
Jack

Share this post


Link to post
Share on other sites
Hi:
instead of using bsp og quad trees, witch is great for geometry, but dont give you alot of controle, create a more abstract node system, where you can test each node by player position, 'should i be in mem'? You can also add supernodes witch contains alot of regular nodes, and have a 'should i test if my children should be in mem' test...(simply a distance from center treshold) Now you can start to attach geometry to your nodes, like:
node144:Load("Building.geo")... SuperSuperNodes can be whole city parts and so on.. the hard part is to fit geometry in one node with geometry in another!

try it out in a simple test app, with simple 2d graphics loading and unloading... when it works like it should, save the parts you can use in your real game, and start adding nodes and stuff to nodes!

the realy hard part (i think) is to add life , collision and gameplay to this loading and unloading world... GTA solves all the problems pretty god ( with speed of light havoc cleaners :-) , witch only work when you are somewhere else )


For the long distance stuff, use a second layer of nodes with only long distance stuff! like 'you can see this simple skyscraper model in a 12 km distance')

-anders!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
gta is interesting, (and nearly best all time game for me).
This might probably be what happens anyway, but I was thinking you
could maybe have some kind of rolling memory thing, where things are only
taken out of memory when they need to be. That may not be a good
explanation, an example might explain it better, say if you turn quickly or something, (with mouselook) instead of trying to render every thing seen as
you turn it only partially renders some of it, basicly it waits for a stationary view before any (particular) scene is completely rendered. This doesn't neccessarily have to be a long time, the idea is just to save on renderering where you can.
What do you think?

Share this post


Link to post
Share on other sites
the technique is called paging
heres stuff that deals with textures but its generally the same idea with meshes as well
http://www.vterrain.org/Textures/ground_textures.html

i also have done my terrain using a similar technique where only the area around the camera is kept in memory

Share this post


Link to post
Share on other sites
Sorry for me being a greed one.
Thanks for replies

For the links i'm currenlty viewing it...

but i want to ask about what "uncutno" said:
[QUOTE]
'should i test if my children should be in mem'
[/QUOTE]
are you talking about a hierarchy that ends with one parent? I don't think this is good!!
cuz with a huge world like GTA's, going down dividing it into small divisions to reduce memory uploading time. then .. traversing this hierarchy to indicate which child nodes to be in the mem would take a lot of time................................. - as i think!! -.

Share this post


Link to post
Share on other sites
Fatal Error:

Its important that each supernode have its own distance test, so that a supernode covers all its childnodes with this test, like a simple distance from center... If a supernode falls outside, you dont need to test its children...

Nodes thats already in mem, could be tested separatly in its own list.

Remember, the nodes could be big and a 16 * 16 * 16 hierarchy would give you 4096 different nodes! No reason to have a node any smaler then what you can see from a single position (culling should be done trough another system, this tree is for loading)

You could test different parts of the tree at different frames, because you cant enter and exit 10 city parts at the same time...

As long as you have some sort of speed limit to your movement, you could easely calculate how often you need to test the tree.

Also, you could keep a 'urgent' list, a 'pretty far' list and a 'faraway' list over supernodes, so that you only test those close by often (save tree search results between frames)

This way, you would need to test:
16 supersupernodes ,witch maximum should give you 4 hits
for these 4, you need to test 16 supernoder, where 4 should also be maximum hit,
and then for these test 16 nodes:

16 + (4*16) + (4*16) = 144 tests, devided over 60 frames(1 sec) becomes ~2 tests per frame... no problem.



Share this post


Link to post
Share on other sites
LOD, Octree, Frustum Culling, and a brain keen on optimization.

These are the things you need. Oh that, and a separate thread for loading things (so the main thread doesn't get bogged down with loading.)

Share this post


Link to post
Share on other sites

This topic is 4744 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this