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
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:
May it be altered in scenario editor, or should altering it be forbidden there as well?
But I have to ask one meta-question: Do I use the right communication channel? You, ChillCore, seem to be much better informed than I...
If something can be changed in the SE on a general level, it should be allowed to set that value also upon new game create. Still, the SE allows players to arbitrarily assign desert or grass to any tile manually, unharmed by any height restriction; thus that doesn't need any representation anywhere else.

Wrt communication channel, this is certainly the right channel. As is IRC. Personally I consider them complementary. Sometimes, when people are around and not just idling, IRC has an advantage as it allows quicker or easier to understand another person and really discuss with the benefit that easily several people can just drop in and add a thought or two. On the other hand a forum posting allows to better summarize or elaborate an issue with a bit more thought and allows more to work in ones own time.
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: More height levels

Post by ic111 »

planetmaker wrote:
ic111 wrote:
May it be altered in scenario editor, or should altering it be forbidden there as well?
But I have to ask one meta-question: Do I use the right communication channel? You, ChillCore, seem to be much better informed than I...
If something can be changed in the SE on a general level, it should be allowed to set that value also upon new game create. Still, the SE allows players to arbitrarily assign desert or grass to any tile manually, unharmed by any height restriction; thus that doesn't need any representation anywhere else.
So you say it´s not necessary, do you? Ok, I think you are right, even if I load a heightmap into scenario editor, I can save it as a scenario afterwards and can then set a max. heightlevel above tops of the mountains (which I could not do when starting a game directly from a heightmap, because there, the max. heightlevel automatically determines the height of the mountains).
Wrt communication channel, this is certainly the right channel. As is IRC. Personally I consider them complementary. Sometimes, when people are around and not just idling, IRC has an advantage as it allows quicker or easier to understand another person and really discuss with the benefit that easily several people can just drop in and add a thought or two. On the other hand a forum posting allows to better summarize or elaborate an issue with a bit more thought and allows more to work in ones own time.
Ok, up to now I didn´t use IRC; perhaps I should do...

I just at some occasions had the feeling that people discuss things e.g. in IRC, have a common understanding of the issue, and then the issue comes to me in a state where it´s already discussed...
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2822
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: More height levels

Post by ChillCore »

ic111 wrote: But I have to ask one meta-question: Do I use the right communication channel? You, ChillCore, seem to be much better informed than I...
Blame that on my bugpack. ;)
While doing that I had to look at many different part of the code.
Also I received an enourmous amount of feedback in the form of players having trouble (bugreports) and other patchwriters pointing me at errors that I made and/or providing fixed patches (or even fixing merging errors I made).
Devs also jumped in from time to time to stop me from doing stupid things or pointing me in the right direction when I was stuck.


There is no secret platform 9¾ and if there was I would not know about it as I am no wizard.
I just (re-)read a lot, fooling myself that in the end I will know what the hell I am doing sometimes. :mrgreen:
Ok, up to now I didn´t use IRC; perhaps I should do...

I just at some occasions had the feeling that people discuss things e.g. in IRC, have a common understanding of the issue, and then the issue comes to me in a state where it´s already discussed...
No offence, but most of what I said yesterday ... was already available in this thread in some form.
I just jumped on IRC to get some quick feedback on the suggestions I made (to avoid double work), which I then posted.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: More height levels

Post by frosch »

Wrt. changing the maximum height in game. I guess you can allow changing the setting, if
  • it is not allowed to set it to a lower value than present on the map,
  • reload the NewGRFs when changing the setting, i.e. call ReloadNewGRFData(),
  • disallow changing it in multiplayer games (guiflags = SGF_NO_NETWORK)
The second item implies the third.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: More height levels

Post by ic111 »

frosch wrote:Wrt. changing the maximum height in game. I guess you can allow changing the setting, if
  • it is not allowed to set it to a lower value than present on the map,
Already implemented anyway.
[*] reload the NewGRFs when changing the setting, i.e. call ReloadNewGRFData(),
[*] disallow changing it in multiplayer games (guiflags = SGF_NO_NETWORK)[/list]
The second item implies the third.
Simple to implement.

ReloadNewGRFData reloads all GRFs I assume. Thus one looses things like reliabilities of vehicles I assume. Am I right concerning this?

Thus I think I will add it to the cheat window.
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: More height levels

Post by ic111 »

The next version. I added the max. heightlevel setting to gameopt_settings.ini (could someone verify wether I did it correctly?), added initialization for old savegames in afterload.cpp, reduced the 240_DesertHeight patch to simply using a hardcoded max_heightlevel / 4 value, adjusted the ordering of the gui elements in both the newgame and the heightmap generation dialog to bring the random seed line and the random seed button into the same line again.

