[RFD] Triangular or rectangular tiles

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

Moderator: Transport Empire Moderators

User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

[RFD] Triangular or rectangular tiles

Post by Hyronymus »

I haven't got expertise on this and I know it has been discussed before. In the FRD however there's no conclusion yet. We surely need to reach one though. From what I've read by others sofar triangular squares seems to offer the most. Correct me if I'm wrong.
User avatar
Arathorn
Tycoon
Tycoon
Posts: 6937
Joined: 30 Nov 2002 17:10

Post by Arathorn »

I have no expertise in this either, but I believe to remember from the discussion done about it ages ago that triangles give us more landscape forming ability, but are harder to code, is that right?
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

That's in my memory too. Can anyone with expertise comment perhaps?
Hellfire
Transport Empire Developer
Transport Empire Developer
Posts: 699
Joined: 03 Feb 2003 09:30
Location: Back at the office

Post by Hellfire »

*cough*
*cough*

Whew... That's a nasty cold coming...

Oooh.. And there's a proof of concept here.
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
Steve
Tycoon
Tycoon
Posts: 2085
Joined: 10 Jan 2004 20:19
Location: London
Contact:

Post by Steve »

I'm still wondering if we should restrict ourselves to a grid so much. If tracks are going to be 360 degree, i'd hope roads would be too, which means buildings would need to be. Would make everything look nicer.. but then again, i won't be the one programming it :)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Post by Zuu »

Eaven trought we might hide the cells for users like Steve, :) we still have to use them internally. So basicly with 360 degrees of freedome for tracks, roads, buildings etc, you can place stuff anywere on the cells, and with grafix that don't show them Steve won't notice them. But when adding some restrictions to placement of buildings and tracks I will be plesent too.

Steve, you might want to give an example on a game that don't use cells internally. :D I am sure RRT use some sort of cells, but does not visuualy display them.

Rectangels or triangles? As user I don't really care. As programmer i don't realy care either. But the if rectangles are easier why not use them?
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Steve
Tycoon
Tycoon
Posts: 2085
Joined: 10 Jan 2004 20:19
Location: London
Contact:

Post by Steve »

Well, tiles suggests to me something big that'd you put an entire building on. The smallest units should be in a rectange pattern as that's the easiest to work with and advantages of triangles would be negible.
User avatar
PJayTycy
Route Supervisor
Route Supervisor
Posts: 429
Joined: 09 Mar 2004 20:30

Post by PJayTycy »

I often tried to find a track system aligned to triangles myself, and never found something I liked. I will certainly have a closer look to uzurpator's sytsem.

The main problem I always had, was that a 90° turn for example, always looked different, depending on where exactly you started it (triangle top or middle of a side).

So, I am more a proponent of a square cell aproach for the simplicity, but if triangles really have a benefit, I'm all for it.



As a side note, especially to Steve, just to show you even Railroad Tycoon 3 uses a grid. It even uses 3 different grids. See the attached picture:
  • The red (big) cells are economical cells. You transport cargo between those cells. Station catchment area is also (based on size of the station) either a 2*2, 3*3 or 5*5 region of such big cells.
  • The smaller blue cells are the ones used for the landscape. Each of the corners has a certain height, the middle of the cell uses the average of the 4 heights, then 4 triangles are drawn with the top at the center of the cell.
  • The smallest units, used for everything you want to place on the ground (tracks, buildings,...) are not shown. From empirical testing, I can only guess 1 blue cell has 16*16 of these smaller units. A typical house uses 8*8 of them, a track section is about 8 units long and 5 units wide.
Attachments
Railroad tycoon 3 grids
Railroad tycoon 3 grids
Clipboard01.png (309.28 KiB) Viewed 9967 times
User avatar
Steve
Tycoon
Tycoon
Posts: 2085
Joined: 10 Jan 2004 20:19
Location: London
Contact:

Post by Steve »

That system sounds fine. Are the houses restricted to being aligned with the grid? Although that's not a major problem, as we can just make triangular houses on the grid and fill in gaps and make big pavements and such.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

Nice contributions, Pjaytycy and Hellfire. So triangular cells are favoured by the majority if I summarize properly?
User avatar
jfs
Tycoon
Tycoon
Posts: 1763
Joined: 08 Jan 2003 23:09
Location: Denmark

Post by jfs »

I'm not sure if having triangles would be better.
It does offer some more interesting track configurations, but it's different from what pretty much everyone else does. What I mean is that it might confuse too much.
Still, I think it's interesting enough to do it.

But it also brings another question, the shame of the map. With triangular tiles, really rectangular maps aren't possible (two of the edges would always be jagged), while triangular or hexagonal maps would be more "natural".
I'll make a new thread on this.
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Post by uzurpator »

Does it _really_ matter?

We can make a very fine rectangular grid. We can make gridless even.

I for one am for rectangular - but simply because they are the simplest to implement. I say - the first one to produce a working terrain proto will define what cells we will use.
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 »

uzurpator wrote:I say - the first one to produce a working terrain proto will define what cells we will use.
That's not really useful for writing a Design Document. I'm pretty sure we decided to let every decision be made before any code.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

Let's play the devil's advocate here, I think this is quite an important issue. With triangular tiles we can't get clear-cut map shapes which made me realize that all current games that simulate landscapes must use rectangular tiles (SimCity, RRT3, Locomotion). Uzurpator, you are a great supporter of rectangular track. Will we be able to have smooth hills that don't look the same everywhere as in TTD if we go rectangular?
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Post by uzurpator »

Hyro - what tiles do you think my terrain proto uses?
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 »

I think I've pointed to this before, one game I know that's using a triangle-based map is S2 (The Settlers 2.) It works quite well there, and even has a "round" world, though it's only for looks. Afaik. you can't actually "walk around the world".
The height of the landscape in S2 is stored per corner, and there are afaik. no limits on the max. difference between two adjecant corners. The edges are somewhat smoothed out, and the landscapes appear very nice.
Roads in S2 are built along the edges of the triangles, and buildings are built on corners. (Most buildings also "occupy" some of the adjecant corners, sometimes also those "two edges away".) Buildings require mostly flat land to be built, so if one tries to build them on very hilly land, the land is smoothed out. (That's the only way to modify the landscape during the game.)

I can try to find/make some screenshots if anyone are interested.
User avatar
Arathorn
Tycoon
Tycoon
Posts: 6937
Joined: 30 Nov 2002 17:10

Post by Arathorn »

Yes a screenshot would be nice.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

Oskar (eis_os) asked me to post these links to show the beauties of triangular terrain:

Open Source Settlers 2
User avatar
PJayTycy
Route Supervisor
Route Supervisor
Posts: 429
Joined: 09 Mar 2004 20:30

Post by PJayTycy »

Hyronymus wrote:Oskar (eis_os) asked me to post these links to show the beauties of triangular terrain:

Open Source Settlers 2

Fatal error: session_start(): Failed to initialize storage module: user (path: /home/groups/w/wi/widelands/htdocs/wiki/sessions) in /home/groups/w/wi/widelands/htdocs/wiki/tikilight_1.8.4/tiki-setup_base.php on line 178
Hellfire
Transport Empire Developer
Transport Empire Developer
Posts: 699
Joined: 03 Feb 2003 09:30
Location: Back at the office

Post by Hellfire »

Just click reload a few times. I managed to view the screenshots there.
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...
Locked

Return to “Transport Empire Development Archive”

Who is online

Users browsing this forum: No registered users and 11 guests