RP-PB track-laying style

Discuss a Transport Tycoon-like game being programmed by forum users.

Moderator: Transport Empire Moderators

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

RP-PB track-laying style

Post by TossIB »

Didn't want to hijack the other topic since this idea will go in another direction and shouldn't stop PJayTycy's idea evolving (see this as a fork).

I've come up with an idea on how to manage the placing of track in a way that is simple to use and produces accurate and realistic results without too much hassle (and the desired one also). I call it the RP-PB track-laying style:


PB - "parametric bending"

The radius of an curve segment will not be determined by how track is placed onto the ground, but defined by a parameter which is to be set by the player. In other words, there is a field / selection box somwhere in the GUI where the player can set the bending of the track he wishes to place.
  • Straight / Radius1 - 300 m / Radius2 - 305 m / Radius3 - 310 m / ...
This parameter should be directly accessible with the keyboard so that the player doesn't need the mouse to change it. The difference between two radiuses is the default spacing of tracks. (There may be trains which can't go through the smallest radius ...)


RP - "renewing previous"

The segment the player built beforhand isn't fixed for now and ever, but will be renewed by the placing of the new segment. This applies only to the length, not the direction.


How to place track the RP-PB way

New track
  1. Choose bending.
  2. Click once for the starting point.
  3. Pull to the ending point.
    Use keyboard to adjust the bending on the fly and whether a curve bends to the right or to the left.
  4. Click to place the track.
Add track
  1. Choose bending.
  2. Select an ending point.
  3. The new track is attached to your mouse and to the old track.
    New track and old track are connected by a smooth transition segment.
    Moving the mouse will have the following effect:
    - The length of the old track changes.
    - By that the position of the connecting point and the new track (which is attached to the mouse) change too.
    - The length of the new track changes also so that it is ending with the mouse pointer.
    Use keyboard to adjust the bending on the fly.
  4. Click to place the track.
Add junction
  1. Choose bending.
  2. Select the track segment to which the new one should be attached.
  3. Moving out of this point will determine to which direction the junction will split.
  4. The new track is attached to your mouse and to the old track.
    New track and old track are connected by a smooth transition segment.
    Moving the mouse will have the following effect:
    - The position of the adding point and the new track (which is attached to the mouse) change along the old track.
    - The length of the new track changes also so that it is ending with the mouse pointer.
    Use keyboard to adjust the bending on the fly.
  5. Click to place the track.
Adjust track
  1. Choose ending point.
  2. Adjust length and/or the bending.
  3. The connecting point is fix. You have to delete the track and add a new one to change that.
  4. Click to place the track.
Close track
  1. Connecting two ending points or tracks by the use of junctions. No perfect solution yet.
    - Non parallel straights are simply done with one curve.
    - Curve-curve may be done with a straight (always?).
    - Curve-straight may be done with a straigth and a curve in combination.
    - Parallel straights are a poblem. When is the the solution unambiguous?
Delete track
  1. Choose segments.
  2. Delete segments.
  3. Transition segments can't live on their own. If a track ends in a transition segment it is deleted right away.
Advanced editing options
  • Deconnect segments.
  • Connect segments (with moving and rotating).
  • Copy segments (library).
  • Paste, move, and rotate segments (library).
When adding new track there is only one possibility for every point on the map. But only if the starting point is not moving on a curve more than 180° or beeing pushed so far, a junction appears under it. To prevent these cases there is a limit in movin the starting point (180° and same segment + transition segments before and after) which can be overcome, when the mouse pointer is near enough so that it is clear what he wants the programm to do. Also in initial building it is not possible to build curves over 180° (uniqueness of the solution), but by changing it is no problem at all.

Phew that's all.
Sooooo, what do you guys think about it? Is everything clear?

[Change: Added advanced editing options]
Last edited by TossIB on 24 Nov 2006 12:24, edited 2 times in total.
\°| Greetz, TossIB |°/
User avatar
aarona
Traffic Manager
Traffic Manager
Posts: 221
Joined: 26 May 2006 15:54
Location: Perth, Australia
Contact:

Post by aarona »

I like the way Trainz handles building tracks. (Click from point to point, chose which bits you want straight, it automatically gets the best path, etc)

Why reinvent the wheel when there is already something out there which does the job?

Regardless I'm not 100% sure what you are talking about. This is generally a bad sign for something which is supposed to be "without too much hassle". Sorry...
User avatar
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Post by Purno »

