About push-pull trains

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

Dave Worley wrote:
Bjarni wrote:swapping graphics is no good as it demand a magic vehicle in the end.
Pikka's brakevan springs to mind.
yeah, that's my point. You need to put a magic vehicle in the end (in this case a brakevan). Not all trains use a brakevan.
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

make it refittable (cargo/livery) so you can use it like a normal wagon, but it still be a special vehicle
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Bjarni wrote:swapping graphics is no good as it demand a magic vehicle in the end. A real solution would ... need investigation and a lot of work and I'm not going to do that right now.
So, "We will do it better, but not until next year"?

This is, in my opinion, the single *MOST* *DESTRUCTIVE* line of reasoning I've ever seen. Unless, of course, your object is to guarantee that OpenTTD will always lag behind TTDPatch in the feature list. If that is the case, then keep it up, by all means. It's been serving you well until now, so why change?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

DaleStan wrote:
Bjarni wrote:swapping graphics is no good as it demand a magic vehicle in the end. A real solution would ... need investigation and a lot of work and I'm not going to do that right now.
So, "We will do it better, but not until next year"?

This is, in my opinion, the single *MOST* *DESTRUCTIVE* line of reasoning I've ever seen. Unless, of course, your object is to guarantee that OpenTTD will always lag behind TTDPatch in the feature list. If that is the case, then keep it up, by all means. It's been serving you well until now, so why change?
what I meant was: I know that I will not have time to investigate anything like this for the next month (or longer). As for the do better part, we should not make this a dirty hack, but we should find a solution that works well.

I guess it could be done faster if somebody else decided to work on this, but since I already coded something like this, it would be logically if I look into this when I get time to do so :wink:
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

DaleStan wrote:
Bjarni wrote:swapping graphics is no good as it demand a magic vehicle in the end. A real solution would ... need investigation and a lot of work and I'm not going to do that right now.
So, "We will do it better, but not until next year"?

This is, in my opinion, the single *MOST* *DESTRUCTIVE* line of reasoning I've ever seen. Unless, of course, your object is to guarantee that OpenTTD will always lag behind TTDPatch in the feature list. If that is the case, then keep it up, by all means. It's been serving you well until now, so why change?
OTTD IS lagging behind The Patch, the only ways to have an improved but unstable OTTD are MiniIN and the experimental multipatch build
if you have problems of unstability you can always do your custom build (+diff against trunk) for testing purposes, maybe dress it with some usefull patches like magic bridges and copy&paste tool
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

if you ask me, you should include this to maintain NewGRF compatability, then also add this:

a "Trains can drive backwards" (patch) option. possably with sub-options for controlling MUs, single headed engines and tender engines(and possably more) seperatly(although i know openTTD likes to "keep things simple").

imo, also, an optional NewGRF based "Can Drive Backwards" and "Reversing Speed" values. because for 1, i know tender engines drive slower backwards than forwards.

Alternativly to the NewGRF "Can Drive Backwards" and "Reversing Speed" values, let OTTD decide and relly soley on the type of engine, with a "Tender engines reverse speed = ##%" option, and possably same for other engine types.

however, we have talked about this before, and there were a few "Technical Difficulties" to actually swap the train around, making it apear to actually reverse. main problem is that all the information for the train is stored in the head engines, and when to make it reverse, the rear vehicle becomes the new head engine.

1 advantage of getting this to work would be that you could also allow trains front vehicles to be something other than the engine itself. the engine could be placed somewhere in the middle, or even at the end of a train by default, instead of always at the front.
Last edited by bobingabout on 29 Nov 2006 09:48, edited 1 time in total.
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

bobingabout wrote:imo, also, an optional NewGRF based "Reversing Speed" value.
I hate to burst your bubble, but such a thing (*gasp*) already exists. It's called callback 36, and it can set max speed based on any global or vehicle variable in existence, including bit 0 of variable FF.

I suggest you either learn NFO, or take Samuel Clemens words to heart.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5601
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

DaleStan wrote:and it can set max speed based on any global or vehicle variable in existence, including bit 0 of variable FF.
Actually, I was discussing this with wallyweb in IRC the other day. The question is whether callback 36 for speed is run after flipping the bit.

Also, there are much greater issues with bobingabout's suggestion, such as reversing tender engines (it is currently nigh-on impossible to make a tender engine "push", as you'd need a two-part "magic wagon" of about the same length) and you can probably only have it running tender-first at the head if the tender and locomotive are the same length, or you're willing to do a lot of fudging with sprite offsets).
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

i already said i don't know too much about NewGRF, and this is a sugestion, so, you don't need to be too harsh.

we had the discussion about all this before, let me see if i can dig it up

