Game Development Community

Dynamic creation of buildings based on data

by James Litton · in Torque Game Engine · 01/10/2005 (10:15 am) · 17 replies

Allright here is what I need accomplished. I hope this is possible in Torque and if not if there is some alternative that would get the idea accomplished.

Basically, I need to create a city based on city terrain database information that is provided for me. My question is, can Torque create buildings dynamically if given polygon position and size. The database information could be converted pretty much into anything.

Is anything like this possible? If not can anyone think of a feasible alternative that might function as a workaround. In the end it can't really be accomplished by doing the buildings (very simple objects - not textures, just basic outlines) all by hand given the huge scope of the project and the size of the cities.

Thank you for any information or any ideas.

Eric Kurt
Simulex Inc.

#1
01/10/2005 (10:24 am)
I would go for the creation of .map files from this data, which is easier to accomplish.

If you want to do it in Torque I would check this maze building ressource.

[EDIT] sorry, wrong link.I was looking for a ressource where someone built a maze dynamically. Well, there are some ressources building objects from the ground up.
#2
01/10/2005 (10:29 am)
Anything Is Possible(tm)!

That being said, you would need a lot more information than just polygon position and size. There are literally hundreds of data elements that go into the process of manually modelling buildings, and therefore would need to at least be initially modelled as inputs to your structure procedural generation algorithm.

Chris Calef talks a bit about procedural building generation in one of his past .plans.

Our project as well has a somewhat similar requirement, in that we want players to be able to build cities structure by structure, including walls, defensive structures (battlements, gates, towers, siege foundations, etc.), but we've decided to go with a "legos" style approach, and give the players a set of architectural structure "pieces" that they can snap together in various configurations during game play. You could use a similar concept as well and have your artists/modellers provide an extensive set of structural components or "pieces" that your generation algorithms could then use as building primitives.
#3
01/10/2005 (10:35 am)
Thank you for all the quick responses. When I said polygon position and size I wasn't really explaining it correctly. Actually what we have is the information for the 'footprint" of the building (interpreted from top down satellite data) and a height. So the buildings wouldn't be exactly 100% accurate they would just be extrusions of the footprint based on height.

Thank you again.
#4
01/10/2005 (10:43 am)
I got something like this working
by just adding a stock cube .dts object to the scene
and scaling/rotating/translating it to match the floorplan.

actually i did this on a per-wall basis and other stuff
but that was the main idea.

- which is a fairly brain-dead approach,
but i had a very limited amount of time
and not much Torque know-how.
#6
01/11/2005 (8:24 am)
Never underestimate the power and ease of a custom object.
#7
01/20/2005 (7:15 pm)
Erik,
When you say you are trying to extrude building footprints from satellite imagery, does this mean you have managed to get satellite imagery into Torque and use it to texture the terrain? I have been working on this and would be interested if you have been successful.
Ta,
Alice
#8
01/21/2005 (6:59 am)
@Alice - Not yet, that is part of what I am trying to accomplish. Its kind of a two part problem. 1. Getting the buildings to work as objects (don't necessarily have to have interiors) and 2. Getting the terrain and roads to show up as a terrain image.

Not being much of a programmer I am trying to figure out things in manageable chunks. After looking at the responses I think the easiest idea would be to try and convert the building data recieved into like a map file or multiple map files or something like that.

Could someone show me a method to draw a box in torque without using a .dts file or .dif, or point me in a direction to find the information? Even a simple line would work as well. Just something I can put into the scene without a prior file being created. I have the Game Programming All-In-One book but it just doesn't go past the basics of modifying the demo engine.

Thanks,
Eric
#9
01/21/2005 (7:12 am)
I can help you with that, because I am working on something similar. If you send me an email I could try to lead you in this direction.
#10
01/21/2005 (3:46 pm)
Quote:
Could someone show me a method to draw a box in torque without using a .dts file or .dif, or point me in a direction to find the information?

I already did.
#11
01/21/2005 (10:51 pm)
@eric: These double and triple posts happen when you do a post and refresh the page afterwards (like when you bookmarked it or your browser automatically opens it on restart). You can edit or delete them by using the icons on the particular messages.
#12
01/24/2005 (7:30 am)
@Dirk: email sent

@Matthew: I read your link twice and I just couldn't get things going based on your explanation. I can see how it would probably work based on the functions you listed, I just couldn't get it going. Totally my fault I just didn't understand enough of the terminology to work it out.
Thats mainly why I asked for something much more basic like a box or a line so that I could see how the basics are accomplished and work off of that. Thanks for the post though and I am still plugging away on what you have trying to get something to work.

double posts deleted..
#13
03/21/2005 (11:36 am)
Update: We have worked out a way to get the data (ctdb data) into a map file format. Our next problem is understanding exactly what a map file is contains.

I understand that each of the lines is a face of an object, and that the first three number sets are x,y,z coordinates (figures the fourth based on the first three?) its after the texture name that I start to lose understanding. What are the bracketed numbers that follow and hte last three number sets at the end? I have looked for a resource containing information on this.

Could someone point me in the right direction or explain what the numbers are attached to?

Thanks,
Eric
#14
03/21/2005 (12:21 pm)
Those are texgen co-ordinates. I would suggest not worrying about them if you can manage it; they're pretty much a black art.
#15
03/21/2005 (1:00 pm)
Who knew that dabbling in the dark arts was a prerequisite for Torque.

Unfortunately that is kind of bad news in that I am getting an error when I try to map2dif and I had just assumed it was because I didn't understand the entire sequence.

I get an error that says:

Parsing mapfile... Error processing entity brushlist on or near line: smaller_rec_test.map:17Error parsing map file

Any ideas what that might be coming from? Am I able to paste code from the map file in the private forums?

Thanks,
Eric
#16
04/02/2005 (2:08 pm)
Yeah, go for it.

Did I already suggest you might want to just write your own custom object for this task?
#17
04/03/2005 (12:27 am)
Here is some format specification. The error message you got shows that something is wrong with your map. It should look similar to the one in this thread.