Game Development Community

Randomly Generated Terrain... Is it possible?

by Alex "Alakath" Cantatore · in Torque Game Engine · 08/07/2003 (2:09 pm) · 23 replies

I'd like to start this off with the disclaimer that I do not yet own the Torque engine (hence my posting in the public section). However, I have an idea pretty well planned out for when I do get the engine. Thus far I have been able to verify the ability of the engine to do whatever it is that I am considering for the game, but I really have not been able to find much information about the world building process at all.

What I would really like to do is randomly create terrains, and then quasi-randomly (i.e., random but not so random that the objective spawns in one player's starting location) position buildings and trees and whatnot on those terrains. Preferably, this would result in a situation where users would never play on the same map twice.

I have seen the line about it being possible to do anything with the Torque engine if you put enough time and skill into it, but if this is something that would involve rewriting the entire engine that may be a little more than I am willing to bite off. I see that WorldCraft and QuArK are mentioned, which leads me to believe that environments may need to be rendered and compiled before run-time, which would make my plan impossible, though I also have seen some posts about height maps which leads me to believe my plan may have merit... That and I seem to remember that maps downloaded ridiculously quickly even with dial-up while playing Tribes (in comparison to Half-Life, for example).

Realistically, I would like to be able to create and distribute a level to players in less than a minute or two so that downtime between rounds isn't too excessive. Is there any chance of this happening? I don't mind spending time creating the randomizer and whatnot, but to have to rewrite the entire display engine is beyond me.

Regards,

-Alex

About the author

Recent Threads

Page «Previous 1 2
#1
08/07/2003 (2:18 pm)
Torque can do this pretty easily. All map information save terrain files is sent over the wire at join time. It would be simple enough to make the terrain data be dynamically generated.

Though of course this would entail messing with internals, so it might take you a few months to get to the point where you'd be confident enough with the engine to actually do it :)
#2
08/07/2003 (2:25 pm)
Eh, I don't mind spending time on it, just as long as I know that time will result in something ;) Thanks for the speedy response, I think I'll get around to buying and downloading the engine this coming week when I have some spare time and start cracking.

What exactly are the "terrain files" though? How do those differ from the "map information?" My guess is that terrain files are the textures or something, and the map information would be the mesh, lighting, and objective information, but really I haven't a clue.

Regards,

-Alex
#3
08/07/2003 (2:38 pm)
The "terrain" in torque is a heightmap converted at runtime into a mesh and textured and rendered.

everything else is either a 3d mesh from a 3d tool ( rocks, trees, bushes, etc. ) or
a CSG "interior" from Quark or Worldcraft or anything else that will generate a .map file.

So randomly PLACING buildings and "interiors", and other objects is feasible. As is randomly generating the hieght map.

Now that it is FEASIBLE does not mean it will be TRIVIAL. Random placement of objects is trival. Random placement of buildings is less trivial because of vertical positioning to make sure things are not in ridiculous places.

randomly generating the height map and texturing it will be less trival because that part of the C++ engine is probably one of the most arcane and dependant on lots of other stuff, like jello. Poke the terrain code and lots of other code quivers.
#4
08/07/2003 (2:40 pm)
Map information == building plants .. other stuff in level.

terrain files == actual terrain data, custom format .ter


are you going to generate the building's and such as well?
that is cool im making one of them now..
(not for this engine)

to gen the terrain dynamically would be fun.

wouldn't intimidate me as much as building dynamic building's.
#5
08/07/2003 (2:57 pm)
Ha ha, no, I am not going to be randomly generating the buildings as well, I would like to get this released someday ;) I plan on modelling the buildings beforehand and choosing from a large number of items to place in the actual world. The general idea (not to give too much away) is that a war of sorts is taking place that end users are taking part in, fighting different conflicts in the battle. Different sides will have different buildings (i.e., hospitals or something) and then all hospitals that are owned by a side would look the same, regardless of map, so that gamers will have some idea what they are looking at.

Thanks for all of the information everyone, just knowing what you have told me has already got my brain thinking about different strategies to implement my plan and has also gotten me incredibly psyched as I now know that my idea may someday actually exist in playable form. And, quite frankly, that rocks. As long as it is feasible then it is something I am willing to pursue.

