Broken vactrain lines

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
arag_cf
Engineer
Engineer
Posts: 13
Joined: 29 Oct 2019 07:46

Broken vactrain lines

Post by arag_cf » 29 Oct 2019 07:57

After playing with NewGRFs I got broken vactrain lines.

Before that I had no road vehicles and decided to add some new NewGRFs to play with buses and trucks and to remove pipeline and trackbed rail types, but I noticed my broken trains too late (no savegames left with old NewGRF set).

So I have no idea how to convert bad rail lines under the existing trains since they have «No power».

Here is a saved game: https://thesystem.pro/file/81d

Can somebody help me please?

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9311
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Broken vactrain lines

Post by planetmaker » 29 Oct 2019 09:08

Sorry to hear. However you have been warned. When you modified NewGRFs on an existing savegame, you did both of these things:

* activated developer settings
* you clicked ok on a big red warning box that said that changing NewGRFs mid-game can damage your game beyond repair

Always make backups when you do a surgical operation with a swiss army knife.
Maybe you can undo the damage by going back to your previous choice of NewGRFs

arag_cf
Engineer
Engineer
Posts: 13
Joined: 29 Oct 2019 07:46

Re: Broken vactrain lines

Post by arag_cf » 29 Oct 2019 15:19

Yes you're right. I was warned.

Maybe I have a chance to recompile the game temporary removing the no power limitation? Then I'll have a chance to move stuck trains.

The rail type is changed from vacuum tube to pipeline (why?) for now so I need to make any trains move by any rail type. Is it possible?

I am a VB6, php and JS programmer so maybe you can tell me where to comment some if-then-else etc in the code... I can understand C/C++/C#/Java syntax.

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9311
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Broken vactrain lines

Post by planetmaker » 29 Oct 2019 15:37

If you really want to go to that length, start in
src/train_* and start messing with the power of the vehicles or in src/rail* and starting to return 'compatible railtype' in all cases.

_dp_
Traffic Manager
Traffic Manager
Posts: 130
Joined: 18 Dec 2013 12:32

Re: Broken vactrain lines

Post by _dp_ » 29 Oct 2019 15:44

Also may be a good idea to look up a string name for that error message in english.txt and then find it in a code.

arag_cf
Engineer
Engineer
Posts: 13
Joined: 29 Oct 2019 07:46

Re: Broken vactrain lines

Post by arag_cf » 29 Oct 2019 16:56

Aha cool! Thank you. I'll come back with the results soon (I hope).
Love this game since 90's (was playing it on P1-120, lol this PC is still operating with 14'' CRT dispaly lol)
So I hope I can survive this savegame. ))

arag_cf
Engineer
Engineer
Posts: 13
Joined: 29 Oct 2019 07:46

Re: Broken vactrain lines

Post by arag_cf » 29 Oct 2019 18:20

I found this:

RailType GetRailTypeByLabel(RailTypeLabel label, bool allow_alternate_labels)
{
/* Loop through each rail type until the label is found */
for (RailType r = RAILTYPE_BEGIN; r != RAILTYPE_END; r++) {
const RailtypeInfo *rti = GetRailTypeInfo(r);
if (rti->label == label) return r;
}

if (allow_alternate_labels) {
/* Test if any rail type defines the label as an alternate. */
for (RailType r = RAILTYPE_BEGIN; r != RAILTYPE_END; r++) {
const RailtypeInfo *rti = GetRailTypeInfo(r);
if (rti->alternate_labels.Contains(label)) return r;
}
}

/* No matching label was found, so it is invalid */
return INVALID_RAILTYPE;
}


So which railtype do I need to return to allow moving vactrain/maglev vehicles on universal rail?

arag_cf
Engineer
Engineer
Posts: 13
Joined: 29 Oct 2019 07:46

Re: Broken vactrain lines

Post by arag_cf » 30 Oct 2019 00:54

Okay now I made some modifications in code and trying to compile it.

Visual Studio seems to be too redundant for me so I decided to use mingw/msys64.

And I get the following error:

