More height levels (in trunk since r27010)

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: 2852
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: More height levels

Post by ChillCore »

Oh nooos, quadruple post !

Please find attached the new version of the patch.

Changed:

- Bumpedybump to trunk.

- Coding style. Updated the comments and moved some declarations to .h files.

- You can now choose how high a heightmap is generated.
Unlike the previous patch I have posted that had this feature the setting is shared with the difficulty settings so changing it will give a warning that the difficulty settings have changed.
When the patch is enabled and you want the standard (15 high) behaviour you should select flat. Else very flat is 3 and Alpinist is 255 (if mapsize and heightmap allows).
Also I did not rearrange the load_heightmap_gui this time other then inserting the dropdown and a few spacers to keep the seed box alligned with its random button.(I did not want to change too much at once.)

Todo:
- Remove the "// heightmap height" comments in genworld_gui.cpp , they are there to remind me to change them also when I will be re-arranging the gui. (if needed)
- Check for the "clear land" error when not having sufficient funds.
- Make may way through the TILE_SIZE occurances in viewport.cpp so I can declare TILE_SIZE as uint in tile_type.h as it should without the game crashing.
- Everything else marked as todo in the patch.
- Reminder to self: Do not forget the warning when resizing the heightmap too much.

ps:
For he who feels like tuning the array to select heightmap height: Look in heightmap.h.

Edit:
Order of words corrected I have ;)
Also tile_type.h != tile_map.h.
Attachments
moreheightlevels_v27_r19992.diff
(254.41 KiB) Downloaded 63 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.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2852
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: More height levels

Post by ChillCore »

And one more bug bites the dust.

- Max generated height is not respected when using the original land generator.
This seems to happen if you have selected mountainous or alpinist while switching from terragenesis.
Fixed:
When selecting the original terraingenerator and mountainous or alpinist was selected, revert to hilly.
When original terraingenerator is selected and player selects mountainous or alpinist, revert selection to hilly.
(I would rather have the two options greyed out but I haven't figured out where to do that yet ...)

- Done:
Make may way through the TILE_SIZE occurances in viewport.cpp
so I can declare TILE_SIZE as uint in tile_type.h as it should without the game crashing.

Changed:
-More codingstyle.
-Fixed a few incorect comments.

Logfile attached:
-Updated known bugs.
-Updated todo.
-Extended tuning yourself section.
Attachments
moreheightlevels_v27_4_r20026.diff
(257.28 KiB) Downloaded 50 times
more_heights_log_v27_r20026.txt
(62.96 KiB) Downloaded 73 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.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: More height levels

Post by Kogut »

petert wrote:Here is an updated build with the updated small map works:
Is it possible to get new build?
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2852
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: More height levels

Post by ChillCore »

Here's a small update to current trunk.

Most notable changes:
- Solved a few conflicts. (Bumping to trunk and adapting to changes from r20183 to r20192)
- #include "slope_func.h" in dummy_land.cpp and renamed function for drawing tiles outside the map. (@see r20187)
- Added two more todos in terraform_cmd.cpp (Mark functions for removal when the patch is finished.)
- Minor coding style changes.

All in all not very much changed but trunk has changed a lot lately which prevents the previous patch to be applied to current trunk.
Attachments
moreheightlevels_v27_5_r20202.diff
(257.52 KiB) Downloaded 52 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.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: More height levels

Post by Kogut »

Thanks! Now, with my new ability (openttd compiling) I finally will play game with that patch!
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Re: More height levels

Post by Moriarty »

It's good to see you're still working on this Chill (thanks, even though I've never used the patch - lack of compiled for-win version). I don't suppose there's any remote possiblity of it being included in trunk some day? I think more vertical flexibility is important to the game's future.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2852
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: More height levels

Post by ChillCore »

Moriarty wrote: It's good to see you're still working on this Chill (thanks, even though I've never used the patch - lack of compiled for-win version).
As long as I am having fun while doing so I will continue.
The patch is also included in my patch pack. Which I have made to test this patch to the bone.
Check the second post in my thread for a link to the latest compiled win binary. I have just released v8 so you may want to wait a bit to see if someone feels like posting the new version. v7 is pretty stable too but you may want to read the first posts and the last few pages for known bugs. (Or read the whole topic while you are there?)
I don't suppose there's any remote possiblity of it being included in trunk some day?
Yes there is. Read: No dev has said that they do not want it.
Ofcourse for this ever to be considered all issues have to be resolved first. (See the logfile a few post back: Known bugs and Todo sections.)
Once I/we have done that we need to find a way to break it up in smaller pieces (easier for review) and hope for the best.
I have been thinking to try and propose small changes to trunk to ease the process but I did not get to that yet.
Also I still prefer to not know for the moment. ;)
I think more vertical flexibility is important to the game's future.
I agree although I think OpenTTD will survive just fine without this patch also :)


Thank you for the moral support.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.
Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Re: More height levels

Post by Moriarty »

Hey, thanks for pointing me at the patch-pack, I've never really bothered with those things in the past, but this one seems to work passably well. ;-)

A "bug" for you relating to your heights from it - when selecting the "snow line", there are only 13 levels to choose from. Shouldn't there be 255? There are for tree-line height.
Last edited by Moriarty on 29 Jul 2010 18:21, edited 1 time in total.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: More height levels

Post by Kogut »

13 level bug: Known and reported
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2852
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: More height levels

Post by ChillCore »

Moriarty wrote: Shouldn't default snowline height be 255?
No because trees are placed from level 0 up to treeline height (only in the patchpack) as opposed to snow which is placed from level 255 down to snowline height.
If I would put it at 255 there would be no snow at all. Also max snowline height is 253.

Until I have figured out where to correct the limitation you can set the desired values in the scenario editor.

If somebody knows what to change to fix it, feel free to share. :)
I know (read: I think/guess/assume) it is some lettercode in table/settings.h (see line 208 and following) but that is about it for now.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: More height levels

