[DD] Map properties

Development discussion about Transport Empire. Other discussion to General forum please.

Moderator: Transport Empire Moderators

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

[DD] Map properties

Post by Hyronymus » 20 Nov 2006 08:56

Map properties

1) The map is build up from rectangular tiles and the tiles are subdivided along the perimeter 18 times (thus making 5 per side) to define snap points for laying tracks
versus
2) tile edge is 16 metres long and is composed of four triangular areas (used for placement of some objects).
Terrain height is stored in 0.1m increments; tile vertices cannot differ in height more then 10 meters; terraforming tools will not allow terraforming pillars of rock; tiles are joint, i.e. 4 tiles can share 1 vertex; it is impossible to create a cliff by using tile edges.
3) Below a certain height, tiles are under water
versus
4) up to a height of 32 m all terrain is under water by default; if a part of the map is connected to any other body of water it will be flooded by water.

Above a certain height tiles are mountains and inherit all relevant characteristics
Terraforming happens automatically while laying track or constructing buildings; players can also terraform the map manually by using a set of designated tools
Terraforming costs money; some landscape features like rivers, hard bedrock or shoreline cannot be modified but are generated at the start of a new game
Unknown: maybe the game should store origin heights of all vertices and base terraforming costs on how much deviation from the origin height occurred; this way terraforming would be much more limited, forcing players to manage hills or mountains rather then levelling them (as in TTD/LOMO)
Unknown: laying tracks will automatically terraform to a slope chosen by the player (0%, 0.5%, 1% etc)
Unknown: the game will randomly modify certain vertices due to erosion, causing the terrain to change


This is a long text and I suggest we divide it into multiple questions that we'll answer consecutively.

Question 1a: what do the four triangular areas suggested in 2) look and work like?
Question 1b: do the snap points for laying track suggested in 1) allow Bezier curves/b-splines?

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [DD] Map properties

Post by Zuu » 20 Nov 2006 18:47

Hyronymus wrote:Question 1a: what do the four triangular areas suggested in 2) look and work like?
I beleive that it would look like the blue (and black) parts of the figure in my attachment. The second point, how will it work? I guess the borders marked with red are of interest. But also objects with a (smaller) area (as oposed to things that are fit to a border) could use this framework.
Hyronymus wrote:Question 1b: do the snap points for laying track suggested in 1) allow Bezier curves/b-splines?
I am not very into Bezier curves and such. However if I am not wrong Bezier curves have some kind of snap-points for the end and begining of the curve. Those points could be fixed to be snaped to the 5*5 snap-points of a tile.

Also I think the other parameters of Bezier curves are tangents-like stuff that basicly have an angle and a length, and does therefore not need to be stored as points with an X and Y coordinate on the snap-point field.


Please someone who knows more about Bezier curves correct my false assumptions if there are any.


Edit: Added attachment too :)
Attachments
te_square_4_parts.png
te_square_4_parts.png (10.42 KiB) Viewed 8650 times
Last edited by Zuu on 20 Nov 2006 23:09, edited 1 time in total.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

User avatar
aarona
Traffic Manager
Traffic Manager
Posts: 221
Joined: 26 May 2006 15:54
Location: Perth, Australia
Contact:

Post by aarona » 21 Nov 2006 06:14

Regarding Bezier curves...

The simplest thing to do would to have the two fixed points be the ones which are snapped to the grid. The tangents would then be the direction of the next (or previous) tiles of path. The problem with this is, if someone goes a bit crazy and decides to do curve after curve after curve, each one will be dependent on the last until you finally choose a straight bit.

Oh...I suppose that means (in the GUI) we need to be able to chose between "straight", "curved" bits of path.

User avatar
TossIB
Engineer
Engineer
Posts: 67
Joined: 08 Aug 2004 08:21
Location: Germany

Re: [DD] Map properties

Post by TossIB » 21 Nov 2006 17:12

Zuu wrote:Please someone who knows more about Bezier curves correct my false assumptions if there are any.
OK. Bezièr curves are defined by four points. Start, CP1, CP2, End.
The line trough Start and CP1 is the tangent of the curve in Start, the line trough CP2 and End is the tangent of the curve in End. But assuming thar only the tangent is needed is wrong unfortunately, since the distance between Start and CP1 (End and CP2) have some effect on the curve. Basically, the farer the wider, the nearer the narrower.
\°| Greetz, TossIB |°/

User avatar
aarona
Traffic Manager
Traffic Manager
Posts: 221
Joined: 26 May 2006 15:54
Location: Perth, Australia
Contact:

Re: [DD] Map properties

Post by aarona » 21 Nov 2006 17:22

TossIB wrote:OK. Bezièr curves are defined by four points. Start, CP1, CP2, End.
FFS use Wikipedia! You will see why what you are saying is not exactly true. You are describing a CUBIC Bezier curve. There is also a linear Bezier curve, which surprise surpise, is just a line from Start to End...

n control points define an n + 1 order Bezier curve.

User avatar
TossIB
Engineer
Engineer
Posts: 67
Joined: 08 Aug 2004 08:21
Location: Germany

Post by TossIB » 21 Nov 2006 19:05

Yeah riiight. (smart ass...) :wink: :) (no offence)
\°| Greetz, TossIB |°/

User avatar
aarona
Traffic Manager
Traffic Manager
Posts: 221
Joined: 26 May 2006 15:54
Location: Perth, Australia
Contact:

Post by aarona » 21 Nov 2006 19:37

TossIB wrote:Yeah riiight. (smart ass...) :wink: :) (no offence)
Wikipedia...making people smart asses since 2001!

Question 1.
As Zuu said (the green dividers in my pic)

Question 2.
Yes. In the case I present the purple lines represent the original track. The brown show the worse case scenario, an abrubt 90 degree turn. (It also illustrates the tangents of the original straight tracks) The yellow dot is the reference point R1, which defines the control point in the bezier curve (of quadratic order).
The blue line is a straight line, and the dark greenish looking line thing is my attempt as what such bezier curve may look like.

(Apologies to those males out there who are colour blind)
Attachments
ref.PNG
Example
ref.PNG (3.15 KiB) Viewed 8596 times

Post Reply

Return to “Transport Empire Development”

Who is online

Users browsing this forum: No registered users and 8 guests