Page 42 of 138

Re: Chill's patchpack v11_2

Posted: 10 Dec 2010 12:09
by ChillCore
Thank you for the bugreport MagicBuzz.
As Eddi mentioned this was a trunk issue which has been solved in r21442 by Rubidium.

Attached is the last version I have, pulled from my testfolder. Awarded subsidies no longer crash the patchpack -> tested.
I still need to review the code to see if I adapted the code correctly everywhere according to the recent changes in trunk, but I think most is fine.

The only difference with the previous version is that this one is bumped to trunk and the build_while_paused_in_scenario_editor patch is removed (trunk in r21430).
Changes had to be made in the departure boards patch (wallclock part).
MagicBuzz wrote: I'm trying to fix the conflicts, but I'm not sure what I'm doing about the saveload compatibility : there is a bump in the trunk, and I don't know exactely how to manage it in Chillcore's patchpack.
So I didn't change anything, but savegame compatibility should be break, so I won't post the updated patch...
For the most recent savegamebump, in table/settings.h:

Code: Select all

-	 SDT_CONDVAR(GameSettings, construction.command_pause_level,     SLE_UINT8,154, SL_MAX_VERSION, 0, ...
+	 SDT_CONDVAR(GameSettings, construction.command_pause_level,     SLE_UINT8,154, BEFORE_ADDING_PATCHES_SL, 0, ...
+	 SDT_CONDVAR(GameSettings, construction.command_pause_level,     SLE_UINT8,KEEP_COMPATIBLE_12_SV, SL_MAX_VERSION, 0, ...
BEFORE_ADDING_PATCHES_SL is only used for this purpose.
When there are changes in afterload.cpp , eg. 'if (IsSavegameVersionBefore(147)) { ...', it is a bit more complicated (untill I figure out how to exclude later versions and include even later versions) that is where I messed up with recent trunk savegames compatibilty ...

Re: Chill's patchpack v11_2

Posted: 10 Dec 2010 13:26
by Cadde
:(

;)

Re: Chill's patchpack v11_2

Posted: 10 Dec 2010 14:09
by ChillCore
Cadde wrote: :(
Yes I know ...
Unfortunately I have only one head and I only use six fingers to operate my keybord -> I one hand I hold my bad habbit and in the other my Bamboo.(*)
If you want I can make some random changes here and there in the code ...
I kid, I kid, I did not get to comparing those two daylenght patches yet properly and I still need to find the location of the function Eddi mentioned before.
Coming soon to a modified OpenTTD version near you.


(*)No not that one, this one http://www.tablet4u.co.uk/product/en/1_ ... ilver.html) :lol:
:)
My pleasure.

Re: Chill's patchpack v11_2

Posted: 10 Dec 2010 14:32
by MagicBuzz
Since the first time I compiled the patchpack, I got this warning : C4146

Code: Select all

4>  viewport.cpp
4>..\src\viewport.cpp(397): warning C4146: opérateur moins unaire appliqué à un type non signé, le résultat sera non signé
4>..\src\viewport.cpp(398): warning C4146: opérateur moins unaire appliqué à un type non signé, le résultat sera non signé
When I see this article, I'm afraid there is really a problem.
http://msdn.microsoft.com/en-us/library/4kh09110.aspx

The code raising this warning is :

Code: Select all

	a = Clamp(a, -(((uint)GetMaxTileHeight() + 1) / 4) * (int)TILE_SIZE, (int)(MapMaxX() * TILE_SIZE) - 1);
	b = Clamp(b, -(((uint)GetMaxTileHeight() + 1) / 4) * (int)TILE_SIZE, (int)(MapMaxY() * TILE_SIZE) - 1);
If I correctly understand the warning description, then the minus is just ignored and the code is interpretated like :

Code: Select all

	a = Clamp(a, (((uint)GetMaxTileHeight() + 1) / 4) * (int)TILE_SIZE, (int)(MapMaxX() * TILE_SIZE) - 1);
	b = Clamp(b, (((uint)GetMaxTileHeight() + 1) / 4) * (int)TILE_SIZE, (int)(MapMaxY() * TILE_SIZE) - 1);
Isn't that a problem ?

Re: Chill's patchpack v11_2

Posted: 10 Dec 2010 14:52
by oberhümer
Fix it by dividing by -4 instead of 4 or multiplying by -((int)TILE_HEIGHT). I had that problem too.

Re: Chill's patchpack v11_2

Posted: 10 Dec 2010 14:58
by ChillCore
MagicBuzz wrote: ... compiler warnings ...
Yes I need to still fix something there to eliminate the warning but the result is correct.
It used to be:
if (AllowMoreHeightlevels()) {
... - 64 ...
} else {
... - 4 ...
}
instead of:
... -(((uint)GetMaxTileHeight() + 1) / 4) ...

The warnings came when I changed the code. Thank you for reminding me that I need to still fix that.

The lines you pointed at determine how far the tilepointer can go outside the map.
When selecting an elevated tile at the border of the map (north and east) the tile is actually outside the map (level zero).
If the result would be signed (or just 0) not all tiles can be selected and the map has unreachable locations in terms of being able to build eg. a station on them.

I'll have a looksie at that link you posted now ...
oberhümer wrote: Fix it by dividing by -4 instead of 4. I had that problem too.
I did not think of trying to fix it like that as the result has to remain negative.
Will test in a bit.

Re: Chill's patchpack v11_2

Posted: 10 Dec 2010 15:23
by MagicBuzz
Here is the win32 binary for the lastest patch version and lastest trunk update.

Re: Chill's patchpack v11_2

Posted: 10 Dec 2010 16:10
by WLK
Here is the win32 binary for the lastest patch version and lastest trunk update.
I get strange error never seen before: "No available language packs (invalid versions?)"

Re: Chill's patchpack v11_2

Posted: 10 Dec 2010 16:19
by MagicBuzz
Did you copy the files located in the "langs" folder ?

Re: Chill's patchpack v11_2

Posted: 10 Dec 2010 16:26
by ChillCore
WLK wrote:
MagicBuzz wrote: Here is the win32 binary for the lastest patch version and lastest trunk update.
I get strange error never seen before: "No available language packs (invalid versions?)"
I just checked the binary, the language files seem to be there but a lot of required files are missing there.
The most important being the lisence.

MagicBuzz please use the "make bundle" command and a bundle folder will be created next to the bin folder.
Include everything from that folder in your posted binary, all those files are needed for the game to run correctly and to comply with the lisence.

I have not yet checked the version you posted for v11_2 but if it is the same please fix it or remove(*) it before someone else does. Missing lisence is a reason for a moderator to do so.
Thank you for understanding.

(*) Better remove it as it is broken anyway with that subsidy crash.


Edit:
Second post updated with v11_3 and a warning added to the previous posted version.

Re: Chill's patchpack v11_2

Posted: 10 Dec 2010 19:02
by MagicBuzz
Here is a new binary.

This time I used the bundle function, so I guess it's complete.

The previous version was just a refresh of the changed files, sorry.

Re: Chill's patchpack v11_2

Posted: 10 Dec 2010 22:25
by NekoMaster
MagicBuzz wrote:Here is a new binary.

This time I used the bundle function, so I guess it's complete.

The previous version was just a refresh of the changed files, sorry.
Thank you so much! Now I can pollute the world with HEQ's new diesel smoke function :D

Re: Chill's patchpack v11_2

Posted: 11 Dec 2010 02:31
by ChillCore
MagicBuzz wrote: Here is a new binary.

This time I used the bundle function, so I guess it's complete.
Much better and yes it is complete now. Thank you for fixing the error and the binary. ;)

Just one question ... Did you put the needed grfs yourself in the data folder or did the make bundle command do that for you?
It's ok if you did it yourself since they are both released under the GPL lisence, I was just wondering ...
NekoMaster wrote: Thank you so much! Now I can pollute the world with HEQ's new diesel smoke function :D
Hmm, I will have to add a polution tax if that smokes drifts over here. :)



Also ... someone will be verry happy with the next version, I hope ... @see attachment.
I have build 1 single line and build a single train that does a full load and unload between a coal mine and a power plant and let it run without changing anything but the daylength factor near the end/beginning of the year.
I did not have to change the maintenance cost or the maintenance cost.
For the income two modified lines did the trick. They are in the code block for future reference ...

Code: Select all

In economy.cpp:
In       "void CargoPayment::PayFinalDelivery(const CargoPacket *cp, uint count)"
and in   "Money CargoPayment::PayTransfer(const CargoPacket *cp, uint count)"

- Money profit = ... ;
+ Money profit = (...) / _date_daylength_factor;
The only thing I do not yet understand is where the negative infrastructure sharing income comes from ... I did not enable infrastructure sharing for my daylength/income testrun ... :?

Furthermore I noticed one more bug ... when the train is between the last and the first order of the orderlist the departureboards show cancelled instead of on time/delayed. Cancelled should only show when sent to a depot IIRC.
I do not yet know if it is something I did wrong while bumping or if the error was there already before.

edit: spelling

Re: Chill's patchpack v11_2

Posted: 11 Dec 2010 02:44
by Cadde
ChillCore wrote:Also ... someone will be verry happy with the next version, I hope ... @see attachment.
I have build 1 single line and build a single train that does a full load and unload between a coal mine and a power plant and let it run without changing anything but the daylength factor near the end/beginning of the year.
Yes, this makes me a happy hippo!
Question: Delivered cargo graph please? Because it doesn't seem right that the annual income is lower between 79 and 80?

Either way, even if the income change isn't 100% accurate i am happy because that means i can rid of all the insane difficulty settings (charging stupid amounts of $ for simple construction just to keep the wallet at a reasonable level)

Now all i need is a binary so i can test it and see what breaks :D

Re: Chill's patchpack v11_2

Posted: 11 Dec 2010 03:09
by ChillCore
Cadde wrote: Question: Delivered cargo graph please? Because it doesn't seem right that the annual income is lower between 79 and 80?
Delivered cargo graph will be a bit hard as I did not save the game.
There was a little dip in the beginning of 1980 but maybe that was because I was looking at the timetable and autofilling/automating it to see why the cancelled message showed in the departures boards patch ...
Either way, even if the income change isn't 100% accurate i am happy because that means i can rid of all the insane difficulty settings (charging stupid amounts of $ for simple construction just to keep the wallet at a reasonable level)

Now all i need is a binary so i can test it and see what breaks :D
I will post the patch tomorrow after bumping to trunk so r21458 is included and fixing the negative infrastructure sharing income bug.
I will not spend two days looking at it, just have a quick glance through the patch if can see what went wrong where.
Since I know what is wrong it should not be to hard to find the location of the code. It is just a bit too late now (4 AM) too start with that now.

If you could compile ... the needed change is listed above. I did not yet change anything else so far ...

Re: Chill's patchpack v11_2

Posted: 11 Dec 2010 03:16
by Cadde
ChillCore wrote:Delivered cargo graph will be a bit hard as I did not save the game.
There was a little dip in the beginning of 1980 but maybe that was because I was looking at the timetable and autofilling/automating it to see why the cancelled message showed in the departures boards patch ...
Ah that is explains it.
ChillCore wrote:I will post the patch tomorrow after bumping to trunk so r21458 is included and fixing the negative infrastructure sharing income bug.
I will not spend two days looking at it, just have a quick glance through the patch if can see what went wrong where.
Since I know what is wrong it should not be to hard to find the location of the code. It is just a bit too late now (4 AM) too start with that now.

If you could compile ... the needed change is listed above. I did not yet change anything else so far ...
We are in the same TZ then, looking forward to the patch. But no, can't compile unless i pull my thumb out of the dark spot and set up a compile env which i have claimed I'd rather not.
Even though sometimes i have just thought of setting it up and doing the change. Haven't felt that it's worth it yet... Since i have MineCraft to play with when OTTD isn't working for me.

Re: Chill's patchpack v11_2

Posted: 11 Dec 2010 03:32
by MagicBuzz
ChillCore wrote: Just one question ... Did you put the needed grfs yourself in the data folder or did the make bundle command do that for you?
It's ok if you did it yourself since they are both released under the GPL lisence, I was just wondering ...
I copied the GRFs into the bin/data folder.
But the make function copied it to the bundle folder.
To be honest, I didn't checked the GRFs where present in the bundle or not, as I forgot I copied the GRFs into the bin/data folder ^^

Re: Chill's patchpack v11_2

Posted: 11 Dec 2010 03:40
by MagicBuzz
ChillCore wrote: The only thing I do not yet understand is where the negative infrastructure sharing income comes from ... I did not enable infrastructure sharing for my daylength/income testrun ... :?
It looks like there is a 2 in 1 problem : doesn't "income" and "cost" words are inverted ?
I guess costs should be negative while income should be positive.

Re: Chill's patchpack v11_2

Posted: 11 Dec 2010 04:25
by MagicBuzz
After getting a deeper look at the IS negative income, it looks like there is really a mess with the strings ID.

=> If you take a look at the presentation, the "other" and "is income" lines are swaped.
=> After setting breakpoints everywhere the is income should change, I didn't raised any one.
=> While the "is income" increase like the "other" line normally increase, the "other" line remains at 0.

All of this makes me thinking there is just a problem with labels : actually there is no "is income", in fact it's "other" costs, but the label is missplaced.

Althought, I can't find where I can check to change the window behaviour.

Re: Chill's patchpack v11_2

Posted: 11 Dec 2010 04:39
by MagicBuzz
Gotcha :)

In the english.txt (and any other language file with IS traductions), change lines order like that :

from

Code: Select all

STR_FINANCES_SECTION_OTHER                                      :{GOLD}Other
STR_FINANCES_SECTION_INFRASTRUCTURE_COSTS                       :{GOLD}Infrastructure Sharing Costs
STR_FINANCES_SECTION_INFRASTRUCTURE_INCOME                      :{GOLD}Infrastructure Sharing Income

to

Code: Select all

STR_FINANCES_SECTION_INFRASTRUCTURE_COSTS                       :{GOLD}Infrastructure Sharing Costs
STR_FINANCES_SECTION_INFRASTRUCTURE_INCOME                      :{GOLD}Infrastructure Sharing Income
STR_FINANCES_SECTION_OTHER                                      :{GOLD}Other
On my personnal build, it looks like that solves the three problems : "is income" isn't incremented anymore, "is income" and "is costs" are in the correct order, "other" line is incremented again.