you have no idea how long it took me to find this:
http://www.tt-forums.net/viewtopic.php?t=25226
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

PikkaBird wrote:Also, there are much greater issues with bobingabout's suggestion, such as reversing tender engines (it is currently nigh-on impossible to make a tender engine "push", as you'd need a two-part "magic wagon" of about the same length) and you can probably only have it running tender-first at the head if the tender and locomotive are the same length, or you're willing to do a lot of fudging with sprite offsets).
I can imagine. Look at the screenshot I posted earlier. As I said: it's way too buggy to commit, but I did manage to make the tender engine (in this case BR 01) to drive in reverse. The locomotive would still have to be in front though so it's not a push-pull train.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Post by michael blunck »

Push-pull train implementation (both in TTDPatch and in OTTD) is a complicated issue and cannot be done on .grf level. Instead, there has to be a thorough implementation in the program´s code itself.

First of all, the functions of "push-pull service" and "engines driving backwards" are usually mixed up, but have to be dealt with separately.

Another issue is the re-ordering of the consist. Although we´re always showing identical coaches, this isn´t necessarily so, because even if we constrict the type of coaches being allowed part of a push-pull train, these coaches still may have different liveries (time-dependant).

And this is only where the problems begin.

regards
Michael
Image
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

michael blunck wrote:First of all, the functions of "push-pull service" and "engines driving backwards" are usually mixed up, but have to be dealt with separately.
agreed, even though code like drawing a sprite "backwards" can likely be used in both cases.
michael blunck wrote:Another issue is the re-ordering of the consist. Although we´re always showing identical coaches, this isn´t necessarily so, because even if we constrict the type of coaches being allowed part of a push-pull train, these coaches still may have different liveries (time-dependant).
I wonder about sprite overwrite depending on the engine in front of the wagon. Say we got engine A in front and engine B in the rear and the train starts to drive the other way, the wagon will change to see wagon B in front and that might cause a spritechange.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Post by michael blunck »

[reordering push-pull consist]
I wonder about sprite overwrite depending on the engine in front of the wagon. Say we got engine A in front and engine B in the rear and the train starts to drive the other way, the wagon will change to see wagon B in front and that might cause a spritechange.
On .grf level there´s no possibility for a single coach to access information about other coaches. Say, you´ll have this train:

engine - 1 - 1 - 2 - trailer

then you may exchange easily trailer with engine, but you cannot exchange the appearance of coaches into "2 - 1 - 1". Although each coach would have information about its rank in the consist (in both directions), it has no information about the coach on that same position when travelling in that other direction. I.e., age (and hence its actual livery) of that coach are unknown and thus cannot be exchanged.

regards
Michael
Image
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

i get what you saying, the engine and rear coach apear to stay as they are, because the graphics are switched, but the rest of the train, en carages inbetween the front engine and rear coach apear to flip, like the normal behaviour, because no graphics are changed.
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

bobingabout wrote:i get what you saying, the engine and rear coach apear to stay as they are, because the graphics are switched, but the rest of the train, en carages inbetween the front engine and rear coach apear to flip, like the normal behaviour, because no graphics are changed.
I didn't say that. Look at the screenshot. When I posted it, the idea was that people should see it, not ignore it :P
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

Looks like grf artists are going to have to produce cab trailers and DVTs. Using the brake van as a magic loco isn't really right - it's just not what brake vans did.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

Bjarni wrote:
bobingabout wrote:i get what you saying, the engine and rear coach apear to stay as they are, because the graphics are switched, but the rest of the train, en carages inbetween the front engine and rear coach apear to flip, like the normal behaviour, because no graphics are changed.
I didn't say that. Look at the screenshot. When I posted it, the idea was that people should see it, not ignore it :P
what sreenshot? i was replying to MB, about how the TTDP flipping works.
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

Since a few people appears to have missed the screenshot I posted earlier in this thread, I will post it again.

It shows that it is in fact possible to make a locomotive push it's tender without drawing new sprites, but this patch will need a lot of work before it can be worthy of committing as it introduces a whole lot of other bugs. Showing this screenshot is not a sign of a nearly finished patch.
Attachments
BR01_reversed.png
BR01_reversed.png (6.11 KiB) Viewed 4189 times
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Post by michael blunck »

> it is in fact possible to make a locomotive push it's tender without drawing new sprites

Yeah. Thats item #1: "engines driving backwards".

As said before, item #2: "push-pull service" is just another (and different) problem.

Having studied these problems for a couple of time now, I think double-linked lists for train representation would do the basic trick, but o/c it´s a severe change to TTD´s consist implementation.

regards
Michael
Image
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

that screenshot is in the link i posted, not this topic :wink:
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 9 guests