News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > UnrealEngine2 Runtime > General Discussion

Reply
 
Thread Tools Display Modes
Old 7th Apr 2004, 04:12 PM   #1
debeoulve
Banned
 
Join Date: Apr. 7th, 2004
Location: The Netherlands
Posts: 7
Question (automatic) terrains from (x,y,z) values?

Hi,
First of all, I'm not trying to make a game, but I'm curious if I can use the runtime to visualise scientific (geological) data. So before I dive into the depths of the code/engine, I hope you're willing to answer some newbie's questions (TIA

So I have text files with (x,y,z) values, a height table.
1. Is there any way to quickly generate a terrain from those values?

2. Is there any way to write those values directly into an unreal level file and view the results? (this would be really nice to automate the level generation, allowing for real-time interaction between visualisation and modelling)

Thanks in advance!

Jos
debeoulve is offline   Reply With Quote
Old 8th Apr 2004, 12:53 AM   #2
ttl
Registered User
 
Join Date: Oct. 22nd, 2003
Posts: 51
1. You could code a program to create a 16bit greyscale bitmap (G16) from your text file, which could in turn be used as a heightmap in a terraininfo actor.

2. Well you cant get much quicker then just selecting a new heightmap in your existing level. But if you wanted to, you could code your own program, but this time have it so it creates an unreal map in .t3d format which is rather basic. My advice though would be just to keep a template map and import your new height maps into the template, and then if you like it and wont to do more with it save it under a different name.

NB: If you are not worried about performance you could make your on brush builder and build your terrain out of it instead, then you could just format text file so it can be loaded as a config file for the builder. However I still think a separate height map generator is the way to go.

Part 2 continued. If I was doing this, I would code my terrain generator in a direct x app and have a preview window where the low vertices were blue and the high white (in between green ie. Sea, grass, snow). So I could preview it without having to import the heightmap into the unreal editor.

Last edited by ttl; 8th Apr 2004 at 12:59 AM. Reason: updated part 2
ttl is offline   Reply With Quote
Old 9th Apr 2004, 02:51 PM   #3
debeoulve
Banned
 
Join Date: Apr. 7th, 2004
Location: The Netherlands
Posts: 7
Hi,

Quote:
Originally Posted by ttl
1. You could code a program to create a 16bit greyscale bitmap (G16) from your text file, which could in turn be used as a heightmap in a terraininfo actor.
OK, that could be done easily. I'm using Matlab (a scientific scripting language) and it supports this 'natively'.

Quote:
Originally Posted by ttl
2. Well you cant get much quicker then just selecting a new heightmap in your existing level. But if you wanted to, you could code your own program, but this time have it so it creates an unreal map in .t3d format which is rather basic.
A, directly creating those .t3d files sounds what I would like to do, since i'd like to make something that people who barely know how Windows works can still use. So what would be a good source for looking into this? Any doc about the technical basics of the unreal engine and the file formats?

Quote:
Originally Posted by ttl
NB: If you are not worried about performance you could make your on brush builder and build your terrain out of it instead, then you could just format text file so it can be loaded as a config file for the builder. However I still think a separate height map generator is the way to go.
I'm not really worried about performance at all, so this seems interesting as well. Do you have any idea where I should start? I guess I'd like to know:
- what does the .t3d file specification look like?
- how do 'brushes' work and how can they be built?
- what's a good tutorial to learn making easy levels, without any combat/game related stuff?
- why is there no help document for the runutime yet? :-)

Any help with any of these would be highly appreciated

Jos
debeoulve is offline   Reply With Quote
Old 10th Apr 2004, 12:31 PM   #4
ttl
Registered User
 
Join Date: Oct. 22nd, 2003
Posts: 51
Quote:
Originally Posted by debeoulve
I'm using Matlab
Which just happens is the best mathematical program around =]


Quote:
Originally Posted by debeoulve
A, directly creating those .t3d files sounds what I would like to do, since i'd like to make something that people who barely know how Windows works can still use.
As Vito said, just extract an existing map. Then you can either write your own exporter from scratch or go the way Vito suggested, which is just to edit the heightmap part of it (so you could say, save all info up until where the heightmap name is meant to go in one text file and the rest in another then simply put them together with the name of the heightmap inbetween).

Quote:
Originally Posted by debeoulve
- what does the .t3d file specification look like?
I dont think there is one, but it is so simple that anyone with basic knowledge of the unreal engine should easily be able to work it out.

Quote:
Originally Posted by debeoulve
- how do 'brushes' work and how can they be built?
Check out BrushBuilder.uc, CubeBuilder.uc and TerrainBuilder.uc in Editor\Classes
NB: This is the "difficult" way of doing things, so dont say I didnt warn you :P

Quote:
Originally Posted by debeoulve
- what's a good tutorial to learn making easy levels, without any combat/game related stuff?
You can google for this one

Quote:
Originally Posted by debeoulve
- why is there no help document for the runutime yet?
See Vito's post. Also note that http://wiki.beyondunreal.com CAN be useful, though it tends to be less "exact" and more ut2k3 specific.


