Potential new patchpach

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Antaguana
Engineer
Engineer
Posts: 10
Joined: 05 Oct 2013 08:58

Re: Potential new patchpach

Post by Antaguana »

Awesome. Can you link to where you are posting it?
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: Potential new patchpach

Post by KeldorKatarn »

Once I do, yes. That's the whole point isn't it?
Antaguana
Engineer
Engineer
Posts: 10
Joined: 05 Oct 2013 08:58

Re: Potential new patchpach

Post by Antaguana »

KeldorKatarn wrote:
adf88 wrote:
KeldorKatarn wrote:So the MSVC projects are set up ... how to set it up to build said bundle?
Just switch to "Release" configuration before compiling. Compile. Copy openttd.exe to bin folder. Distribute content of the bin folder. That's it.
So pretty much what I've been doing all along. Ok. I'll do that.

I thought you had decided to do this?
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: Potential new patchpach

Post by KeldorKatarn »

And I will. All in good time. I have a live outside of OpenTTD you know...
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: Potential new patchpach

Post by ic111 »

Rubidium wrote: Then there's also the amount of effort the patch maker is willing to make to get the patch up to par with the quality of the rest of the game, which simply takes a quite bit of time. I would definitely reckon that if we were to merge the first version of cargodist, there would have been many issues with that were not easily to resolve without breaking things like savegame compatability.
One comment to that: IMHO, one might distinguish two maturity levels of a patch:

(1) It does what the author wanted to achive, the author is content when playing with it
(2) It meets the quality standard for being merged to trunk.

From a patch authors perspective, the way from (1) to (2) is additional work. Not needed to have fun with it oneself, rather work one might do for giving others the chance to easily use it.

IMHO, it would be a great incentive for a patch developer for doing that additional work, if there would be some clear message from devs "We like the basic idea of your patch, *if* you do this additional work (details specified) then it is likely that the patch is added to trunk in not too far future".

I follow (and sometimes develop patches for it) this project quite a while now, but my impression is that this kind of feedback (ignore the nasty details that still need to be fixed, but comment on the basic idea of the patch, based on both its technical base and its implications on gameplay) is often missing in this project.

Maybe even a Wiki-Page where patches are listed, together with some opinion from dev side (either, why it is not likely that this patch enters trunk ever (e.g. because of basic gameplay issues), or, basically the idea is liked, but tasks foo, bar, etc. maybe together with general bugfixing still need to be performed) would be appropriate. [obviously some opinions would cause discussions in the forum / or would be based on such discussions, but honestly, such discussions belong to such a project]

BTW, such feedback would also increase the chances that relatively mature patches that just have some rather small flaws but their developer has no time for fixing them find contributors.

I think no one expects that devs merge buggy, unfinished patches into trunk, but on the other hand side, patch authors also want to know that the time they spent in their patches is not wasted.
maxiecool2
Engineer
Engineer
Posts: 31
Joined: 28 Feb 2013 00:20

Re: Potential new patchpach

Post by maxiecool2 »

is there a deb (ubuntu) package available to download with the patch installed?
as always when i try to compile myself something gets screwed up!!

following the instructions from http://wiki.openttd.org/Compiling_on_%2 ... x_and_*BSD
with the modified "svn checkout svn://svn.openttd.org/trunk openttd -r 26440" to get the right version

