Page 1 of 1

TTDpatch 2.5 (between releases) - r1934

Posted: 03 Jul 2008 01:33
by Lakie
Hi All,

After being nearly 2 years (which can be found here) since the last beta release I thought it would be very useful to get feedback on the latest version of that branch as well as finally nail down the last few bugs in it so that we can finally get to a proper release build and focus on the trunk builds more!
I have taken the following from the wiki's bug tracker (using the milestone filter) where relevant to this build of the 2.5 branch.
Please note that feature requests will not be done unless there is a very good reason for it, the 2.5 branch has a 'feature freeze'.

Known Issues
[Major] AI destroys player tracks (Unknown) - Fixed as of r1941.
[Major] Issue in map editor (Dave Worley & SAC) - Fixed as of r1950.
[Cosmetic] overforestation (Pikka) - Closed

Versions
Currently I've built and compiled with full version data (all 5 windows versions of TTD) the windows version of TTDpatch based off the 2.5 branch at revision 1934.
Do not ask for a DOS version, as I do not have the environment set-up or executables available to build it at all let alone properly.
The built version has he latest version of "ttdpbasew.grf" included with it for ease, it should also work without the registry (like the betas).

Thread Rules
Please do post bug reports (with crash logs (if available or possible), configurations and instructions on how to reproduce) in the Problems section (with a [2.5] in the title) instead of this thread,
In order to keep this somewhat usable I will remove spam posts or posts I believe have no purpose,
Any posts about OpenTTD will be removed regardless of context (unless its to emphasize its a bug in TTDpatch),
I will try to keep the list as up to date as possible based off the replies to this thread and the Problems section.

Hopefully other developers will find some time to help me find and fix the bugs found, otherwise do not expect rapid progress, especially if I cannot reproduce the bug.

~ Lakie

Re: TTDpatch 2.5 (between releases) - r1934

Posted: 03 Jul 2008 02:08
by DaleStan
Personally, I don't see how 1934 can possibly work. (I'd mention this on IRC, but I can't get it to work from here.)

In 1933, at newtrains.asm:182, edi is moved forward 44 bytes from the beginning of the string found by the patchcode at :181. In 1934, these lines are :186 and :190, but they should do the same task. However, in between them, edi is moved backward 36 bytes, so the add at 190 ends up with only a +8 byte net motion, instead of +44.

On July 7, I'll be able to build (blind) a DOS version. I can collect one set of version information, but unless you have all five DOS binaries, please don't blob any at me until I determine exactly which version I have.

Re: TTDpatch 2.5 (between releases) - r1934

Posted: 03 Jul 2008 13:52
by Lakie
Basically, the first one was patched to 8 places, which lead to a lot of smaller bugs, so I removed it there.
I then wrote the patch proc to go 36 bytes back from the function affected (which is the next 3 bytes of the proc above, which patches that one instance).
If you cannot follow it, I suggest you look at '00573c9a' (3rd line down) in the debugger to see the differences between 1931, 1933, 1935.

~ Lakie

Re: TTDpatch 2.5 (between releases) - r1934

Posted: 03 Jul 2008 14:39
by Lakie
Right, I'll explain it (as you cannot get on IRC for a discussion over it).

Code: Select all

	; sets edi to the end of the fragment.
	patchcode olddisplaytraininfosprite,newdisplaytraininfosprite,1,1

	; we want to go back 36 bytes from this fragment to just under 'xchg edi, esi' from the "displaytraininfosprite" fragment.
	sub edi, 36

	; we store the 'mov esi, [esp]' fragment in those 3 free bytes (left from that fragment).
	storefragment restorewindowpointer

	; not uesd and has been commented out for quite some time (since r456).
//	add edi,lastediadj+44 
//	storefragment newshowactivetrainveh

	; finds a new location and changes edi anyway.
	stringaddress oldshowtraindetailssprite
	copyrelative fnshowtrainsprites,3
So am I missing an obvious mistake in my logic here?

~ Lakie

Re: TTDpatch 2.5 (between releases) - r1934

Posted: 03 Jul 2008 17:06
by DaleStan
Nope. I just missed that the lines were commented. Sorry about that.
/me wonders how to make such mistakes less likely in the future.

Anyway, I'll build for DOS some time on Monday.
Lakie wrote:[Major] AI destroys player tracks (Unknown) - We need a saved game before this sort of thing happens before we can reproduce and fix it.
Do you have a link for this report? I know there was a bug to this effect in newairports, but that's only in 2.6, and I "fixed" it some time ago.
Lakie wrote:[Major] Issue in map editor (Dave Worley & SAC) - I am unable to reproduce this.
If this is the (in)famous map-window bug, I can probably fix it blind. Fortunately, it doesn't seem to affect DOS, for whatever reason.