Trainz system is one of the best GUIs I've seen, which allow almost any shape with a very simple system. I agree with aarona, tho I haven't found the mood to read the complete post of TossIB (I'm kinda ill ATM).
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."
User avatar
TossIB
Engineer
Engineer
Posts: 67
Joined: 08 Aug 2004 08:21
Location: Germany

Post by TossIB »

aarona wrote:Why reinvent the wheel when there is already something out there which does the job?
Well using the system of trainz won't reinvent the wheel, but I don't belive TE will be allowed to use the algorithms of Trainz, so it's surly about reprogramming the wheel. The work done by programmers is the same whether they copy Trainz or they implement own ideas. And if we choose to do it the Trainz way, we have to analyse the algorithm in detail to reproduce it. About as much work as "reinventing the wheel" I guess.
aarona wrote:Regardless I'm not 100% sure what you are talking about. This is generally a bad sign for something which is supposed to be "without too much hassle". Sorry...
Please specify what you didn't understand. I know that my explanations are generally hard to understand.

BTW Something simple and intuitive on the frontend is in most cases not simple on the backend. I tried to explain exactly what is done how. These things are mostly unimportant to usability.
Example: The algorithm which controls track-laying in Trainz is surly not simple and easy to understand nevertheless did you say that you like it.

Ask me about it. I want you to understand fully.
\°| Greetz, TossIB |°/
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Post by Zuu »

TossIB:

I like too se that you are thinking about this issue. :)

I can't yet say if I like it or not, but seam to be not totaly bad. However in TE users will plan the construction and then press apply to actiually build it. I don't know if you where aware of that when you wrote your modell. Either or I think than since we have this pre-build plan mode the build-system should be kind enought to the players to allow them to redesign things easily before they have applyed their plan.

So I beleave we need to think about a way to allow players to redesign a layed track (layed in the planer, but not yet applyed) easily without having to delete it first. Though I need to reread your text again to see what things that prevents this at the current form.


Also, I rather think that you should be able to pull track with your mouse, and then drag out the curve with the mouse too. Perhaps curve draging can be done with right mouse button and final placement is left mouse button. But keyboard alternative is also good.. but lets not get into a huge discussion about keyboard versus mouse/wacom pen/trackball controll.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

An easy way of modifying track might be if you give track sections "hooks" that you can click on and then use to drag the track. Those hooks could i.e. become visible when pressing down the Ctrl-key while laying track.
User avatar
aarona
Traffic Manager
Traffic Manager
Posts: 221
Joined: 26 May 2006 15:54
Location: Perth, Australia
Contact:

Post by aarona »

A picture can speaks a thousand words. (I hope this makes sense)
Attachments
Trainz
Trainz
trainz.PNG (232.39 KiB) Viewed 844 times
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

That looks very cool :).
User avatar
TossIB
Engineer
Engineer
Posts: 67
Joined: 08 Aug 2004 08:21
Location: Germany

Post by TossIB »

Zuu wrote:However in TE users will plan the construction and then press apply to actiually build it.
I'm actually pleased to hear this since I presumed that.


I got the impression that you guys favour a slightly other approach then I do (please correct me when I'm wrong). It seams you'd like to build a rough layout through some specific points first, and then do some pushing and pulling and twaeking till it looks right.
RP-PB wants to get all the infos about where the track should be on the first run. No tweaking needed.


Issue of redesigning track.
Good point made there. You're right, RP-PB is not that flexible when it comes to altering track. This is a consequence of the restrictive specifications (points, bending) the user did before and is bound to do. Keep in mind, that in RP-PB a segment can only bend to the left or the right or be straight. Think of the track more like a consist of segments, then a bendable line.
The whole system does have less degrees of freedom, more is controlled by the player. But all in all that is a good thing in my opinion. The user allways has the option to built the new layout right over the old one though (and using part of the old one).
I add some options to the first post.

Hyronymus wrote:An easy way of modifying track might be if you give track sections "hooks" that you can click on and then use to drag the track. Those hooks could i.e. become visible when pressing down the Ctrl-key while laying track.
Yea, I have these hooks. They are the joinings between the segments. But these aren't dragable, I'm afraid. Dragging these will always mean changing the segment to the right and the one to the left. Keep in mind, that with this style a segment can only bend to the left or the right or be straight.

- - -

Some theory (sorry, thts the math student coming through):
Placing a smooth line through some specific points is an issue of interpolating these points.
Splines do the job - they do the job for Trainz though - thanks for the pic aarona. But Splines bring in some big fat problems also:
- You need more info then just the ending points (at least when you want it to be smooth). You need either two additional control points per spline or the derivation in the ending points (the tangents). You may try to guess these values though.
- You may also calculate the radius at a point of a given spline (and thus be able to filter), but setting a spline with minimum radius is near to impossible.
Trainz seemingly works just like that. Derivations are guessed and additional input is worked in (specifying straights). Results are quiet good, but not at all satisfying imho (not evenly shaped curves, all looks very inconsistent...). It surely needs much work and a carefull placement of the points to achieve a good result.

P.S. I try to write short next time - promise
\°| Greetz, TossIB |°/
Post Reply

Return to “General Transport Empire Discussion”

Who is online

Users browsing this forum: No registered users and 16 guests