Help please - Crash

Got a problem with TTDPatch? Get help here.

Moderator: TTDPatch Moderators

Post Reply
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Help please - Crash

Post by PikkaBird »

I'm not sure whether this is a patch problem, or a grf problem. If it's a grf problem, I don't understand where it's coming from or why.

Basically, what's happening is the AI is building a route (it seems to affect mainly or exclusively livestock routes), and then is building a bad locomotive or wagons. I have also once seen it build a superflous locomotive - eg, on a route where the AI would normally run two trains, there were three running around, with the first one built just a locomotive, with no orders.

It does not happen with every livestock route. It does not happen immediately after a new locomotive has been introduced. I can't really see the pattern.

I have attached the latest build of my grf file, my ttdpatch.cfg, and a savegame. The game is saved about a month before the AI will attempt to build a route and then build a bad locomotive. Clicking the locomotive's info button will cause a crash, with the following crash log:

Code: Select all

TTD V0019E200 Crash Log by TTDPatch 2.0.1 alpha 62 fixed (Windows)

Exception C0000005 at 001B:00618FBF

EAX       EBX       ECX       EDX
00000000  11141410  FFFF0106  00000000

ESI       EDI       ESP       EBP
00646A1A  004F8194  0006F9B4  0006F9C0

DS        ES        FS        GS        SS        Flags
0023      0023      003B      0000      0023      00010247
FFFFFFFF  FFFFFFFF  00000FFF  ########  FFFFFFFF (Segment limits)
00CFF300  00CFF300  0040F300  ########  00CFF300 (Access rights)

Bytes at DS:EIP
0F AF 03 F6 C2 01 74 02 D1 E8 01 45 F8 83 55 FC

Stack Dump:
00646A1A  00000000  00000000  00001F74  00574EDE  00000031  004E9EA0  0056ED1E
004E9EA0  00A00244  0022003C  00230104  02205604  0056EB3A  004E9EA0  014000C2
01040022  00553D5F  00553C72  014000C6  01040022  0056E16C  004F77C9  01000020
0056AAEA  0055A1EE  0055A091  0006FF2C  00405A18  00000000  0008239C  7FFDC000

Handler Stack Dump (at 0023:0006F764):
00003FFF  A38E8000  C014C170  00000000  00000000  0000003B  00000023  00000023
004F8194  00646A1A  11141410  00000000  FFFF0106  00000000  0006F9C0  00618FBF
0000001B  00010247  0006F9B4  00000023  4020027F  07000000  77C4FA29  0000001B
0006F8C0  00000023  00001F80  0000FFFF  00000000  0006F958  0000003B  00000000

Patch flags:
DBF8FFFF  FFFFFFFD  FFFFFFFD  00004FFF  00000000  00000000  003A7EBE  A0800000
0000006F  00201000  00001000  00000000  009607D0  01900096  016D005A  FFFF0000
0000C23D  01E00280  13880258  05145555  0A28370A  140A1928  1E145014  14141450
3C1E1E14  003C5A3F  FFFF0314  F0F0F0F0  FFFF0001  015A02FF  320A0101  02010007
010A233E  0103010A  140A0014  010B0401  00000000
Any ideas gratefully recieved.
Attachments
Image1.png
Image1.png (36.63 KiB) Viewed 1448 times
Last edited by PikkaBird on 01 Oct 2005 01:41, edited 1 time in total.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

The crash indicates that some engine has an invalid value in prop. 0E (running cost base).

The game would crash as soon as an AI buys this engine or you display it in the purchase list.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

Patchman wrote:The crash indicates that some engine has an invalid value in prop. 0E (running cost base).
Hm. Any way of telling which vehicle ID is causing the problem?
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Not from the crash log, only by trial and error I'm afraid.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

Patchman wrote:The game would crash as soon as an AI buys this engine or you display it in the purchase list.
But the thing is, it doesn't. :S

I can display, build and run every vehicle, and I can't see anything obviously missing from the list.

I'll keep digging. It's definitely livestock trains that are affected.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

I guess then I'll need a copy of your .grf file to test it. You didn't attach it in your first post.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

Oh, the attachments went wonky.

Here we go.
Attachments
pikka_crash.zip
(141.17 KiB) Downloaded 36 times
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

OK, the problem was a bug in the divide/modulo operation of the var.action 2 <varadjust>. It just didn't work and corrupted the rest of the sprite. In this case, it cause the AI callback to return a vehicle ID of F4, which is obviously not a valid train ID, so you get the problems you've noticed.

The problematic sprite is #1243:

Code: Select all

 1243 * 16       02 00 A6 81 00 80 FF 00 02 01 1F FF 00 00 1E FF
You can however rewrite that without using the modulo operation, since A mod 2 = A and 1:

Code: Select all

 1243 * 14       02 00 A6 81 00 00 01 01 1F FF 00 00 1E FF
There are a few sprites like that, you'd need to fix all of them, or wait for alpha 63.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

Thanks Josef. If a63 will fix this I guess I'll wait.
Post Reply

Return to “Problems with TTDPatch”

Who is online

Users browsing this forum: No registered users and 13 guests