Post by Alberth »

ChillCore wrote:
Moriarty wrote: Shouldn't default snowline height be 255?
No because trees are placed from level 0 up to treeline height (only in the patchpack) as opposed to snow which is placed from level 255 down to snowline height.
If I would put it at 255 there would be no snow at all. Also max snowline height is 253.
FYI: Having just coded snowlines in NML, I happen to know that the NFO specification states that the snowline lies between 0x10 and 0xef, where values should be multiples of 8 to prevent glitches. In other words, between 2*8 and 29*8 (0xe8) in steps of 8.
Anything else is going to break snowlines of NewGRFs.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2852
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: More height levels

Post by ChillCore »

Thank you for the heads up Alberth.
I did not know that although I had noticed that in the configuration file the snowline height is specified in pixels.

ps:
I have tried to compile a grf using NML some time ago but failed ...
I will be trying that again sometime soon as I noticed many changes have been made lately.
It looks very interesting and much easier to understand then nfo coding.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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

Re: More height levels

Post by ChillCore »

Please find attached a small update to trunk.
A few conflicts with trunk are solved but there are no functional changes for the moment.

I have been looking some more at the missing levelling error message and clearing tiles bug. I am getting closer at solving it but I am not there quite yet. (Just to be clear, the attached patch includes no changes in that area for the moment.)
Attachments
moreheightlevels_v27_10_r20612.diff
(257.03 KiB) Downloaded 50 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.
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: More height levels

Post by ic111 »

Hello,

I have just downloaded the patch again. Works quite well for me now, I was able to play for a longer time (although I used only road vehicles and trains).

First of all: I might have time for inspecting some bugs in the future. What are remaining bugs that need a closer look?

Second: The only bug from a player perspective I found in the current version is that on all steep land tiles at height zero with direction north, a mouse pointer is displayed. Sounds odd, have a look at the attached screenshot. If I terraform such a tile, it disappears, if the result of terraforming is such a steep tile, then for the moment it is displayed without that mouse pointer, but if I scroll it again shows up. Also, this display error survives a save/load cycle, so my first idea is that some code running periodically might corrupt the data of such tiles - although for the moment I have no clue what code this might be...

I am pretty sure that this bug wasn't there when I played the patch last time about half a year ago. Can you reproduce it? If yes, do you know since which version it is there? Or has someone already started inspecting it?
Attachments
Island Railways, 11. Feb 1925.png
Island Railways, 11. Feb 1925.png (92.43 KiB) Viewed 1957 times
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2852
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: More height levels

Post by ChillCore »