Furthermore, I made the max. heightlevel setting NEWGAME_ONLY, and added a new patch 157 that introduces a cheat for this. Known bug with this cheat: I did not manage to implement a query window for entering the new value, seems that OnQueryTextFinished doesn´t check the cheat since up to now only one cheat (date) allowed entering a value. And I did not manage to adjust OnQueryTextFinished properly. (the code for opening a query window is in the patch, but outcommented for now).
Attachments
mhl_v22.zip
(74.44 KiB) Downloaded 138 times
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: More height levels

Post by ic111 »

I adjusted version 22 to the changes in trunk of the last months, here is version 23.

Feel free to test :-)
Attachments
mhl_v23.zip
Version 23 of the more heightlevels patch.
(83.92 KiB) Downloaded 152 times
AMHL
Engineer
Engineer
Posts: 4
Joined: 17 Apr 2012 22:48
Location: Russia, Rostov-on-Don

Re: More height levels

Post by AMHL »

Thanks a lot for this patch!

I used to play the precompiled versions of openttd from this thread, but they had some cheat-like bugs (like converting water tiles into ground ones while hight changing even without sufficient funds) and some problems with tunnel entrances. So now I`d like to play pure OpenTTD + Version 23 of the more heightlevels patch.

Might I hope for some ready to use version for Windows?

If no I can try to build it myself. Would I succeed with MSVS 2008 + msysgit ( http://code.google.com/p/msysgit/downloads/list )? Which nightly is mostly compatible with this version of the great patch?
AMHL=Admire MoreHightLevels
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: More height levels

Post by ic111 »

Well, I can´t help you much with this.

Conceptionally, you have to check out the source code and apply the patch. The patch is tested with the revision number of trunk at the date when I published the version. It is possible that newer changes in trunk cause compiler errors, probably I will publish an update (if necessary) in the not too far future (maybe some weeks).

A ready to use version for Windows will not be published by me, thus the answer to that question tends to be no. Except someone else does the job (or there is progress regarding inclusion into trunk).

Regarding MSVS 2008 and msysgit I can´t help since I never used any of the two.
AMHL
Engineer
Engineer
Posts: 4
Joined: 17 Apr 2012 22:48
Location: Russia, Rostov-on-Don

Re: More height levels

Post by AMHL »

ic111, thanks for your reply.

Is it possible to build trunk + morehightlevels patch for Windows in Linux? I could install some Linux distribution kit (by the way, which do you recommend?) in a virtual machine. If yes would it be easier?
AMHL=Admire MoreHightLevels
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: More height levels

Post by Terkhen »

To my knowledge it should be possible to cross compile OpenTTD from Linux to Windows. I'm not aware of any updated documentation or tutorial to do so, though. If you have Windows it will be probably be simpler for you to follow one of the Windows compiling tutorials (MinGW or MSVC).
AMHL
Engineer
Engineer
Posts: 4
Joined: 17 Apr 2012 22:48
Location: Russia, Rostov-on-Don

Re: More height levels

Post by AMHL »

If you have Windows it will be probably be simpler for you to follow one of the Windows compiling tutorials (MinGW or MSVC).
I need git to apply this patch. As far as I understood none of these tutorials contain any advice how to add a git-based patch.

I wish I were wrong.
AMHL=Admire MoreHightLevels
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: More height levels

Post by Alberth »

AMHL wrote:I need git to apply this patch. As far as I understood none of these tutorials contain any advice how to add a git-based patch.
No you don't.
For simple patches (just adding/removing lines), manually removing "a/" and "b/" before applying is sufficient.

Alternatively, the native 'patch' command as well as mercurial understand git-patches. Not sure about the former with binary files however.


The reason it is not in the tutorials, is because nobody has bothered to add that information.
User avatar
pavel1269
Route Supervisor
Route Supervisor
Posts: 473
Joined: 03 Dec 2006 13:22
Location: Czech Republic
Contact:

Re: More height levels

Post by pavel1269 »

While patching, you (or, at least me) always use command "-p0". With this like patches, just use "-p1".
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: More height levels

Post by Terkhen »

The tutorials are for compiling, not for patching. Both are different things. There is a thread that explains how to patch in this very subforum. You can apply git patches in MinGW with just running the following command at the root of your OpenTTD checkout:

Code: Select all

patch -p1 -i <patch_file.diff>
In short: you don't need git to apply a git style patch.
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: More height levels

Post by ic111 »

Version 24.

Only two minor adjustments due to two rejects regarding the savegame version and the sprite number.
Attachments
mhl_v24.zip
(65.13 KiB) Downloaded 152 times
AMHL
Engineer
Engineer
Posts: 4
Joined: 17 Apr 2012 22:48
Location: Russia, Rostov-on-Don

Re: More height levels

Post by AMHL »

I think i could build it! :D
At least i'm playing clean OTTD 1.2.0 with the More Hight Levels patch.
Thanks for help and updated manual. :bow:

I didn't know if i should have included GRFs, so i didn't. Tested on Windows 7 64-bit.
Attachments
mhl_v24_wi32.zip
(5.65 MiB) Downloaded 122 times
AMHL=Admire MoreHightLevels
User avatar
Ben_Robbins_
Tycoon
Tycoon
Posts: 1234
Joined: 20 Nov 2005 01:56
Location: Abu Dhabi, UAE

Re: More height levels

Post by Ben_Robbins_ »

I'm surprised how quiet this topic is. Thanks for all the great work done here, and thanks for that build AMHL. This patch is one of the last great hurdles for OTTD I think, and to be able to see this one through to trunk would be awesome. The inclusion of the snow tipped peaks once developed, or the multi scenario patch, would be complimentary leaps forward also. I play more than 1/2 my OTTD games with this height level patch, and it confronts many issues such as complacency as your profits rise, as your forced to still consider ways round hills, rather than straight flattening them. It's no-longer just a hill, it's a true mountain.

One point that is maybe worth discussing is the map image. When playing a level where the highest hill is 200+ then the colours in there are perfect, however if I play a game with 50max, then the hills are tricky to see on the map. Is it a plausible option to have the colour bands change at rounded percentage points rather than fixed heights. So a tile at 50 high where the max in-level is 100 can be seen as 50% and therefore the mid-colour, rather than 20%~ as it is to 255.

This is standard practice in cartography, where a map of Mt. Kenya will have 50m contour line difference, where as a same scale map of the UK (1:50k) would be 10m, at 5 times the detail. Mt Kenya compared to the highest UK mountain is then 5199m:1344m or very roughly 5-1.2 which is reflected in the maps produced. However where as in cartography it's an easy change, maybe here this is asking a lot to look at?

Success with this patch may spawn the need for other tweaks also, which I don't know if are a pre-requisite of trunk inclusion. But an example is in the scenario editor where there can be a lot of clicking, where x10 options would be one possible solution. Another would be a need for the scenario generator at game start to have an option of not just max potential height, but how many peaks within the top band of about 5%. This would ensure that the need for variety doesn't overwhelm and hinder the space required to have a range build up and reach the high peaks. Likewise there is local variation, or local prominence which is a consideration. A level could appear almost like a traditional OTTD level with regular height hills, but as though a large balloon has inflated underneath. This then means the hills are high, but locally don't appear so. The other extreme is then having peaks of near max height dropping into local values of near minimal height. I find currently most maps generated use the extra height levels well, but not always to the fullest potential. Finally an option to build a scenario based on a basic one will also start to become more needed. To elaborate: to sculp a huge mountain, and to have the flanks of it not simple as large smooth faces, but rather having bumpiness and foothills requires huge amounts of clicking. So to build a scenario automatically based around a skeleton, or like in the aforementioned inflating balloon example, would allow nice scenarios more easily. An example of this repetitive clicking strain was in this scenario I made some time ago: http://www.tt-forums.net/download/file.php?id=144154

All just considerations, which maybe beyond the scope of this patch specifically, but I think effect, or get effected by this patch more broadly. I raise some points as they may be seen as making the scenario automatic creation method as insufficient once this patch is included, where as currently it may not be seen as so.

Thanks again, and really keep up this great work, and hopefully see it through!
Ben
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: More height levels

Post by Eddi »

i don't quite get how you can judge 45 pages of discussion as "quiet". also, it is quite natural that once a patch reaches a certain level of maturity, the user-discussion (which is mostly feature requests) calms down, while the developer-discussion may be run through other channels than this forum.
User avatar
Ben_Robbins_
Tycoon
Tycoon
Posts: 1234
Joined: 20 Nov 2005 01:56
Location: Abu Dhabi, UAE

Re: More height levels

Post by Ben_Robbins_ »

Nothing nicer than being reminded of the glowing hospitality of a socially reclusive introvert, with such perfectly flawed logic. You measure the current by stating the past, you then state the obvious, before finishing on a blessing of other methods of communication, which are in no way held back by the activities in one another, nor in anyway justify need for a lack of activity in one another for there benefit. If you have nothing seemingly progressive to say, please just refrain from saying it, and let others, who can positively take from it, do so.

I see no reason not to support and discuss a great patch, and I shall take this opportunity again to do so.
Ben
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 27 guests