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

Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Chill's patchpack v10_7

Post by Kogut »

And here "real" bug report.

To reproduce: build airport on side of map, on top of high mountain.

Behaviour of plane in following situation is strange (lowering flight after initial ascending [while flying outside map], touching ground [on map border] and ascending)

[while flying outside map] - shadow of plane is purple.
Attachments
Przechwytywanie.PNG
Przechwytywanie.PNG (92.22 KiB) Viewed 2453 times
lowering.PNG
lowering.PNG (26.9 KiB) Viewed 2453 times
noshadow.PNG
noshadow.PNG (16.29 KiB) Viewed 2453 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2864
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Chill's patchpack v10_7

Post by ChillCore »

Kogut wrote: Sth bad happened with lg (and it is not 1 in 116161616 seeds problem)
It is the combination of 64 * 64 maps, Alpinist, very smooth and very high sea level.
Change any of the four settings and results will be better.
There is some finetuning left to be done in the map generation options. (read: disable certain combinations of settings.)
To reproduce: build airport on side of map, on top of high mountain.

Behaviour of plane in following situation is strange (lowering flight after initial ascending [while flying outside map], touching ground [on map border] and ascending)
Normal behaviour.
Aircraft can not descend while taking off.
When taking off is done aircraft adjusts its altitude to terrain below and continues from there.
Maybe when leaving the map it should take the height of the border tile instead of the (fake) tile below.

To see what terrain looks like outside the map change this line in void_cmd.cpp:

Code: Select all

 static void DrawTile_Void(TileInfo *ti)
 {
-	DrawGroundSprite(SPR_FLAT_BLACKTILES + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
+	DrawGroundSprite(SPR_FLAT_BARE_LAND + SlopeToSpriteOffset(ti->tileh), PAL_NONE);
...
[while flying outside map] - shadow of plane is purple.
As mentioned before this is because you are using the original dos sprites.
Change to the windows ones or use OpenGFX.

As an alternative decompile the grf and recompile with dos sprites.
Code will also have to be modified in gfxinit.cpp because the dos grf will have to change name to be different from my version.(*)
Also the intention is to move the flat_blacktiles.grf into openttd.grf therefore I will not put effort in trying to do so but anybody that wants is free to provide it. I do not have grf wizard available on this pc and on my previous version of Ubuntu it was not working.
I am struggling a bit to find the correct code to insert it in openttd.grf but I hope that once done it will solve the issue as OpenTTD deals with this issue internally IIRC.

(*)
- For as long as I am using the grf I will request removal of any dos version that does not change name !
- I really do not feel like distributing two versions of the patchpack just to compensate for the correct use of the correct grf. Also I am not prepared to deal with the resulting bugreports from using the wrong grf with the wrong version of the patchpack.
- If someone does provide a renamed dos version I will update the first post with the grf and mention the code to be changed there also.
- I hope nobody distributes a modified compiled version of the patchpack then, doing so will cause confusion I am not willing to deal with.
noshadow.png
Is that screenshot taken with modified ascend/descend steepness code? Please mention if it is.
If it is that is a good reason not to change it, in my version it works correctly for as far as I can tell.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Chill's patchpack v10_7

Post by Kogut »

ChillCore wrote:
Kogut wrote: To reproduce: build airport on side of map, on top of high mountain.

Behaviour of plane in following situation is strange (lowering flight after initial ascending [while flying outside map], touching ground [on map border] and ascending)
Normal behaviour.
Aircraft can not descend while taking off.
Problem is not that it descends after ascending, but that it tries to descend, what results in returning from black area at level of land.
ChillCore wrote:
noshadow.png
Is that screenshot taken with modified ascend/descend steepness code? Please mention if it is.
If it is that is a good reason not to change it, in my version it works correctly for as far as I can tell.
All screens are made with selfcompiled r21043 patched with chipp_v10_7_r21043.diff without my modifications (except removing preprocessor definition to disable music). Problems with my own modifications (if ever) goes here: http://www.tt-forums.net/viewtopic.php?f=33&t=49275 .

To double check I will recompile patchpack and post savegame with that problem.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Chill's patchpack v10_7

Post by Kogut »

As I said:
Attachments
reproduced.sav
(83.48 KiB) Downloaded 74 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2864
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Chill's patchpack v10_7

Post by ChillCore »

Kogut wrote:
ChillCore wrote:
Kogut wrote: To reproduce: build airport on side of map, on top of high mountain.

Behaviour of plane in following situation is strange (lowering flight after initial ascending [while flying outside map], touching ground [on map border] and ascending)
Normal behaviour.
Aircraft can not descend while taking off.
Problem is not that it descends after ascending, but that it tries to descend, what results in returning from black area at level of land.
Problem is that it DOES descends after take-off.
You ignored two lines in my reply and a suggestion to be able to see why for yourself?
Kogut wrote:
ChillCore wrote:
Kogut wrote: noshadow.png
Is that screenshot taken with modified ascend/descend steepness code? Please mention if it is.
If it is that is a good reason not to change it, in my version it works correctly for as far as I can tell.
To double check I will recompile patchpack and post savegame with that problem.
I checked your savegame ...
Yes airplanes enter low in the map but that is caused by see above.
Destroy the industrie between the airports and check the shadows again please.
Aircrafts are above terrain.
Also they correct their altitude once they re-entered the map. (Aircraft position on the map is the shadow, not the aircraft sprite itself.)


A possible fix to make them enter with 'normal' offset (which I will try later) is in one of the ignored lines mentioned above and will fix both issues.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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 v10_7

Post by MagicBuzz »

Hello,

Is that possible to make a new diff compatible with the current trunk ?

Actually, there are some new features about newgrf and engines, that break the current diff file.

I tried to resolve the conflicts myself, but on one computer I can't compile anymore, and on the another one, that's quite worse : it compiles but savegames are broken on some brige_tile assertion, and the wxorking savegame just looks strange : my opponents' vehicles come to my stations :??:
User avatar
BR 155
Engineer
Engineer
Posts: 52
Joined: 29 Feb 2008 16:12
Location: Germany

Re: Chill's patchpack v10_7

Post by BR 155 »

MagicBuzz wrote: I tried to resolve the conflicts myself, but on one computer I can't compile anymore, and on the another one, that's quite worse : it compiles but savegames are broken on some brige_tile assertion, and the wxorking savegame just looks strange : my opponents' vehicles come to my stations :??:
Nice, you found a new and working infrastructure-sharing code by accident? That would be amazing :wink: .
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2864
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Chill's patchpack v10_7

Post by ChillCore »

MagicBuzz wrote: Hello,
Is that possible to make a new diff compatible with the current trunk ?
Actually, there are some new features about newgrf and engines, that break the current diff file.
So I have noticed. :)
Please see attachment but read the rest of the post first please.
BR 155 wrote:
MagicBuzz wrote: I tried to resolve the conflicts myself, but on one computer I can't compile anymore, and on the another one, that's quite worse : it compiles but savegames are broken on some brige_tile assertion, and the wxorking savegame just looks strange : my opponents' vehicles come to my stations :??:
Nice, you found a new and working infrastructure-sharing code by accident? That would be amazing :wink: .
IS without IS patch? Cool, well kind off ... :P
Can I please see your diff before you revert your source?



WARNING Please read the entire post carefully ...
Attached patch is pulled from my testfolder and not playtested other than to check some of the changes I have made and backwards savegame compatibility.
Only download if you are willing to accept that:
- This version may contain errors.
- Code will change between this version and v11.
- Savegames made with this version might be lost in the next version.

WIP v10_9_9_3_experimental
=====================
Updated:
-----------
- Departureboardswallclock8b4
- More Height Levels (Experimental aircraft code and no new patch yet -> will be v33 when tested more.)
- CargoDist_r21077
- Station-build-gui_v7 (By sbr) (Waypoint window also resizable now.)

Added:
--------
- Departure_vehicletimetableskip1 (By hthhs)
- Option to select treeline ingame in Advanced Settings -> Construction (Independant from mapgeneration.) (NekoMaster) (*)

Fixed:
--------
- Partial fix for copypaste preview. Rails now show again.
- Do the same fix for treeline as was done for snowline in r21078
- Aircraft entering the map at too low altitude (Kogut) (**)

New files in the widgets folder: (station/waypoint build gui)
--------------------------------------
- station_type_matrix.cpp
- station_type_matrix.h

Notes:
--------
(*) Sometimes when selecting the treeline on new game generation the up arrow does not change its enabled/disabled state. Changing climate and switching back (forcing a gui redraw) will update its status. Obviously this is something that remains to be dealt with.
(**) I Have not yet checked the disaster vehicles.

More important notes:
-----------------------------
- The next version will be v11 and should be savegame compatible with this version but this is not guaranteed.
- May I strongly suggest to make a backup of your savegame or install this version as a seperate install untill I am sure that it will remain compatible. (Even I do not overwrite my savegame with this version!)
- Please do not post a pre-compiled binary of this version as minor changes to the code still have to, and will, be made before posting v11. Let's not cause trouble for people not able to compile themselves ... ;)

Keeping savegame compatibility for players that have added the cd_no_overload_patch before:
-----------------------------------------------------------------------------------------------------------------
- Apply the new version of the patchpack.
- Re-apply the no_overload_patch (while changing SL_MCF -> SL_MCF_TOO as before in the code)
- In saveload.h put SL_MCF_TOO in the same location as before but this time also increase all enumerations after that by 1)
-- If something goes wrong with your savegame I will not be able to debug it for you.
-- Ofcourse if your bugreport is clear enough and not related to the no_overload patch, I might be able to reproduce it and continue from there to fix it.