Hello ic111,
ic111 wrote: I have just downloaded the patch again. Works quite well for me now, I was able to play for a longer time (although I used only road vehicles and trains).
Cool. I have included the patch in my patchpack and there are few additional bugs that have show up recently. (see GRF_bugs at the end of attached bug txt)
First of all: I might have time for inspecting some bugs in the future. What are remaining bugs that need a closer look?
I have attached a short bug list(it contains also a longer version at the bottom of the file) and the latest version updated to trunk.
Second: The only bug from a player perspective I found in the current version is that on all steep land tiles at height zero with direction north, a mouse pointer is displayed. Sounds odd, have a look at the attached screenshot. If I terraform such a tile, it disappears, if the result of terraforming is such a steep tile, then for the moment it is displayed without that mouse pointer, but if I scroll it again shows up. Also, this display error survives a save/load cycle, so my first idea is that some code running periodically might corrupt the data of such tiles - although for the moment I have no clue what code this might be...

I am pretty sure that this bug wasn't there when I played the patch last time about half a year ago. Can you reproduce it? If yes, do you know since which version it is there? Or has someone already started inspecting it?
I can not reproduce it.
I was going to say update to the latest version of OpenGFX but your screenshot shows the original graphics ...
Can I have a look at your savegame please? Maybe it is caused by some grf that is corrupt?
Attachments
v27_bugs.txt
(9.16 KiB) Downloaded 87 times
moreheightlevels_v27_10_r20689.diff
(257.84 KiB) Downloaded 54 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.
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: More height levels

Post by ic111 »

See attached savegame.

Cool, this means that only a quite low number of bugs remain to be fixed, right? So, in the not too far future one might think about splitting the patch up into smaller parts for applying them to trunk.
Attachments
Island Railways, 10. Feb 1925.sav
Mouse pointer glitch at steep tiles of height zero and with direction north
(302.55 KiB) Downloaded 53 times
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2852
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: More height levels

Post by ChillCore »

Thank you for the savegame but I still can not reproduce it.
I will try recompiling the version against r20612 to see if the problem shows up in there.

As you can see in the attached screenshot I am still missing some GRFs although I have replacements for all missing ones.
What version of the ottdc_pack are you using so I can find the correct ones?

Also, on a side note,
Narrow gauge should be after TTRS.
Expensive short and slow bridges is not designed to work with pb_viaduct.grf.
DB Set is disabled. (Don't know why as it is not mentioned.)

[quote=""ic111"]
Cool, this means that only a quite low number of bugs remain to be fixed, right? So, in the not too far future one might think about splitting the patch up into smaller parts for applying them to trunk.
[/quote]
Yep, only a few remain for as far as I know.
I could use some help in smallmap_gui.cpp and terraform_cmd.cpp as I tried to fix them a few times already but I failed on each occasion.
For the code in tgp.cpp (heightmapvariation) I have not yet really tried ...

ps:
The logfile a few posts back is somewhat more complete then the bugs.txt I posted in regards of TODOs but not much. Most can be found by searching for them in the patch.
Attachments
Island Railways, 22nd Apr 1925.png
Island Railways, 22nd Apr 1925.png (4.03 KiB) Viewed 1915 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.
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: More height levels

Post by ic111 »

I think the problem are the narrow gauge rails. When I removed them (and let all other grfs as they are), the problem disappears. However, putting them at the very end, after TTRS as you proposed didn't help.

Hence, I don't think this is a problem of the patch, rather one of that grf. So let's ignore it with respect to the patch.

BTW, what is ottdc_pack?
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: More height levels

Post by planetmaker »

ic111 wrote:BTW, what is ottdc_pack?
http://wiki.openttdcoop.org/GRF
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2852
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: More height levels

Post by ChillCore »

My bad that would be ottdc_grfpack. The package that the coop guys use.

I just find it strange that I do not see the same problem overhere ... it does not matter if I activate the dos or the windows version. (I noticed that your palettes are set to dos ...).
The Narrow gauge version I have is v0.93a. The suggestion to put it after TTRS comes from the GRF itself. Open the grf list ingame, select it and see the NewGRF information part of the gui ...

Anyway it is good to see the problem is solved (partially) and does not come from the patch.


Edit: planetmaker is fast ...
Attachments
Island Railways, 8th Sep 1925.png
Island Railways, 8th Sep 1925.png (3.76 KiB) Viewed 1889 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.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 12 guests