What happens if? (Terrain question)
by Dreamer · in Technical Issues · 03/01/2005 (1:24 pm) · 16 replies
Ok now here's a quick question and I can't seem to get my mind around an answer yet so i think I'll pose it here.
Without any mods, TGE will render terrain infinitely in all directions, if I'm reading everything correctly. However there is a physical limit to the amount ram on any machine.
So my question is this, say I have a server running the starter.fps and me and a buddy join game about the same time, and run off in exactly the same direction... What if me and 3 of my friends log in and run in 4 seperate directions.
How does the engine account for this? Does it map the terrain as a large sphere so eventually we'ld see eachother again? or would render flat until all the ram is consumed.
Also what the heck are mission areas for? I'm reffering specifically to the bounding boxes surrounding any area I try to create. The reason I ask is that I read somewhere in here about force-fields, and if memory consumption could become an issue under a client server model, I would like to turn the mission area object into some kind of forcefield that would keep players from exploring too far off the beaten path.
Thanks for taking the time to read this and answering.
Without any mods, TGE will render terrain infinitely in all directions, if I'm reading everything correctly. However there is a physical limit to the amount ram on any machine.
So my question is this, say I have a server running the starter.fps and me and a buddy join game about the same time, and run off in exactly the same direction... What if me and 3 of my friends log in and run in 4 seperate directions.
How does the engine account for this? Does it map the terrain as a large sphere so eventually we'ld see eachother again? or would render flat until all the ram is consumed.
Also what the heck are mission areas for? I'm reffering specifically to the bounding boxes surrounding any area I try to create. The reason I ask is that I read somewhere in here about force-fields, and if memory consumption could become an issue under a client server model, I would like to turn the mission area object into some kind of forcefield that would keep players from exploring too far off the beaten path.
Thanks for taking the time to read this and answering.
#2
And then IF you could theoretically run out of memory in such a case, how do you prevent a player or players from doing this, which would most likely cause the server to crash?
Thanks for the response though.
03/01/2005 (1:43 pm)
That was the crux of my question, i.e. if terrain is rendered in 256x256 ad infinitum, how does the code handle players running in opposite directions for prolonged periods of time, most especially how does a dedicated server on a single server / multi client setup, handle things when this happens.And then IF you could theoretically run out of memory in such a case, how do you prevent a player or players from doing this, which would most likely cause the server to crash?
Thanks for the response though.
#3
1 2 3
4 5 6
7 8 9
Now, you start in block 5 and run over to block 4, but as soon as you hit block 4, the system puts you at the edge of 5 and 6 but records that you are one grid to the left. But all of the stuff that was on block 5 is moved to block 6.
Now all of this is relative to your player, so each person will have a different grid based on their unique position.
HIH
03/01/2005 (1:48 pm)
Try thinking of it this way. This is a grid of nine terrain blocks:1 2 3
4 5 6
7 8 9
Now, you start in block 5 and run over to block 4, but as soon as you hit block 4, the system puts you at the edge of 5 and 6 but records that you are one grid to the left. But all of the stuff that was on block 5 is moved to block 6.
Now all of this is relative to your player, so each person will have a different grid based on their unique position.
HIH
#4
03/01/2005 (1:54 pm)
I dont see problems with RAM useage (with a reasonable number of players of course) as long as you have a decent server, but then again Im not a TGE programmer.
#5
123
456
789
I start in position 5 run south to position 8 run west to 9 at which point postion 10,11,12...etc... would be created if I continued to move west.
But what is really happening is the world is infact wrapping itself around so say I left position 9 and headed southwest I would be at position 1 continuing southwest then I should eventually end up at position 5 then 9 etc and so forth?
At least I think thats what your saying.
03/01/2005 (1:56 pm)
Ahhh ok! see what I understood was something like this....123
456
789
I start in position 5 run south to position 8 run west to 9 at which point postion 10,11,12...etc... would be created if I continued to move west.
But what is really happening is the world is infact wrapping itself around so say I left position 9 and headed southwest I would be at position 1 continuing southwest then I should eventually end up at position 5 then 9 etc and so forth?
At least I think thats what your saying.
#6
You won't run out of memory and the server won't crash.
EDIT: And no, you will never wrap around to the other side of the map.
03/01/2005 (1:58 pm)
Just to make it crystal clear: even though a block of terrain might be rendered multiple times in different places, there's only one copy of the terrain loaded into memory.You won't run out of memory and the server won't crash.
EDIT: And no, you will never wrap around to the other side of the map.
#7
03/01/2005 (2:04 pm)
Yes, thats the way the repeating terrain works, BUT, it repeats for each client. So like Mark said you will never end up on the 'other side' of the map.
#8
So, you can have several players traveling towards the edges of the universe at several hundred kilometers per hour for 72 hours without troubling the server.
In other words, it's one of those things that seems like a problem in the human world but isn't one in the computer world.
03/01/2005 (2:08 pm)
During the development of Tribes 2, they considered this possibility and performed a test. They started server with AI players in flyers going in opposite directions. They left the server on for four days with no significant increase in memory usage and no other obvious signs of distress.So, you can have several players traveling towards the edges of the universe at several hundred kilometers per hour for 72 hours without troubling the server.
In other words, it's one of those things that seems like a problem in the human world but isn't one in the computer world.
#9
The farther your player gets from the origin, the less "room" you have in their coordinate position for precision, and you will eventually reach a point where things become "unglued" as it were regarding physics and such. I haven't actually run this test personally, but various devs have reported "unusual" game states at very far from the origin coordinates.
03/01/2005 (2:14 pm)
What you will run into however is completely unrelated to terrain, but to your player's grid coordinates: floating point precision errors.The farther your player gets from the origin, the less "room" you have in their coordinate position for precision, and you will eventually reach a point where things become "unglued" as it were regarding physics and such. I haven't actually run this test personally, but various devs have reported "unusual" game states at very far from the origin coordinates.
#10
03/01/2005 (2:26 pm)
On Stephen's note, I ran into a problem when my tank fell through terrain and I let if fall for quite a long time. It started to jutter around the screen slowly, and sped up until it was just a blur going back and forth. Nothing but the tank's position was affected though, I could still fire and turn the turret.
#11
Once I accidently did that and then called my camera to player rather than player to camera. I had to reload the mission :(
Sorry off topic, just got reminded of it.
03/01/2005 (2:55 pm)
Every once in a while when I'm building a mission I'll have my camera below terrain level trying to reposition something, and accidently move my player to camera position. The player will fall for the next 30 minutes or so while I'm tweaking things here and there, eventually I'll get really bad camera stutter....Once I accidently did that and then called my camera to player rather than player to camera. I had to reload the mission :(
Sorry off topic, just got reminded of it.
#12
05/07/2005 (12:08 pm)
Sounds like it might be a good idea to add a kind of garbage collector to the engine that weeds out objects too far from the mission area, including too far below.
#13
@Kenneth This strikes me as a bad idea:
1) Evaluating everything that can move to see if its inside some border is going to be a small performace hit, per-frame. Not some great tragedy but a concern.
2) Garbage-collecting players is just rude (but could be avoided in an implementation of your suggestion). "Garbage am I?!"
3) There is no reason #3
4) No pooftas
Okay, so that's not very compelling. I can't put my finger on why I don't like it. It could be a purely emotional objection, or could be something I haven't conciously thought of yet. I'm not sure. Bah humbug.
05/10/2005 (5:31 pm)
@Dreamer: Couldn't you just reposition your camera above the ground and bring the player to the camera again?@Kenneth This strikes me as a bad idea:
1) Evaluating everything that can move to see if its inside some border is going to be a small performace hit, per-frame. Not some great tragedy but a concern.
2) Garbage-collecting players is just rude (but could be avoided in an implementation of your suggestion). "Garbage am I?!"
3) There is no reason #3
4) No pooftas
Okay, so that's not very compelling. I can't put my finger on why I don't like it. It could be a purely emotional objection, or could be something I haven't conciously thought of yet. I'm not sure. Bah humbug.
#14
05/10/2005 (6:54 pm)
A garbage collector doesn't have to run every frame, and what it does with "garbage" is open to discussion. You only have to look at objects that are moving, and you have to do something with them anyway because they're moving. So if it's moving and its new coordinates are too big, you do something special, such as deleting the object or bringing it back into range.
#15
Thanks,
Roger
06/17/2005 (11:29 pm)
This is actually very similar to a topic I would really like an answer to. I'm trying to model a very small island surrounded by water and no matter how much I tweak the map and reset sizes, I can't seem to keep the wraparound rendering from showing another copy of the island in the distance. Is there some way to disable the terrain wrap around?Thanks,
Roger
#16
06/20/2005 (4:56 am)
@Roger - there is resource that does that.... though it still shows the hole in the waterblock where the island should be. The collision also continues to function.
Torque Owner Nate "Nateholio" Watson
Default Studio Name