Андрей@arag_portable MINGW64 /c/54/openttd/s
$ make
make[1]: Entering directory '/c/54/openttd/s/objs/lang'
[LANG] Compiling and Linking strgen.exe
C:/MinGW/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: strgen_base.o:strgen_base.cpp:(.text+0x28e): undefined reference to `__memcpy_chk'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [Makefile:67: strgen.exe] Error 1
make[1]: Leaving directory '/c/54/openttd/s/objs/lang'
make: *** [Makefile:56: all] Error 1

How to fix that?

User avatar
Emperor Jake
Tycoon
Tycoon
Posts: 3085
Joined: 24 Apr 2007 09:37
Location: Straya

Re: Broken vactrain lines

Post by Emperor Jake » 30 Oct 2019 02:34

Congratulations, that's the biggest most chaotic vactrain network I've ever seen :D

Like planetmaker said, I had a go at fixing your save simply by re-adding the planning track and Pipe GRFs, and it mostly works fine again. Although the track conversions led to paths messing up which resulted in a lot of train accidents, the save should be salvageable without resorting to editing the game code.
--Stuff I made (or helped make)--
ImageImageImageImage

--My Award-Winning Screenshots and Videos--

arag_cf
Engineer
Engineer
Posts: 13
Joined: 29 Oct 2019 07:46

Re: Broken vactrain lines

Post by arag_cf » 30 Oct 2019 17:46

Emperor Jake wrote:
30 Oct 2019 02:34
Congratulations, that's the biggest most chaotic vactrain network I've ever seen :D

Like planetmaker said, I had a go at fixing your save simply by re-adding the planning track and Pipe GRFs, and it mostly works fine again. Although the track conversions led to paths messing up which resulted in a lot of train accidents, the save should be salvageable without resorting to editing the game code.
Wow cool! Thanks for the congrats )))) lol :D

I am still fighting with the gcc mingw compiler. Now downloading VS2019 but maybe I don't need to do that anymore...

Could you please drop me back the survived savegame after your touch? And when it can happen? :oops: Thanks man!

arag_cf
Engineer
Engineer
Posts: 13
Joined: 29 Oct 2019 07:46

Re: Broken vactrain lines

Post by arag_cf » 30 Oct 2019 19:37

Btw I've got it compiled in VS2019 finally... OK let's hack it now. :twisted:

arag_cf
Engineer
Engineer
Posts: 13
Joined: 29 Oct 2019 07:46

Re: Broken vactrain lines

Post by arag_cf » 30 Oct 2019 19:55

Yes I moved these stuck trains! :shock: :P

arag_cf
Engineer
Engineer
Posts: 13
Joined: 29 Oct 2019 07:46

Re: Broken vactrain lines

Post by arag_cf » 30 Oct 2019 22:34

OMG I almost fixed these crazy lines and trains... Imagine what if this could happen in the real life...

User avatar
kamnet
Moderator
Moderator
Posts: 6860
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Broken vactrain lines

Post by kamnet » 30 Oct 2019 23:16

arag_cf wrote:
30 Oct 2019 22:34
OMG I almost fixed these crazy lines and trains... Imagine what if this could happen in the real life...
That's why men are not allowed to play God! ;) Glad you got your mess sorted out. Be lucky you could reverse it. My longest-ever played save game (I started playing it in 2009) became corrupted sometime in 2014 because I kept swapping around NewGRFs. It resulted in some vehicles becoming stuck between a road tile and a station tile. It will never be fixed, and it will assuredly happen again in the future. All I can do is eliminate the tiles around it and rebuild some things, but it's forever broken. I still play it, though, because I've literally put thousands of hours of work into it.

arag_cf
Engineer
Engineer
Posts: 13
Joined: 29 Oct 2019 07:46

Re: Broken vactrain lines

Post by arag_cf » 31 Oct 2019 22:39

Thanks everybody in this topic for your help! :wink:

arag_cf
Engineer
Engineer
Posts: 13
Joined: 29 Oct 2019 07:46

Re: Broken vactrain lines

Post by arag_cf » 31 Oct 2019 22:44

kamnet wrote:
30 Oct 2019 23:16
arag_cf wrote:
30 Oct 2019 22:34
OMG I almost fixed these crazy lines and trains... Imagine what if this could happen in the real life...
That's why men are not allowed to play God! ;) Glad you got your mess sorted out. Be lucky you could reverse it. My longest-ever played save game (I started playing it in 2009) became corrupted sometime in 2014 because I kept swapping around NewGRFs. It resulted in some vehicles becoming stuck between a road tile and a station tile. It will never be fixed, and it will assuredly happen again in the future. All I can do is eliminate the tiles around it and rebuild some things, but it's forever broken. I still play it, though, because I've literally put thousands of hours of work into it.
Thank you kamnet.
I can give you my patched version of OpenTTD and you will be able to move your stuck trains.
Advantages is:
1. You can modify rail type under the vehicles directly.
2. You can start unpowered vehicles (with 0hp lol but they are still movable) but you'll need to fix your lines anyways (see point 1).
3. Better coverage of stations.

Disadvantages:
Trying to remove the rail or depot or station with the vehicle on it leads to fatal error (and you can restart and go on with the latest savegame).

Do you need my binary?

User avatar
kamnet
Moderator
Moderator
Posts: 6860
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Broken vactrain lines

Post by kamnet » 01 Nov 2019 01:46

Well, my issue isn't with trains, but road vehicles. Also, this was in a game using ChillCore's Patch Pack, back in 2013. If you want to take a look at it, the thread starts here along with a save game: viewtopic.php?f=33&t=47622&p=1083487&hi ... n#p1083487

ChillCore was never able to find a solution, but good thing is that nobody else has ever reported that problem since, either.

arag_cf
Engineer
Engineer
Posts: 13
Joined: 29 Oct 2019 07:46

Re: Broken vactrain lines

Post by arag_cf » 02 Nov 2019 01:31

Well OK I got ya.

I'll take a look at the savegame. Thank you for link.

I'll come back shortly (in a few days).

arag_cf
Engineer
Engineer
Posts: 13
Joined: 29 Oct 2019 07:46

Re: Broken vactrain lines

Post by arag_cf » 02 Nov 2019 03:22

I checked the savegame and it tells me "Savegame is made with newer version". (((

User avatar
kamnet
Moderator
Moderator
Posts: 6860
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Broken vactrain lines

Post by kamnet » 02 Nov 2019 03:52

arag_cf wrote:
02 Nov 2019 03:22
I checked the savegame and it tells me "Savegame is made with newer version". (((
Yes, you'll need to use ChillCore's Patch Pack v 14.7 r2555, found here: download/file.php?id=169156

Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 3 guests