And I almost forgot to mention that I love Jello. Except for Pistachio Jello. Eeeww....

Regards,

-Alex
#6
08/07/2003 (3:45 pm)
Randomly generated terrain and randomly placed buildings won't take long to implement in Torque. Its all there... it just isn't set up to be used like you want at this point, but that won't take too long to change for a somewhat decent programmer.
The problem is as Jarod pointed out to place the buildings on the right places and not on ridiculous spots. Perhpas you can do this by only making certain parts of the heightmap dynamic. For example have 2 static bases, and generate everything in between them... just an idea.
#7
08/07/2003 (4:07 pm)
I dont see a major dilema with the placement of buildings..
doing a collision test using the bounds will save you all the trouble.

lets not forget dynamic terrain..
so if the ground is not flat enough at the location you desire..
you merely flatten it based on the floor plan of the building.

not a big deal.
#8
08/07/2003 (7:04 pm)
Badguy simpler said than done, there is no real infrastructure in place to support that with a .dif file, .dts yes, .dif probably more work that you can imagine.
#9
08/07/2003 (7:37 pm)
Sure there is guy what you mean?
you can start with the bounds of the object..
and if you need more detailed you could go as far as casting somerays from the bounds up into the object.
#10
08/08/2003 (9:12 am)
Hmm, my current plan is to dynamically place the buildings first and define that the ground underneath them must be flat (or curved, if the building is meant to be on a slope or something) and then generate the terrain around the buildings. This would allow dynamic generation and placement of terrain and buildings as per my original design, hopefully with the least amount of trouble. Does that sound like an amicable solution to everyone?

Regards,

-Alex
#11
08/22/2003 (3:35 am)
I wonder if it take cyberplanets, could that be done, could a cyber planet be imported in into Torque andused as terrain I would presume all the terrain editng would have to be done outside of Torque for the cyberplanet as I wish to use Mojoword Editor with Torque (go to www.pandromeda.com to see what I am talking about) but could it be done? I mean the planet would justbe scenery and could I put in more than one?
#12
08/24/2003 (10:13 am)
Alex: I go for the other direction - randomize the terrain, then smooth or flatten around .dif's that need it, and place the .difs. But that's just personal preference :-)

I do randomized terrain already. I'm doing it from the scripting side ( a little slower, but allows for end user modding). The only complication I've got left is transmitting the completed mission to the other clients (since just deforming the terrain doesn't mean it gets transmitted to the client) and I think I've got that licked too.

In the end, I still think I prefer hand created levels, but, random terrain really does add some diversity to things :-)
#13
08/24/2003 (11:50 am)
Random fact: Most of the levels in Tribes were based off of randomly generated terrains. It's that last 10% that takes human intervention, though.
#14
08/24/2003 (1:04 pm)
The system I am working on is a hybrid, I manually put potential building "spawn points", then randomly choose where to spawn a given building. You can create more "realistic" compounds and complexs this way. You can use a heuristic to determine what the next type of building should be and weight where it should be placed.
#15
08/24/2003 (2:31 pm)
Ben: That last 10% is the most important, IMHO :-) We're using both normally created levels (Eric Forhan's job) and randomized levels. I think the pre-created levels are way superior, but those random levels give something new to the game at times.
#16
05/12/2004 (5:06 am)
Did you manage to get this to work, in the end? Transmitting the terrain is something we're interested in doing,too.
#17
05/12/2004 (7:46 am)
It works beautifully in single player or non-permanent server games. There is still a bug somewhere for permanent servers that Davis is trying to track down.
#18
05/12/2004 (8:06 am)
Was there a lot of source code work in there? are you planning on putting it back into the HEAD?
#19
05/12/2004 (8:11 am)
I cannot speak for Davis, but I would think it's safe to say that if this were to happen, it wouldn't happen until after TZ is released.
#20
05/12/2004 (8:47 am)
Probably a fair amount of source code work. Certainly a lot of knowledge, even if the changes aren't significant. :)
Page «Previous 1 2