Terrain Prototype

Archived discussions related to Transport Empire. Read-only access only.

Moderator: Transport Empire Moderators

User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Terrain Prototype

Post by uzurpator »

Kazam! For your viewin pleasure - terrain prototype for TE.

The terrain is created using pseudo-random noise pattern (beautiful thing - 1 number defines _whole_ terrain - no matter how big it is) then drawn using 3-pass bilinear filtered gouraud shading. It's a tad slow - so I'll try to make it faster. But nonetheless - have fun watching.
Attachments
terrain5.jpg
terrain5.jpg (123.37 KiB) Viewed 7360 times
tpsources.rar
(82.21 KiB) Downloaded 224 times
tp.rar
(188.48 KiB) Downloaded 247 times
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
Hellfire
Transport Empire Developer
Transport Empire Developer
Posts: 699
Joined: 03 Feb 2003 09:30
Location: Back at the office

Post by Hellfire »

Runs nice and smooth on my Gentoo box.

I did have to change some source files though... (change <gl\gl.h> into <GL/gl.h> and <SDL/blah> into <blah>)

But it compiles now, without any significant errors. Just some "enum" warnings.
Feel free to contact me over Email! My current timezone: Europe/Amsterdam (GMT+1 or GMT+2)

Code: Select all

+------------Oo.------+
| Transport Empire -> |
+---------------------+
[ General TE Discussion ] [ TE Development ] [ TE Coding ]
Under construction...
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Post by uzurpator »

So - the newest changes ^^
Attachments
terrain6.jpg
terrain6.jpg (163.32 KiB) Viewed 7296 times
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
User avatar
Steve
Tycoon
Tycoon
Posts: 2085
Joined: 10 Jan 2004 20:19
Location: London
Contact:

Post by Steve »

Looks a bit bumpy. Could you imagine getting a train to run over that? I think that style only works for mountains, you'll need a flatter bit too on a map.
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Post by uzurpator »

steve - au contrare - there are a few parameters that make the terrain flat or allow increasing amount of water. Take a look.
Attachments
terrain9.jpg
terrain9.jpg (168.71 KiB) Viewed 7276 times
terrain8.jpg
terrain8.jpg (139.7 KiB) Viewed 7277 times
terrain7.jpg
terrain7.jpg (182.61 KiB) Viewed 7277 times
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
User avatar
jfs
Tycoon
Tycoon
Posts: 1763
Joined: 08 Jan 2003 23:09
Location: Denmark

Post by jfs »

Urzupator - no, what I think Steve means, is that even though the terrain is rough and mountaneous, it still needs plateaus and somewhat flat plains.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

Looks very nice, uz. Can I be nasty and ask if rivers are an option for your engine?
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Post by uzurpator »

jfs - entirely possible. I'm planning on adding a low-pass filter that will make the valleys/mountaintops flatter/smoother. Also - in a postprocessing part I can add pretty much any filter - ferinstance one that will make half of the map flat and the other half hilly. Take a look below :)

Frankly - send me your photo and I'll make a map out of it :)

Hyro - rivers would require erosion algorithm. They take TONS of computer resources. While possible - I don't think users want to wait a few days to get any effects.
Attachments
terrain10.jpg
terrain10.jpg (186.86 KiB) Viewed 7268 times
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
User avatar
jfs
Tycoon
Tycoon
Posts: 1763
Joined: 08 Jan 2003 23:09
Location: Denmark

Post by jfs »

While it may not be entirely realistic, how about just "faking" an erosion algorithm? Like, starting by selecting what path the river will take (of course with some respect to the general shape of the terrain) and then just cut out a riverbed. As long as it looks somewhat realistic, anything will do.
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Post by uzurpator »

jfs - not to my knowledge. We'll have to settle for no rivers on random maps.
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

I diagree with that, besides the FRD clearly says else. How does a game like SimCity create rivers (water in general) in custom maps?
User avatar
PJayTycy
Route Supervisor
Route Supervisor
Posts: 429
Joined: 09 Mar 2004 20:30

