[RFD]cell based, freeform or something in between ?

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

Moderator: Transport Empire Moderators

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

Post by Zuu »

Minutes for the FRD special meeting of Mars 12, 2005 wrote:

Code: Select all

        * VOTE: freedom or cell-based?
              A) True freedom: track endpoints can be placed anywhere
              B) Cell based: a limited set of track pieces are available, which can be placed on the cells of the map.
              C) "In between", as freedom, but the endpoints snap to a grid that is smaller or equal to the grid of the map.

                RESULT: a: 0 b: 0 c: 5
                
        * A long discussion about where to snap points will be located followed.
        * But we couldn't came to a decision, so we decided to postpone the decision until the coding phase.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Parkey
Director
Director
Posts: 541
Joined: 17 Nov 2006 12:45
Location: Oxford, United Kingdom

Post by Parkey »

From what I can see you're both saying the same thing?

If you have five snappoints they defines the road/railway by the borders of the area it uses.

The method with four snappoints to each edge defines the road/railway by points on its centreline. By that I mean the centreline of the path a vehicle using it would follow.

Both give the option for 4 parallel lanes/lines.

I think vehicle path centrelines would be easier to calculate.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Post by Zuu »

Note: "tracks" is not limited to train tracks, but can be either a road lane or a train track.


There have gone a long time since this discussion. I now want to change some in my proposal so that it will not be that "ugly" as some of you have mentioned.

The change is that snap-points are placed in the center of the sub-cells, instead of the edges. This means that the pattern will look better. As you see in the attachment.

I still think that the center of a track should be fited to a snap-point. This is because a track can be simplified to a line without a width which simply start at point A and end at point B. 4 snap-points for a single line would just make things complicated I think. I still don't think Steves proposal will work well with tracks that don't follow the two base axises. Please prove me worng.


This proposal does not have a snap-point in the center of the tile to handle buildings that cover the whole tile. I don't think that should not be allowed, I just did not include buildings in the proposal. It might be a good idea to add a point in the center aimed buildings, but maybe it might be better to handle buildings seperatated from tracks.


