Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Apr 23, 2018 5:08 pm

All times are UTC




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
 Post subject: [DD] Map properties
PostPosted: Mon Nov 20, 2006 8:56 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 13162
Location: The Netherlands
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?

_________________
Image
Dutch Trainset for OpenTTD | Dutch Trainset Topic | Combined Roadset v0.10


Top
   
 Post subject: Re: [DD] Map properties
PostPosted: Mon Nov 20, 2006 6:47 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4535
Location: /home/sweden
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 7661 times ]

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Last edited by Zuu on Mon Nov 20, 2006 11:09 pm, edited 1 time in total.
Top
   
 Post subject:
PostPosted: Tue Nov 21, 2006 6:14 am 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Fri May 26, 2006 3:54 pm
Posts: 221
Location: Perth, Australia
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.


Top
   
 Post subject: Re: [DD] Map properties
PostPosted: Tue Nov 21, 2006 5:12 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun Aug 08, 2004 8:21 am
Posts: 67
Location: Germany
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 |°/


Top
   
 Post subject: Re: [DD] Map properties
PostPosted: Tue Nov 21, 2006 5:22 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Fri May 26, 2006 3:54 pm
Posts: 221
Location: Perth, Australia
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.


Top
   
 Post subject:
PostPosted: Tue Nov 21, 2006 7:05 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun Aug 08, 2004 8:21 am
Posts: 67
Location: Germany
Yeah riiight. (smart ass...) :wink: :) (no offence)

_________________
\°| Greetz, TossIB |°/


Top
   
 Post subject:
PostPosted: Tue Nov 21, 2006 7:37 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Fri May 26, 2006 3:54 pm
Posts: 221
Location: Perth, Australia
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:
File comment: Example
ref.PNG
ref.PNG [ 3.15 KiB | Viewed 7607 times ]
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.