Re: TTDpatch 2.5 (between releases) - r1934

Posted: 03 Jul 2008 17:22
by Lakie
DaleStan wrote:Anyway, I'll build for DOS some time on Monday.
Good atleast then we can see if DOS has any issues (assuming people still use the DOS version)...
DaleStan wrote:
Lakie wrote:[Major] AI destroys player tracks (Unknown) - We need a saved game before this sort of thing happens before we can reproduce and fix it.
Do you have a link for this report? I know there was a bug to this effect in newairports, but that's only in 2.6, and I "fixed" it some time ago.
The report links to this thread.
[Edit] It appears to be a bug in "checkIfTramsAndKeepTracksUnder" function Steven uses there for trams.
DaleStan wrote:
Lakie wrote:[Major] Issue in map editor (Dave Worley & SAC) - I am unable to reproduce this.
If this is the (in)famous map-window bug, I can probably fix it blind. Fortunately, it doesn't seem to affect DOS, for whatever reason.
From what I remember reading it had something to do with Directx's buffers (Josef's post here), doesn't seem to be a common crash though.

~ Lakie

Re: TTDpatch 2.5 (between releases) - r1934

Posted: 03 Jul 2008 17:29
by michael blunck
[quote=""Lakie"]at least then we can see if DOS has any issues (assuming people still use the DOS version)...[/quote]
I could have a try. Although there´s still the infamous DOS memory overwrite bug (?), reported ages ago to Josef and Oskar ... :?

regards
Michael

Re: TTDpatch 2.5 (between releases) - r1934

Posted: 04 Jul 2008 00:53
by Dropzone
This should probably go in before the release - I noticed recently that I made a slight error with this fix, namely that it overwrites 2 bytes too many in the DOS version. This causes steam trains to sometimes stop producing steam when they shouldn't. The, erm, fix for the fix is attached.

Re: TTDpatch 2.5 (between releases) - r1934

Posted: 04 Jul 2008 07:21
by michael blunck
Ah yes. Possibly this is related to this bug reported a year ago:

http://wiki.ttdpatch.net/tiki-view_trac ... Modif_desc

Although only "cosmetic", it´s indeed quite annoying. :?

regards
Michael

Re: TTDpatch 2.5 (between releases) - r1934

Posted: 04 Jul 2008 16:44
by Lakie
DropZone wrote:This should probably go in before the release - I noticed recently that I made a slight error with this fix, namely that it overwrites 2 bytes too many in the DOS version. This causes steam trains to sometimes stop producing steam when they shouldn't. The, erm, fix for the fix is attached.
Whilst it is a very nice fix, and works quite nicely in 2.6 (I didn't know about that fragment type but then again I hate dealing with proc files),
That particular fragment doesn't appear to exist in the 2.5 branch (though it does not enhanced tunnels so I suppose that makes sense)...

[Edit] It has been committed into the trunk as of r1936.
Got to love the difference in access to Landscape 4 ad 5 between DOS and Windows versions of TTD. ;)

~ Lakie

Re: TTDpatch 2.5 (between releases) - r1934

Posted: 04 Jul 2008 17:36
by Dropzone
Heh, I completely forgot that enhancetunnels wasn't in 2.5...

Re: TTDpatch 2.5 (between releases) - r1934

Posted: 07 Jul 2008 16:12
by DaleStan
As promised. If the version information is missing for your version of TTD DOS, feel free to send it to me.
ttdpatch.r1934.zip
(465.24 KiB) Downloaded 479 times
michael blunck wrote:Although there´s still the infamous DOS memory overwrite bug (?), reported ages ago to Josef and Oskar
We are neither Josef nor Oskar.

Re: TTDpatch 2.5 (between releases) - r1934

Posted: 16 Jul 2008 06:36
by eis_os
Well I do try to find and fix overwriting bugs: (a 2.6 only problem)
http://svn.ttdpatch.net/trac/changeset/1917

But the DOS problem is still not easy to find specially as I only run the windows version you know... :roll:

Re: TTDpatch 2.5 (between releases) - r1934

Posted: 07 Aug 2013 03:32
by WWTBAM
I know most people have lost interest in 2.5, but do you mind if I change any of the bugs that are marked fixed in the comments to being closed on the bug tracker?

Re: TTDpatch 2.5 (between releases) - r1934

Posted: 15 Aug 2013 13:05
by WWTBAM
Based on Lakie's OP, it seems that overforestation in temperate is the only bug left in the 2.5 branch. Would it be acceptable to disable the trees in desert patch if the climate is not Tropical? If that gets fixed and is the last bug to need fixing, then I see no reason to move 2.5 to stable.