Train speed bug

Forum for general requests for support for players. Both staff members and veteran players can help new players with problems they encounter. No chatting in this forum, please.

Moderators: Public Relations Department, Players Department, Programming Department

User avatar
zymurge
Posts: 37
Joined: Mon Oct 17, 2005 4:41 am
Contact:

Train speed bug

Postby zymurge » Mon Oct 19, 2020 10:02 pm

A train recently came alive in Zuzi. I'm not sure if it's the first ever, but an incident occurred that exposed something wrong with the train speed. My character only had second hand knowledge of what happened, so some parts of the following sequence are unclear:
  • A train was completed and no fuel was loaded onboard
  • The train was sent down the tracks from I assume the Location tab
  • The tracks spanned 5 cities with stations only at each end
  • The driver reported that Working At Controls made the train move very fast relative to other types of travel
  • The train made it there and back in under a day

My understanding is that an unfueled train would, like an unfueled car, move at a very slow walk-like pace. It's not clear if the train was initially moving very fast or if it only picked up speed after Working At Controls was active.

My hunch is that the bug is in the code path for Working At Controls, where it either doesn't take into consideration whether the train has fuel or not or in that it applies a constant speed instead of a relative increase to the base fueled or unfueled speed.
User avatar
Greek
Programming Dept. Member/Translator-Polish
Posts: 4726
Joined: Mon Feb 13, 2006 5:41 pm
Location: Kraków, Poland
Contact:

Re: Train speed bug

Postby Greek » Tue Oct 20, 2020 10:08 am

Indeed it looks like a bug. I'll investigate that.
‘Never! Run before you walk! Fly before you crawl! Keep moving forward! You think we should try to get a decent mail service in the city. I think we should try to send letters anywhere in the world! Because if we fail, I’d rather fail really hugely’
User avatar
zymurge
Posts: 37
Joined: Mon Oct 17, 2005 4:41 am
Contact:

Re: Train speed bug

Postby zymurge » Mon Dec 07, 2020 11:55 pm

As an experiment, I've tested this in two different cars on different roads. The data shows a pretty strong indication that vehicles travel at top speed with 0 fuel, possibly even overriding road type calculations. So the bug appears to be not specific to trains, but to any sort of fuel based travel. It's also likely that it was introduced with the change that brought the 3 hour ticks into the more granular movement ticks.

Some data points

Truck traveling on path:
  • With fuel, covered 17% distance in 32 minutes
  • Without fuel, covered 37% in 8 minutes

Truck traveling on sand:
  • With fuel, covered 5% distance in 11 minutes
  • Without fuel, covered 42% in 32 minutes

Van traveling on expressway:
  • With fuel, covered 18% distance in 73 minutes
  • Without fuel, covered 12% in 35 minutes
User avatar
Greek
Programming Dept. Member/Translator-Polish
Posts: 4726
Joined: Mon Feb 13, 2006 5:41 pm
Location: Kraków, Poland
Contact:

Re: Train speed bug

Postby Greek » Fri Dec 11, 2020 3:58 pm

That's true. That's for more details, I'll try to fix it.
I tried it this week but it appeared to be more time consuming than I've expected.
‘Never! Run before you walk! Fly before you crawl! Keep moving forward! You think we should try to get a decent mail service in the city. I think we should try to send letters anywhere in the world! Because if we fail, I’d rather fail really hugely’
User avatar
zymurge
Posts: 37
Joined: Mon Oct 17, 2005 4:41 am
Contact:

Re: Train speed bug

Postby zymurge » Fri Dec 11, 2020 4:39 pm

Thanks Greek. Right now it creates an exploit. I'd be happy to help with this. I'm weak in php, but have decades of programming experience in a bunch of languages. I'm pretty solid diving into new code bases and finding patterns. Is there a read only repository that I could look at?
User avatar
Greek
Programming Dept. Member/Translator-Polish
Posts: 4726
Joined: Mon Feb 13, 2006 5:41 pm
Location: Kraków, Poland
Contact:

Re: Train speed bug

Postby Greek » Sat Dec 12, 2020 8:11 pm

Unfortunately it's not possible, Cantr is closed-source. But the path to get access to the code by joining ProgD is not that long.

The only Cantr-related repisitory that is publicly available is the one for real-time events refresh in Node and it's because I've published it before adding to Cantr's codebase: https://github.com/alchrabas/node-socketio-example
‘Never! Run before you walk! Fly before you crawl! Keep moving forward! You think we should try to get a decent mail service in the city. I think we should try to send letters anywhere in the world! Because if we fail, I’d rather fail really hugely’

Return to “General Support”

Who is online

Users browsing this forum: No registered users and 1 guest