Edit: Fixed reporter of broken treeline after loading scenario made with vanilla openttd.
Attachments
chipp_v10_9_9_3_experimental_r21125.diff
(1.2 MiB) Downloaded 92 times
Last edited by ChillCore on 22 Nov 2010 02:19, 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.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Chill's patchpack v10_7

Post by MagicBuzz »

ChillCore wrote: IS without IS patch? Cool, well kind off ... :P
Can I please see your diff before you revert your source?
In fact, there is not "really" the opponent vehicles. But all my vehicles are repainted with opponent's color. When I tried to change my own color, my vehicles remained at the opponent's color.

That looked strange. This plus the savegame compatibility problems with my compile, I didn't try deeper to find out what was the problems.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2864
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Chill's patchpack v10_7

Post by ChillCore »

MagicBuzz wrote:
ChillCore wrote: IS without IS patch? Cool, well kind off ... :P
Can I please see your diff before you revert your source?
In fact, there is not "really" the opponent vehicles. But all my vehicles are repainted with opponent's color. When I tried to change my own color, my vehicles remained at the opponent's color.

That looked strange. This plus the savegame compatibility problems with my compile, I didn't try deeper to find out what was the problems.
That is strange indeed.
Please let me know if you can reproduce this with my bumped version.


About savegamecompatibilty in your version:

Code: Select all

r21123: terkhen 	-Codechange: Remove max_speed from the Vehicle class. 
Search the patchfile or vehicle_sl.cpp after applying the patch for "KEEP_COMPATIBLE_9_SV".
I still have to check if my current version of the patchpack will load a savegame made with clean r21123. (@see notice in my previous post about savegame compatibility with v11.)


Also, I have fixed the button status not being udated mentioned in my previous post.
In genworld_gui.cpp, add line 726:

Code: Select all

			case GLAND_TREE_LEVEL_DOWN:
			case GLAND_TREE_LEVEL_UP: // Tree line buttons
				/* Don't allow too fast scrolling */
				if ((this->flags4 & WF_TIMEOUT_MASK) <= WF_TIMEOUT_TRIGGER) {
					this->HandleButtonClick(widget);
					this->SetDirty();

					_settings_newgame.game_creation.tree_line_height = Clamp( ...cut... );
+					this->InvalidateData();
				}
				_left_button_clicked = false;
				break;

IIRC I did not change anything there recently so the bugsie must have been there in previous versions also and remained unnoticed ...
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.
hthhs
Engineer
Engineer
Posts: 107
Joined: 03 Sep 2010 12:58
Location: London, UK

Re: Chill's patchpack v10_7

Post by hthhs »

ChillCore wrote: Keeping savegame compatibility for players that have added the cd_no_overload_patch before:
-----------------------------------------------------------------------------------------------------------------
- Apply the new version of the patchpack.
- Re-apply the no_overload_patch (while changing SL_MCF -> SL_MCF_TOO as before in the code)
- In saveload.h put SL_MCF_TOO in the same location as before but this time also increase all enumerations after that by 1)
-- If something goes wrong with your savegame I will not be able to debug it for you.
-- Ofcourse if your bugreport is clear enough and not related to the no_overload patch, I might be able to reproduce it and continue from there to fix it.
Hi Chill,

Attached is an improved version of the no overload patch with the steps you describe already applied.
cd-no_overload-chipp_v10_9_9_3-6.diff
(6.8 KiB) Downloaded 82 times
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Chill's patchpack v10_7

Post by MagicBuzz »

Hey :)

Take a look at the FS#4214

I designed a small patch to use natural sort algo when sorting several GUI lists such as vehicle groups.

I hope it will be integrated into trunk soon, but it may find a place in this package first ;)
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2864
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Chill's patchpack v10_7

Post by ChillCore »

hthhs wrote: Hi Chill,

Attached is an improved version of the no overload patch with the steps you describe already applied.
On behalf of the people using the patch, thank you.
Would you mind sharing how it is different from the previous version. (I have not yet compared the code with the previous version.)
MagicBuZZ wrote: Hey :)

Take a look at the FS#4214
I designed a small patch to use natural sort algo when sorting several GUI lists such as vehicle groups.
I hope it will be integrated into trunk soon, but it may find a place in this package first ;)
Seems like a very useful patch.

I am not going to pretend that I understand the magic in the code and I should most likely be posting this on FS but here are a few tips to improve your patch.
- Why not put "strnatcmp()" in the same file as "strcmp()", wherever that may be, that way you do not have to add #include "strnatcmp.h" in those files, but only replace strcmp() where appropriate.
- Source files in OpenTTD do/should not have a new line at the end.
- When adding new files to the source, source.list must als be modified where appropriate. In this case I think the new files (if really needed) should be in the core folder. You may also want to modify the files in the projects folder but this is not needed perse. (@see line 30282 and folowing in my experimental posted patchpack.)


As for adding it to the patchpack I do not see a problem if Devs implement it otherwise (read: in the correct location), or beat me to it, as no savegamecode is altered.
Will be in v11 but I'll hold out a bit to put in in so you can make a few modifications before, if you would like to do so. I have some more things to check anyway ...
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.
hthhs
Engineer
Engineer
Posts: 107
Joined: 03 Sep 2010 12:58
Location: London, UK

Re: Chill's patchpack v10_7

Post by hthhs »

ChillCore wrote: On behalf of the people using the patch, thank you.
Would you mind sharing how it is different from the previous version. (I have not yet compared the code with the previous version.)
- The code that removed passengers going via INVALID_STATION (i.e. the ones going via anywhere) has been removed - testing showed that it wasn't necessary.
- The patch no longer inadvertently disables the second pass of the MCF solver. :oops:
- Minor things (indentation and comments) that don't affect the operation of the patch.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Chill's patchpack v10_7

Post by MagicBuzz »

I'll try to find out how works the ICU library in order to make my patch "locale compliant". But I can't promise anything, I'm really underskilled in C++ and it looks like quite complex to use.

But for v11 or your patchpack, I'll merge strcmp file and strnat file, it's a good idea.

Edit : Where is strcmp() defined ? I found it in string.h, but it's not part of the OTTD source, but Visual Studio standard includes (??)
User avatar
ColdIce
Transport Coordinator
Transport Coordinator
Posts: 314
Joined: 25 Apr 2006 10:22
Location: Bucharest

Re: Chill's patchpack v10_7

Post by ColdIce »

1. what is the no overload patch? :|
2. this was compatible with my savegame from previous build
3. build log http://www.heypasteit.com/clip/P6T
4. Thank you ChillCore for this patchpack :bow:
5. removed win32 build at Chillcore request
Last edited by ColdIce on 11 Nov 2010 16:59, edited 1 time in total.
The rest is confetti!
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Chill's patchpack v10_7

Post by Kogut »

ColdIce wrote:3. build log http://www.heypasteit.com/clip/P6T
<grumbling>It may be better to attach it as txt, not post on site with "you won an Ipod!" ads</grumbling>
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
ColdIce
Transport Coordinator
Transport Coordinator
Posts: 314
Joined: 25 Apr 2006 10:22
Location: Bucharest

Re: Chill's patchpack v10_7

Post by ColdIce »

one tiny little huge problem:

in game newgrf window doesnt show the .grf list. I can`t add or remove newgrfs.

@Kogut: it's just a banner! a small one. you can block it with adblock if you are using mozilla. the build log is for ChillCore and he didn`t complained before.
Attachments
Untitled.png
Untitled.png (165.98 KiB) Viewed 1238 times
The rest is confetti!
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Chill's patchpack v10_7

Post by Kogut »

ColdIce wrote:one tiny little huge problem:
in game newgrf window doesnt show the .grf list. I can`t add or remove newgrfs.
(svn r21111) -Add: Remove the buttons below the newgrf details if the list is not editable. (?)
In t21134 it is impossible to change newgrfs ingame, it can be activated via openttd.cfg [newgrf_developer_tools]
Last edited by Kogut on 11 Nov 2010 14:17, edited 1 time in total.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
Dwight_K._Schrute
Traffic Manager
Traffic Manager
Posts: 209
Joined: 01 Sep 2010 11:29

Re: Chill's patchpack v10_7

Post by Dwight_K._Schrute »

ChillCore wrote: More important notes:
-----------------------------
...
- Please do not post a pre-compiled binary of this version as minor changes to the code still have to, and will, be made before posting v11. Let's not cause trouble for people not able to compile themselves ... ;)
ColdIce wrote:...
5. enjoy the win32 build guys!
:mrgreen:
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 5 guests