Note: you can also do some fancy stuff using #execs if you dont want to go the .t3d way
ttl is offline   Reply With Quote
Old 14th Apr 2004, 11:01 AM   #5
ttl
Registered User
 
Join Date: Oct. 22nd, 2003
Posts: 51
I just thought I'd mention you can do some pretty cool stuff just using the editor console. I made a few .txt file you can "exec" in the console. I have attached them along with some example heightmaps and a t3d file that the .txt files use. If you wanted to you could code you're external program to to find the console command window in unrealed and send an exec command that loads a .txt file to import your newly created heightmap.

Anyway the example files and a readme is included in the attached zip file.

To give you a general idea of what this does before you download it, here's a cut out from the readme:

Quote:
batchimport.txt:
opens EM_Runtime.urt imports ..\batchterrain\heightmaps\1.bmp, rebuilds the map with the new terrain and saves the map as TerrainInMap.urt
It then imports ..\batchterrain\heightmaps\2.bmp as the heightmap but this time to the MyPackage_T.utx, it then rebuilds the map and saves the MyPackage_T.utx package in your texture directory and saves the map as TerrainInSeperatePacakge.urt.

How to use: type "exec ..\batchterrain\batchimport.txt" in the editor console.


t3dimport.txt:
imports ..\batchterrain\t3d\example.t3d and ..\batchterrain\heightmaps\3.bmp as the heightmap, then rebuils and saves the map as TerrainFromT3d.urt

How to use: type "Exec ..\batchterrain\t3dimport.txt" in the editor console.

quickimport.txt:
imports ..\batchterrain\hieghtmaps\3.bmp into the current map and sets it as the current heightmap.

How to use: First load the map of your choice (it must have terrain) and type "exec ..\batchterrain\quickimport.txt"

Edit:
The original file was removed, if you want the updated version check my next post.

Last edited by ttl; 15th Apr 2004 at 12:21 AM. Reason: removed the file, check my next post for an updated version
ttl is offline   Reply With Quote
Old 14th Apr 2004, 11:06 AM   #6
debeoulve
Banned
 
Join Date: Apr. 7th, 2004
Location: The Netherlands
Posts: 7
Quote:
Originally Posted by ttl
[...] I have attached them along with some example heightmaps and a t3d file that the .txt files use. [...]
Wow, thanks ttl!
I'm at work at the moment (5pm local time), but i'll definitely look into it later.

Jos
debeoulve is offline   Reply With Quote
Old 14th Apr 2004, 03:52 PM   #7
debeoulve
Banned
 
Join Date: Apr. 7th, 2004
Location: The Netherlands
Posts: 7
Thumbs up

These scripts are really useful, and knowing that thay can be made maybe even more so. Playing around with them I find that you have to be patient with the editor though - it tends to crash often and hard...

New questions have risen from your excellent help - importing new terrains (the three bmp files) into the runtime map seems to give some unwanting effects:
- the terrain is not visible generally, just the other stuff (the bridge, waterfall, river, wheatfields etc)
- the playerstart is usually not in a valid place and has to be placed manually, but that could be related to the first issue
- although the terrain isn't visible, trees etc are floating in mid-air, so it seems like the terrain is there but is not rendered. However, walking into the void causes sinking down

any general idea what could be the problem? Or is it just too much to ask of the editor to add a terrain that doesn't match the rest of the level and compute what's supposed to change?

Jos
debeoulve is offline   Reply With Quote
Old 8th Apr 2004, 02:20 AM   #8
Vito
Registered User
 
Join Date: Mar. 18th, 2002
Posts: 143
Yeah, your best bet is to convert your text data (DEMs?) into a 16-bit greyscale BMP or TGA heightmap, and import that.

You should be able to write a commandlet to generate the map if all you have is terrain and BSP in that regard.
Vito is offline   Reply With Quote
Old 10th Apr 2004, 05:33 AM   #9
Vito
Registered User
 
Join Date: Mar. 18th, 2002
Posts: 143
Make a normal map in UnrealEd that's set up the way you want it. Make a fake terrain using the built-in terrain tools that's the size you want, but instead of storing the terrain in MyLevel, store it in its own package. Save the map. Then export that map to T3D.

When you want to create a new map, make a copy of your T3D file, and in a regular text editor, change the reference to the terrain texture and package name. Make a new package and texture with that new name, using the new terrain you've made. Load up that package in the editor, and then import the T3D, and do a full rebuild. Presto change-o, you have a new map with nearly no work.

And there is a help file for the Runtime. It's called UDN. Start at http://udn.epicgames.com/Content/WebHome and work your way from the top of the table of contents on the left to the bottom.
Vito is offline   Reply With Quote
Old 14th Apr 2004, 11:12 AM   #10
ttl
Registered User
 
Join Date: Oct. 22nd, 2003
Posts: 51
np
ttl is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:57 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer