Articulated Road Vehicles

Get help, info, news and advice about the Transport Tycoon Deluxe patch.

Moderator: TTDPatch Moderators

User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Articulated Road Vehicles

Post by Lakie »

I get it crashing when I've given it no orders at all, which means its a bug.

Still in the process of trying to fix it, as for the refit thing, that would be because I altered the code a while back to attempt to fix it.
(I noticed because my ttdpatch repository has a red mark on "refits.asm" so it must have been modified by me at some point).

[Edit] Sorry, I forgot that I didn't commit it, unfortunately I very rarely use the nightlies and only recompile if I alter something myself so I fail to notice if I've not committed something after a few days.

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Articulated Road Vehicles

Post by wallyweb »

Lakie wrote:Sorry, I forgot that I didn't commit it, unfortunately I very rarely use the nightlies and only recompile if I alter something myself so I fail to notice if I've not committed something after a few days.
Isn't there a verse in the patch wiki bible that goes something like:
"He who does not commit shall himself be committed"? :wink:

Now that I'm done with my stand up comic routine, will you be committing it? 8)
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Articulated Road Vehicles

Post by Lakie »

I might commit it later, however first I plan on finishing my trailer code, which should now mimic the train methods. (Ie. a new function for the buying of trailers similar to how Trains have a "buy engine" and a "buy wagon" function).
Currently, it no long crashes after doing this, however there is a lot of cleaning up required by me to do. (Also this is based of the idb and the debug runtime version of the function (which turns out to be almost identical for once)).

Might have broken the buy menu though...

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Articulated Road Vehicles

Post by wallyweb »

If you pull this one off Lakie, I'm voting for you to be the new Patchman! 8)
Erm ... You don't play WoW, do you? :?
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Articulated Road Vehicles

Post by Lakie »

Ok, the whole buy and selling of aRVs should now be fixed, however being a new function, there are bound to be a few teething bugs.
Also my crude fix refitting is also committed, it isn't by any means perfect and will not take into account if that articulated unit can or cannot be refitted to it.

I play Eve-Online actually.

[Edit] Just a side note, the whole sell and build keeping orders thing should now work, so if you build a noraml RV and give it the service at Depot command, sell it and build an aRV, it should get that list and the command. (Although it should be noted that it may not do anything or crash upon phrasing it, I'm not sure if there is code to handle it for the trailers).

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Articulated Road Vehicles

Post by wallyweb »

Lakie wrote:I play Eve-Online actually.
Ok! That one is not on the United Nations list of highly addictive substances. You have my vote. 8)

Thanks for the aRV work. I'll give it a good workout tonight as soon as the nightly hits the stands. :D
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Articulated Road Vehicles

Post by wallyweb »

Lakie wrote:Ok, the whole buy and selling of aRVs should now be fixed, however being a new function, there are bound to be a few teething bugs.
Also my crude fix refitting is also committed, it isn't by any means perfect and will not take into account if that articulated unit can or cannot be refitted to it.
Unfortunately my religion only allows for one God and the position is both eternal and taken. Will you settle for sainthood? :D
I just tested your fix and it all works with one little exception for which I have found a workaround:
One still can't add depots to an aRV's orders ... or at least not directly.
How to do it:
1. Buy a non-articulated RV.
2. Give that one the orders you want, including goto depot orders.
3. Sell that RV.
4. Immediately buy the aRV you want. It picks up the orders from the non-aRV, including the goto depot order, and the aRV follows that order quite nicely, thank you. :mrgreen:

I don't know what you think still needs fixing, but as far as I can tell, it's working as intended. :bow:
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Articulated Road Vehicles

Post by Lakie »

That has been disabled somewhere else in the code, that method is the one I described as a work around in my above post...

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Articulated Road Vehicles

Post by wallyweb »

Lakie wrote:That has been disabled somewhere else in the code, that method is the one I described as a work around in my above post...
Oops! :oops: Must be my day for dementia.
User avatar
stevenh
TTDPatch Developer
TTDPatch Developer
Posts: 759
Joined: 24 Jul 2005 05:07
Location: Canberra, Australia
Contact:

Re: Articulated Road Vehicles

Post by stevenh »

That's possibly just the code that's attempting to stop a user from sending an aRV to a 'standard' bus/truck stop; seeing as that the movement in there isn't friendly to an aRV.
I'd imagine the ID for a depot is intertwined with the IDs for the stops and is killing it... I could be entirely wrong though.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Articulated Road Vehicles

Post by wallyweb »

dev: It's too quiet in here.
player: Ok ... I've got one for you ...

When building aRV trucks, they occasionally forget their trailers when setting off to work. The trailer must still be in the Depot, because if you try to dynamite the depot, you get a "Road vehicle in the way" error, even though the depot appears to be empty. The png says it all.

It would appear that you must delete a known good aRV (Does not have to be in the same depot) to be able to build an aRV that sets out dragging its trailer behind it.

I've attached all the pertinent reference documents in a zip. Note that I removed all extra grfs from the newgrf configuration file so the enclosed save game may seem a bit strange, if not outright hillarious.

This just in! In the second png, you will see that aRVs seem to be identified as "vehicle 0" when arriving in the depot, no matter what you name them.

Due to internet access challenges please allow 24 hours for any replies to your replies.
Attachments
No trailer
No trailer
Forgot_my_trailer.png (104.64 KiB) Viewed 4849 times
Road_Vehicle_0.png
Road_Vehicle_0.png (110.42 KiB) Viewed 4848 times
Where_is_my_trailer.zip
(398.9 KiB) Downloaded 173 times
User avatar
Wile E. Coyote
Tycoon
Tycoon
Posts: 8515
Joined: 08 Jul 2004 22:14
Skype: wile.e.coyote2
Location: Belgrade, Serbia
Contact:

Re: Articulated Road Vehicles

Post by Wile E. Coyote »

One ask for Devs :bow:

Is it any chance to add support for Callback 1D for road vehicles?
(NFO Renum says that Callback 1D is not supported for road vehicles, and, of course, you can make multiple consist with CTRL, even if code for Callback 1D is present. Interesting, you can encode that code and load and use GRF normally, but, of course, attach disallowing is not working.)
Serbian rail set with Serbian scenario (ECS, PBI, FIRS and Tourist set compatible) Website | Topic and download | Latest version: 03.06.2015.
Serbian tram set Tracking table | TTD Patch tram set Latest version: 17.06.2015. | Open TTD Remix Latest version: 11.07.2015.
WIN-DOS GRF Converter Topic and download | Version 0.2.1: 09.01.2005.


Runner-up in "Best avatar Forums award" for years 2006 and 2010!
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Articulated Road Vehicles

Post by Lakie »

TTDpatch does not check grfs as they are loaded for unused or invalid callback sorter results.
Thus no error, nothing wrong with that, that said aRVs doesn't check callback 1D so that branch of the callbak sorter is completely unused (so putting it in has no effect).

[Edit] It appears in that saved game new trailers are not getting the parent 's cycle passed to them, causing them to be constantly stopped. (Hence not leaving the depot).
You can delete the whole aRV, if you send the head back to the depot that has it's trailer and delete it. (You should also be able to remove the the depot after that).

Not sure about the Vehicle is waiting in depot, it is possible that TTDpatch tries to use the trailer as the number of the vehicle, hence returning 0.

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Articulated Road Vehicles

Post by wallyweb »

Lakie wrote:It appears in that saved game new trailers are not getting the parent 's cycle passed to them, causing them to be constantly stopped. (Hence not leaving the depot)
Is this fixable?
You can delete the whole aRV, if you send the head back to the depot that has it's trailer and delete it. (You should also be able to remove the the depot after that).
Yep ... that's what I've been doing.
Not sure about the Vehicle is waiting in depot, it is possible that TTDpatch tries to use the trailer as the number of the vehicle, hence returning 0.
That's what I've been thinking.

In my game I recently deleted all my trams and RVs and then rebuilt all the aRVs that I needed. They came out ok. Then I rebuilt my regular RVs and my trams. Then, out of curiosity, I tried to build an aRV ... No trailer. It seems, although I can't be sure, that the problem begins if you build vehicles after building some aRVs and then try to build an aRV.

I sure hope this is fixable. It's a bit of a bother having to delete all RVs just to get an aRV that remembers it came with a trailer.
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Articulated Road Vehicles

Post by Lakie »

Unfortunately I don't know how the parent - child schema Steven wrote works, and he appears to have forgotten so its unlikely that it will get fixed any time soon, sorry.
Notably it only seems to affect that saved game and not new games or my saved games, which is a little peculiar.

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
User avatar
JGR
Tycoon
Tycoon
Posts: 2558
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Articulated Road Vehicles

Post by JGR »

I should add here that (part of) this problem has occurred to me, on my main game.
I had not previously reported it because it has been extensively hex-edited and had unfinished code used on it, so I know that the savegame is full of bugs and is not something which you'd want to debug...

Any built ARV for me does not display it's trailers except in the vehicle properties window, however it works fine with a new savegame and same config...

I have not noticed any instances of vehicle 0 messages though.

JGR
Ex TTDPatch Coder
Patch Pack, Github
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Articulated Road Vehicles

Post by wallyweb »

JGR wrote:I have not noticed any instances of vehicle 0 messages though.
You should see it when the news line announces that your aRV has arrived in the depot.

I'll be starting a new game soon so I'll see if the problem follows. Would be nice to know what to avoid though, so that it doesn't happen ... And don't anybody say to avoid buying aRVs. :P
User avatar
JGR
Tycoon
Tycoon
Posts: 2558
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Articulated Road Vehicles

Post by JGR »

Some tests:
I did not get the road vehicle 0 messages upon the vehicle entering the depot, the correct number was given.

After disabling lines 603-604 of articveh.asm, the vehicle leaves the depot with it's trailer as it should, but on returning, a road vehicle 0 error is given.

Code: Select all

test	word [esi+veh.vehstatus], 2		;2 == stopped... so just quit.
jnz	near .justQUIT
This suggests that somewhere there is a bug in the vehicle status propagation code.

I will investigate.

The vehicle message bug is probably just a case of patching the news ticker code to ignore vehicles with consists numbers of 0...

JGR

Edit:
Bug found: newtrain.asm:1834
Diagnosis: Typo, "e" missing from register name, creating overflow error of vehicle pointer offset
Hence preventing the trailers from starting unless all their immediate parents were in the first 512 vehicles in the array.
Fix will be committed soon (after it's finished compiling for testing purposes).
Ex TTDPatch Coder
Patch Pack, Github
User avatar
Wile E. Coyote
Tycoon
Tycoon
Posts: 8515
Joined: 08 Jul 2004 22:14
Skype: wile.e.coyote2
Location: Belgrade, Serbia
Contact:

Re: Articulated Road Vehicles

Post by Wile E. Coyote »

I've just started to code aRVs, so I'm not too familiar with them yet, maybe I missed something, so I wanted to ask this:

If speed for RV is set to 0, does it mean it is trailer (like train wagons)?
Serbian rail set with Serbian scenario (ECS, PBI, FIRS and Tourist set compatible) Website | Topic and download | Latest version: 03.06.2015.
Serbian tram set Tracking table | TTD Patch tram set Latest version: 17.06.2015. | Open TTD Remix Latest version: 11.07.2015.
WIN-DOS GRF Converter Topic and download | Version 0.2.1: 09.01.2005.


Runner-up in "Best avatar Forums award" for years 2006 and 2010!
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Articulated Road Vehicles

Post by wallyweb »

JGR wrote:Bug found: newtrain.asm:1834
Diagnosis: Typo, "e" missing from register name, creating overflow error of vehicle pointer offset
Hence preventing the trailers from starting unless all their immediate parents were in the first 512 vehicles in the array.
Fix will be committed soon (after it's finished compiling for testing purposes).
Hooray! :D :D
Post Reply

Return to “General TTDPatch”

Who is online

Users browsing this forum: No registered users and 22 guests