the fatal error i got was
[SRC] Compiling economy.cpp
In file included from /home/max/.openttd/source/openttd/src/ai/../script/api/script_event_types.hpp:17:0,
from /home/max/.openttd/source/openttd/src/ai/ai.hpp:15,
from /home/max/.openttd/source/openttd/src/economy.cpp:20:
/home/max/.openttd/source/openttd/src/ai/../script/api/script_window.hpp:312:3: warning: "/*" within comment [-Wcomment]
/**
^
/home/max/.openttd/source/openttd/src/economy.cpp: In function ‘Money GetTransportedGoodsIncome(uint, uint, byte, CargoID)’:
/home/max/.openttd/source/openttd/src/economy.cpp:1004:58: error: ‘exp’ was not declared in this scope
const float exp1 = (1-exp(d*(-max_1v_1vt1-INV_VA)/DECAY1))/(max_1v_1vt2);
^
make[1]: *** [economy.o] Error 1
make[1]: Leaving directory `/home/max/.openttd/source/openttd/objs/release'
make: *** [all] Error 1
thanks mat
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Potential new patchpach

Post by Alberth »

maxiecool2 wrote:as always when i try to compile myself something gets screwed up!!

following the instructions from http://wiki.openttd.org/Compiling_on_%2 ... x_and_*BSD
with the modified "svn checkout svn://svn.openttd.org/trunk openttd -r 26440" to get the right version
The first post says the patch was against 1.4.0, so you probably need to checkout svn://svn.openttd.org/tags/1.4.0 instead of /trunk.
(There is no advantage at all to base a patch against a stable release, but ok, you didn't make the patch :) )
maxiecool2 wrote:the fatal error i got was
...
/home/max/.openttd/source/openttd/src/ai/../script/api/script_window.hpp:312:3: warning: "/*" within comment [-Wcomment]
A good tactic in these cases is to first try and compile the unmodified checked out source. If that compiles, you know the basic compilation setup is sane. If it fails, either the source code in the repository was wrong, or your compiler setup is wrong, most likely the latter :) r26440 is quite recent. If you try to compile older source code, it may also happen that your compiler is too new for the code.

If you successfully compiled the unmodified source, then modify the source and compile again. If it fails, you know the problem is in the patch, and not in your compiler setup. That limits the search space.
maxiecool2
Engineer
Engineer
Posts: 31
Joined: 28 Feb 2013 00:20

Re: Potential new patchpach

Post by maxiecool2 »

yep its the patch
or maybe it might be the way i applied the pach
i dont know
after downloading from the tags repository
i copied the folder and did a dry run and it worked
i applied the patch as per http://wiki.openttd.org/Compiling_on_%2 ... x_and_*BSD
"patch -p0 < ~/.openttd/source/JokerPatchPack.patch"
and it crashed at the same point during make

i just found an error from the patching
had to add the .txt extention to the output file because the forum wouldnt let me add a .rej file
Attachments
saveload.cpp.rej.txt
(645 Bytes) Downloaded 51 times
openttd_vs100.vcxproj.rej.txt
(1.34 KiB) Downloaded 53 times
viki2
Engineer
Engineer
Posts: 11
Joined: 23 Dec 2011 01:06

Re: Potential new patchpach

Post by viki2 »

First I do had a problem with compiling.

Code: Select all

 src/economy.cpp:1004:58: error: ‘exp’ was not declared in this scope
Fixed it, and compiled well.

But now I get (at run time):

Code: Select all

Error: Cannot open file 'route_step.grf'
and later

Code: Select all

Error: Cannot open file 'oldtracks.grf'
Both includings are hard coded in: src/gfxinit.cpp

Where do I get those grf files from?

(Tried to compile to comment out the grf files. This starts the game just fine but doesn't look nice.)
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Potential new patchpach

Post by Eddi »

usually you find these files in the threads for the original patches.
maxiecool2
Engineer
Engineer
Posts: 31
Joined: 28 Feb 2013 00:20

Re: Potential new patchpach

Post by maxiecool2 »

viki2 wrote:First I do had a problem with compiling.

Code: Select all

 src/economy.cpp:1004:58: error: ‘exp’ was not declared in this scope
Fixed it, and compiled well.

viki2 how did you fix the error?
beginner2
Engineer
Engineer
Posts: 17
Joined: 12 Mar 2008 21:16

Re: Potential new patchpach

Post by beginner2 »

maxiecool2 wrote:
viki2 wrote:First I do had a problem with compiling.

Code: Select all

 src/economy.cpp:1004:58: error: ‘exp’ was not declared in this scope
Fixed it, and compiled well.

viki2 how did you fix the error?
Add the line

Code: Select all

#include <cmath>
to the file economy.cpp after one of the existing includes.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Potential new patchpach

Post by Eddi »

the actual solution would be to not use exp in the first place. using floating point math will inevitably cause desyncs.
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: Potential new patchpach

Post by KeldorKatarn »

Current version of the patchpack (since I released it already anyway)

Some part of it however (probably one of the patches it is made up of) seems to be breaking backwards savegame compatibility. Can someone check that and maybe point it out to me how I can fix that?

it complains about invalid chunk size. however I don't know what is stored in that chunk so I have no idea how to locate the problem.
Attachments
JokerPatchPackII.patch
(449.2 KiB) Downloaded 55 times
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Potential new patchpach

Post by Eddi »

a short introduction to savegame compatibility:

trunk changes savegame versions linearly, but when you maintain a patchpack over a longer time, you need to handle nonlinear savegame changes, as you need to treat new savegame versions of trunk differently than older savegame versions of your patchpack.

so, let's assume your patchpack is based on a trunk revision

Code: Select all

                                  unused buffer
                                        |
[0 ... trunk savegame versions ... X][Y...Z][A]
                                             |
                               patchpack savegame version
now trunk increases versions, so you need to increase your version as well, to keep compatibility.

Code: Select all

                                       unused buffer
                                             |       /- new patchpack savegame version
[0 ... trunk savegame versions ... X][X'][Y'...Z][A][B]
          new trunk savegame version -/           |
                                old patchpack savegame version
now here is where it gets complicated. for every new entry in AfterLoadGame and every new entry in settings.ini (from/to) (and occasionally savegame-related stuff in other files), that checks whether the version is lower than X' you have to change the valid range to check something like "is savegame version lower than X', or higher than Z and lower than B".

if you ever run out of "unused buffer", you need to drop some old savegames from your patchpack. (Chill's Patchpack did this wrong, and stopped being able to read trunk savegames at some point, even though it was based on a newer trunk revision)
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: Potential new patchpach

Post by KeldorKatarn »

I'm doing that already and it still reports a wrong chunk size. if there wasn't a bug hidden somewhere I wouldn't be asking.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Potential new patchpach

Post by Eddi »

you can try the debug output (-d sl=3) to find out which chunk is affected.
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: Potential new patchpach

Post by KeldorKatarn »

Those are command line arguments I presume?
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Potential new patchpach

Post by Eddi »

yes, but you can also enable "debuglevel sl=3" from the ingame console.
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: Potential new patchpach

Post by KeldorKatarn »

It was the settings chunk (was already expecting that). Apparently the patch that added all those nifty map features didn't set any minimum version for any of its settings. I THINK I fixed it, will post an updated patchfile soon.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 11 guests