Game Development Community

How to make the world repeat?

by Chris Cain · in Torque Game Engine · 03/30/2005 (7:34 pm) · 7 replies

I'm sorry that I've been posting so many questions recently....

I'm not sure how I should go about making a repeating world... Basically, I want the world to repeat over and over, not just the terrain. I was thinking of just using setTransform to link the player back to the other side of the terrain, but then any objects on the other side would just suddenly appear from no where. Then I thought about ghosting all the objects (including buildings) 6 times over so that they never just appear randomly... but then I worried about issues with lag.

Does anyone know a better way to do this? If not, could anyone explain how I would ghost over every object 6 times?

#1
03/31/2005 (2:07 pm)
Best thing to do would be to setup something in the On Mission Area Leave function that takes a players transform and sets them back at the begging, then just make sure to make the edges of your mission area far enough out that the player doesn't see everything magically appear.

Also in your terrain make sure that the terrain at the mission area edges is all the same, that way a player isn't running and all of the sudden a hundred feet in the air or worse a 100 feet below the terrain.
#2
03/31/2005 (3:52 pm)
Thanks for your response.

Is there anything I can do about the players that end up on the other side? .. Like, if theres a player thats on one side of the world, and another player goes around the world on the other side, and he warps to where the 1st player is... is there any way to make it so he doesn't just appear, or will I just have to live with it? (I don't mind, its just I wanted to make sure there wasn't any other way.)
#3
03/31/2005 (4:02 pm)
I here's a thought... As you get close to the mission area edge begin to limit visibility either via fog, or just plain limit the visible distance. At the edges of the mission limit it to like 1 foot or so (I have an algorithim I could show really quick but my time is super short, maybe tommorow), anyways when the player warps he should just barely see the nose on his face, and as he enters the mission area gradually increase his visible distance or reduce the fog etc.
#4
03/31/2005 (4:12 pm)
Thats a very interesting idea! I like it! Thank you. When you have enough time, feel free to post your algorithim and I'll try to impliment it ^_^

Thank you very much ^_^
#5
03/31/2005 (4:28 pm)
Visiblity should be the a square of the distance from the Mission boundry.
function LimitVis(){
schedule(5000,0,"LimitVis");
%player.visibility = %distanceMissionBoundry * %distanceMissionBoundry
}


Thats psuedo code, you will still need to find the distance to the mission boundry and figure out which stat it is that limits player vision
#6
03/31/2005 (5:24 pm)
Thank you Dreamer ^_^
#7
03/31/2005 (8:28 pm)
That should actually be 500 not 5000 for smothest results, you want it twice per second not once every 5, but I think you get the picture.