Chill's patchpack v14_7

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

User avatar
ChillCore
Tycoon
Tycoon
Posts: 2858
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Chill's patchpack v11_2

Post 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 ...
Attachments
chipp_v11_3_r21446.diff
(1.29 MiB) Downloaded 88 times
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Cadde
Transport Coordinator
Transport Coordinator
Posts: 290
Joined: 07 Oct 2004 12:51

Re: Chill's patchpack v11_2

Post by Cadde »

:(

;)
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2858
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Chill's patchpack v11_2

Post 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.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Chill's patchpack v11_2

Post 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 ?
oberhümer
Tycoon
Tycoon
Posts: 1283
Joined: 23 Oct 2009 19:35
Location: Here and there, sometime or another

Re: Chill's patchpack v11_2

Post by oberhümer »

Fix it by dividing by -4 instead of 4 or multiplying by -((int)TILE_HEIGHT). I had that problem too.
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---

--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2858
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Chill's patchpack v11_2

Post 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.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Chill's patchpack v11_2

Post by MagicBuzz »

Here is the win32 binary for the lastest patch version and lastest trunk update.
Last edited by Rubidium on 10 Dec 2010 16:21, edited 1 time in total.
Reason: Did not comply with the GPL license, i.e. it was missing it.
User avatar
WLK
Engineer
Engineer
Posts: 31
Joined: 15 May 2005 13:47
Location: Slovakia
Contact:

Re: Chill's patchpack v11_2

Post 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?)"
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Chill's patchpack v11_2

Post by MagicBuzz »

Did you copy the files located in the "langs" folder ?
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2858
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Chill's patchpack v11_2

Post 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.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Chill's patchpack v11_2

Post 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.
Attachments
win32_chipp_v11_3_r21446.7z
(3.21 MiB) Downloaded 106 times
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Chill's patchpack v11_2

Post 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
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2858
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Chill's patchpack v11_2

Post 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
Attachments
The income for 1981 is lower because I paused the game before the end of the year ...<br />I did not want 1979 to disappear ...
The income for 1981 is lower because I paused the game before the end of the year ...
I did not want 1979 to disappear ...
Wrudhall Transport, 1981-12-24.png (19.22 KiB) Viewed 2170 times
Last edited by ChillCore on 11 Dec 2010 03:10, edited 1 time in total.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Cadde
Transport Coordinator
Transport Coordinator
Posts: 290
Joined: 07 Oct 2004 12:51

Re: Chill's patchpack v11_2

Post 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
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2858
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Chill's patchpack v11_2

Post 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 ...
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Cadde
Transport Coordinator
Transport Coordinator
Posts: 290
Joined: 07 Oct 2004 12:51

Re: Chill's patchpack v11_2

Post 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.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Chill's patchpack v11_2

Post 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 ^^
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Chill's patchpack v11_2

Post 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.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Chill's patchpack v11_2

Post 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.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Chill's patchpack v11_2

Post 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.
Attachments
Vienne Transport, 28th Mar 1950.png
Vienne Transport, 28th Mar 1950.png (8.28 KiB) Viewed 2150 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 23 guests