EDIT: I guess most people are tired of this discussions, and I'm fine with Steves proposal in that case, though I would not like to implement it since I cant see haw how you'll handle tracks of any other angle than the angles along the base axis with that proposal. (As far as I'v understood it uses four snappoints, one for each corner of a rectangular track piece. )
Attachments
I've tried to make the attachment as accesible to color blind by describeing things in the attachment with arrows and text. Please tell me if that is not a good idea.
I've tried to make the attachment as accesible to color blind by describeing things in the attachment with arrows and text. Please tell me if that is not a good idea.
buildpoints.png (26.95 KiB) Viewed 25164 times
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 »

Sorry to be a pain but could you provide more pictures of what you are trying to illustrate. Including what the tracks may look like when they are built, etc.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Post by Zuu »

aarona wrote:Sorry to be a pain but could you provide more pictures of what you are trying to illustrate. Including what the tracks may look like when they are built, etc.
No, no.. it is not a problem. It is better you ask and understand than if we choose my proposal and end up in a situation where we don't know what it actually mean.

The actual example
I've drawn a track in grey-blue. I guess the picture speeks for itself, if not ask!

The corners of the track are brighter to show that they concist of two pices than are joined togeather.

The zip-file
The Zip-file contains "snappoints_lange.xcf" and "snappoints_large_tracks.xcf". The first one is a base for future examples and the seccond is the source for the attached png-image.
Attachments
snappoints_large_tracks.png
(114.59 KiB) Downloaded 258 times
snappoints_large.zip
(100.67 KiB) Downloaded 524 times
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 »

I don't really have any problems with that.

I've modified an image from Google Maps, creating a grid with 32m spacings and comparing them to dual carriage ways (yellow, and with bus stop for good measure) and the train line (blue) and some local features (bridges, highway + freight rail line running perpendicular).
Attachments
Google Image
Google Image
google.png (580.45 KiB) Viewed 6442 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Post by Zuu »

Is there any objections against my proposal or anything that is unclear?

It is not that I want to force it on you, but I think it is important to reach a decission soon so we can move on. Which proposal is not important. However as there are things that is unclear with Steves proposal I think those have to be cleared out before that proposal is elected.

I think the proposal should tell how the snappoints are layed out on the grid, but also what parts of the tracks that are snaped to the snap-points on the grid. At least to me it is still unclear how Steves proposal handle this.


Again, the importance is not who made the proposal but that we reach a clear decsision that hopfully is a good decission for the game too.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Post by Zuu »

I appologize for dubble post, but I would like to answer parts of my own questions in my previous post which I find much more readable to do in a seperate post. I hope that is okay. PM me if not.

---

I realized that I had not fully clarify how diagonal tracks (where 45 degres is seen as a special case of diagonal tracks) would be threated.

The idea I have is that tracks got a certain width, for paralell tracks going in the dirrection of 0, 90, 180 and 270 degrees[1] tracks can be placed next to each other without some spacing between. This should not be because of a hack, but because the width is choosen so that this is possible. When choosing another dirrection/angle than 0, 90, 180 or 270 degrees the engine will just check that the tracks don't collide. This is illustrated in the attachment.

I understand that the concept of track width is a bit off-topic though I find it important for an answer of how so called diagonal tracks will be handeled.


[1] Degrees are on the unit circle mesured from the possitive x-axis. Asuming y is pointing upwards so that 90 degrees is pointing forward along the positive y-axis.

aarona:
Your google-map looks good. By simple messurement with a pen on the screen it seams that the highway/motorway of a total of four lanes takes one tile and the two rail tracks takes a half tile width and that four rail tracks including spacing would fit on one tile.

I guess that was what you wanted to show?
Attachments
If you want the .xcf, PM, I'm to lazy to rename/zip it for now.
If you want the .xcf, PM, I'm to lazy to rename/zip it for now.
snappoints_large_diagonal_tracks.png (78.58 KiB) Viewed 25109 times
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 »

I can see the application of this to roads because they can have sharp turns however trains aren't as forgiving and if we go with a Bezier curve then the collision between tracks becomes a bit more tricky.

I propose a "Build Mask" where each sub-tile contains 1's and 0's in a 16-bit unsigned integer per tile. If there is something there, then the sub-tile gets a 1 and if there is nothing there then it gets a zero. It's exactly 2 bytes in length because by your diagram there are 16 sub-tiles.

Obviously there might be trouble with double tracks or "freeway" like roads so then we might have an option to build double tracks (a la RRT but not so crappy).

Can you see another solution which enables curves, which won't be so easy to calculate as now we have to solve two parametric curves with widths (I dunno, perhaps its a trivial task...)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Post by Zuu »

With curves with fixed radius I think calculations will be simplificated A LOT since you will be able to use sin, cos, tan. Though I should add that I don't know how you would implement Beizer curves.

But we should keep in mind that this calculation is something that at max would be done once per cycle. But only in build track mode and when the pointing device have been moved. So therefore we have more cycles available than you have for a single train which you might have hundreds of. (Yes it might bee that all trains eat all available CPU and we got nothnig left for building.)

One way that pops into my mind is if for benzier it is possible to step along the curve going ~1/10 tile / step. At each step we need to know the 3d coordinate and the normal and tangent. Then we could make calculate the line going from the left side of the track to the right side. With some more linear algebra calculate the outer points of the tracks so that the distance between these two are the width and that they are the same distance from center.

The outer points are checked against the subcells and set the bit mask for the subcell they happen to be in.

Now we are in 3D-space so we also need to move up along the normal and mark the heigth, exactly how depending on how the mapstructure is made.


Perhaps this can be optimized A LOT, both in the way it is done and also by selecting a good step-length. A such optiziton might be to use a larger step-size and ceck the flag for whole tiles and only go into deitail when there are other objects close.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os »

I am just curious and have some questions:


How will trains/road vehicles handle these bezier constructs?

I remember to read that a curves get smoothed, but say I have a train running (like TTD) and start to change a junction with a connection to the next bezier part with a train on it. The smoothing algorithm will change the style of my rail part (the one with the train) and then it derails my train :?:

About Trainz, if I remember well only in the editor you can change rails and don't have trains running at this time. Thats a huge difference comparing you have actually vehicles that use the structures you are editing.

Graphical, how will these kind of rails look like?
User avatar
aarona
Traffic Manager
Traffic Manager
Posts: 221
Joined: 26 May 2006 15:54
Location: Perth, Australia
Contact:

Post by aarona »

eis_os: Obviously tracks cannot be changed once they are built! They have to be demolished first, or extended from the previous end point.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Post by Zuu »

We will have a planing mode which will operate on a copy of s the map. Perhaps the user selects which area to work on so that only that part of the map is dublicated.

Inside of planing mode I guess existing curves can be modified and when you apply the plan the game blocks the entrances and wait untill the area is cleared and then reconstruct the rail. I can see many isusses with this that have to bee solved such as dead locks that means that the area never gets cleared. But some sunch thing need to be done as there will be a planing mode that build things when you're done planing.

But lets try to keep somewhat on topic.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

aarona wrote:eis_os: Obviously tracks cannot be changed once they are built! They have to be demolished first, or extended from the previous end point.
I don't agree with that, being able to drag control points is very usefull when you want to make quick addaptions to your tracks, imagine that you want to move a control point by one tile... Ofcourse it should only be possible when in build mode.
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
User avatar
aarona
Traffic Manager
Traffic Manager
Posts: 221
Joined: 26 May 2006 15:54
Location: Perth, Australia
Contact:

Post by aarona »

XeryusTC wrote:Ofcourse it should only be possible when in build mode.
That's what I was saying. Or at least...trying to.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Post by Zuu »

I have not recived any objections against the 4x4 grid of snappoints, all located in the center of their sub-cell, that I proposed. I have not recived any votes for either of the two proposals. I take the absense of objections/votes an okay. Unless there come verry soon I say that the final dicission is to go with the 4x4 grid of snap-points that I proposed. (I hope I don't clamp on anyone, just want to get a decission fast so we can move on.)

I'll ask Hyronymus to unlock the other thread about map coordinates. Perhaps we way create a new thread about build mode or so if there are things that is unclear and need to get decided.
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 »

I'm for it.
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

I think that it could work, it gives the people some freedom, but not too much. Just like in the average dictatorship :twisted:.
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

XeryusTC wrote:I think that it could work, it gives the people some freedom, but not too much. Just like in the average dictatorship :twisted:.
LOL, and that remark comes 24H after the death of Pinochet. Anyhow, I'm all for it too Zuu.
User avatar
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Post by Purno »

This is probably a stupid question, and I probably missed something, but I'm gonna ask it anyways 'cause I don't get it;

Why are we dividing tiles into smaller 'snappoints', instead of just using smaller tiles?
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.
Image Image
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."
Post Reply

Return to “Transport Empire Development”

Who is online

Users browsing this forum: No registered users and 5 guests