Post by PJayTycy »

Isn't it possible to just choose some random points on the map which would be a "spring" and then calculate its way down? We don't really need erosion to have rivers.
User avatar
Arathorn
Tycoon
Tycoon
Posts: 6937
Joined: 30 Nov 2002 17:10

Post by Arathorn »

I don't think we need erosion either... games don't take that long...
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Post by Korenn »

uzurpator wrote:jfs - not to my knowledge. We'll have to settle for no rivers on random maps.
I wrote a river generator for my ottd spinoff that combined random segments and turns and then adapted the land around it. it doesn't make for a fully realistic river but makes very nice fjords etc.
User avatar
charlieg
Transport Coordinator
Transport Coordinator
Posts: 323
Joined: 08 Oct 2003 14:07
Contact:

Post by charlieg »

Arathorn wrote:I don't think we need erosion either... games don't take that long...
I think you're misunderstanding the purpose of an erosion engine; it's not to simulate erosion in-game, but for generating mroe realistic maps by simulating the way nature shapes land over millenia.

The shots look great. However, it would be even better if the terrain generator could combine the different types of terrain into a more varied landscape - i.e. a map containing flat land, hills, mountains, lakes, rivers, and shorelines in different combinations. That would give TE a massive edge over things like OpenTTD and Simutrans whose terrain generation is limited to one type of land at a time.
Open source tycoon games
--
Free Gamer - open source and Free Software games
FreeGameDev forums - open source game development community
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Post by uzurpator »

Another revision - this one a bit more interactive :)

Space - generates a terrain
1 - hold it to increase amount of water
2 - hold it to decrease amount of water
3 - hold to make more mountains
4 - hold to make terrain flatter

g - display grid
t - display triangles in grid view

ESC exit program
Attachments
tp source.rar
(84.42 KiB) Downloaded 227 times
tp.rar
(189.71 KiB) Downloaded 220 times
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
User avatar
Killer 11
Tycoon
Tycoon
Posts: 2463
Joined: 06 Jan 2004 18:38
Location: Kaunas, Lithuania
Contact:

Post by Killer 11 »

This looks cool!
It just needs texture now :wink:
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Post by Zuu »

Looks good, althrought the keybord commands still don't want to work in Linux using Wine nor Portable.NET. Plus that the mouse pointer is forced to the center of the window.

The main reason that I havn't compiled a Linux version is that I don't know how to link it. I have a year or so of experince of SDL (without GL), but almost no with GL. So I cant tell on straight arm whick arguments to send to the compiler.

Code: Select all

pkg-config --list-all | grep gl | less
pkg-config --list-all | grep GL | less
Does not list gl or GL.


By the way, I couldn't find any errors in the code that would be the reson for the non working keybord nor the problems with the mouse pointer.


About the demo/proto: Loking good, do you know the propotitions on how much resources that are used for the graphics and the algorithm?
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Hellfire
Transport Empire Developer
Transport Empire Developer
Posts: 699
Joined: 03 Feb 2003 09:30
Location: Back at the office

Post by Hellfire »

Zuu, here's a patch. I made a new Makefile and changed two of the source files.

You can apply the patch by running:

Code: Select all

$ patch -Np1 < terrain.patch
With this Makefile, the demo runs like a charm on my Gentoo machine.
Attachments
terrain.patch
(1.4 KiB) Downloaded 237 times
Feel free to contact me over Email! My current timezone: Europe/Amsterdam (GMT+1 or GMT+2)

Code: Select all

+------------Oo.------+
| Transport Empire -> |
+---------------------+
[ General TE Discussion ] [ TE Development ] [ TE Coding ]
Under construction...
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Post by Zuu »

Thanks, Hellfire. Now it compiles fine on my Gentoo box too.

Now the keybord works, and the mouse pointer isn't forced into the middle of the window, as it were a black whole.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Locked

Return to “Transport Empire Development Archive”

Who is online

Users browsing this forum: No registered users and 19 guests