Patch: Raising max. height to 127

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

Post Reply
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Patch: Raising max. height to 127

Post by Bilbo »

So, to complement http://www.tt-forums.net/viewtopic.php?f=33&t=33208 with some sort of patch ....

I have written patch that will allow heights from 0-127 instead od 0-15. (with possible future extension to -128 .. 127 for sea depth patch)

So I split type_height in _m to _m.type and _me.height. This increase memory usage for map by 11%, but seem to work.
First sort of preview, loading works, saving works too, but the high hills gets broken in savegames. High terrain technically work, but there is heap of bugs and glitches, so lot of work need to be done to bring this to usable state.

Known bugs/issues:
* tiles with height>15 are screwed when saving
* terraforming uphill get very slow once you start raising "too large peak" (like to raise 30 high peak to 31 height). Seems the terraformer is recursive (and ridiculously slow for large peaks). There were some recursion limits which I don't know how they were computed. I guessed how much larger they need to be for 127 height. Seem to work somewhat, but maybe it is still too small or large
* many graphical glitches with tiles of height over 15 (I have no idea why).
* parts of gui and config system still think 15 is maximum height
* Very high hills show with same colors on minimap -> all colors over height 27 are the same, somebody need to invent what colors to use ...
* Planes fly too low
* Land generation (terragenesis) won't use any values >15

What works:
Tiles can actually be between 0-127 and behave well for road vehicles and trians.
Loading savegames work (Saving is still buggy)

Seems that it will be more difficult than previously anticipated, so any help (fixing any of that bugs or finding yet unknown bugs is welcome :)
Attachments
level-127-10644.patch
First alpha version
(14.17 KiB) Downloaded 349 times
level-127-10648.patch
Second alpha version
(17.56 KiB) Downloaded 281 times
level-127-10692.patch
3rd alpha version
(14.18 KiB) Downloaded 427 times
Last edited by Bilbo on 26 Jul 2007 03:15, edited 3 times in total.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
thgergo
Route Supervisor
Route Supervisor
Posts: 391
Joined: 29 Mar 2005 12:44
Location: Hungary

Re: Patch: Raising max. height to 127

Post by thgergo »

I have tried this patch, keep up good work Bilbo! :bow:
Works good up to 20-24 height levels , if you doesnt use any very tall buildings on the mountain tops. After thsoe period of height levels, I have got massive glitches, even on the ground :) I have raised the height again, the glitches became even more wierd(maybe after height level32?), the z-coordinates of the tiles are calculated again from zero. And the planes are funny too, they float on the ground at extra heights, and they jump up to the runway from the ground :roll:
This looks bugfree ingame, except the massive glitches :wink: I would like to see this in trunk after those will have been fixed :mrgreen:
Image
Image
Grolsch
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 08 May 2004 07:48
Location: Alkmaar, The Netherlands

Re: Patch: Raising max. height to 127

Post by Grolsch »

Screens would be interesting ;)
Beer equals power
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Raising max. height to 127

Post by Bilbo »

Development of this patch is temporarily put on hold.

Of course, anybody can fix the bugs and test the patch in meantime - once development resumes, I'll collect and merge the fixes.

Reason: See here:
http://www.tt-forums.net/viewtopic.php? ... 60#p611260
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
xyz
Engineer
Engineer
Posts: 46
Joined: 19 Feb 2005 07:37

Re: Patch: Raising max. height to 127

Post by xyz »

Hi

This patch jus gave me an idea, if you combine it with the bigger maps patch and the day-length patch it could be use to create an MMORTS based on OPENTTD.

And about
Bilbo wrote:Development of this patch is temporarily put on hold.
Of course, anybody can fix the bugs and test the patch in meantime - once development resumes, I'll collect and merge the fixes.
Reason: See here: l viewtopic.php?f=33&t=33262&p=611260#p611260
Don’t force someone to like your work.
Interesting Projects:
Celestia an open source space simulator.
EventGhost an open source PC remote control.
TA Spring
OpenTTD
CobraA1
Route Supervisor
Route Supervisor
Posts: 480
Joined: 07 Nov 2003 17:52
Location: USA

Re: Patch: Raising max. height to 127

Post by CobraA1 »

Hmmm ... I guess I stop making any new patches till I receive some feedback or response on the ones I put there already.
You're in a forum. Nobody is - or should be - forced to talk about stuff they don't want to talk about. There is no rule, written or implied, that states that people have to talk about your stuff.
"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away" --Henry David Thoreau
xyz
Engineer
Engineer
Posts: 46
Joined: 19 Feb 2005 07:37

Re: Patch: Raising max. height to 127

Post by xyz »

by the looks of it your patch made it to the nightly builds:
r10665 truelight 2007-07-23 21:30:36 +0200 (Mon, 23 Jul 2007) 4 lines
-Codechange: replace magic 15 with MAX_TILE_HEIGHT (bilbo)
-Codechange: replace magic 13 with MAX_SNOWLINE_HEIGHT (bilbo)
-Codechange: assure _map_height_bits is always of correct size (Rubidium)
Interesting Projects:
Celestia an open source space simulator.
EventGhost an open source PC remote control.
TA Spring
OpenTTD
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Raising max. height to 127

Post by Bilbo »

xyz wrote:by the looks of it your patch made it to the nightly builds:

...
Err. ... no. Only some small part of it, that will make the code cleaner. But the actual code to raise the max height is not in, as it is currently way too much buggy to even consider adding it to trunk. I'll update the patch to not include the part that is already in trunk once I get home ...
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
NukeBuster
Traffic Manager
Traffic Manager
Posts: 222
Joined: 04 Jan 2006 18:16
Location: Alphen aan den Rijn, The Netherlands
Contact:

Re: Patch: Raising max. height to 127

Post by NukeBuster »

Bilbo, you're doing a great job with your patches. I really enjoy reading the topics and watching the progress. I hope you will be patient enough for all patches to be evaluated by the devs.
NukeBuster

Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !

OpenTTD patch(es): Password at join
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: Patch: Raising max. height to 127

Post by athanasios »

xyz, CobraA1: Gentlemen, Bilbo is not trying to force anyone. He means that if no one is interested in certain of his patches then why should he continue on them wasting his time? They will not be of any use. (Except for himself in single player mode). He 'd better spend his precious time on patches that will make it into the trunk and we are going to use them.
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Raising max. height to 127

Post by Bilbo »

athanasios wrote:xyz, CobraA1: Gentlemen, Bilbo is not trying to force anyone. He means that if no one is interested in certain of his patches then why should he continue on them wasting his time? They will not be of any use. (Except for himself in single player mode). He 'd better spend his precious time on patches that will make it into the trunk and we are going to use them.
Well, some of my patches are usable in multiplayer too, as they preserve network compatibility. Like the vehicle commands, configurable console limits, more than 22 opened windows ... well, the console is planned to be rewritten, so after that I assume the first one will be accepted after I modify it for new code and second one may become obsolete ... well, I'll see :)
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Raising max. height to 127

Post by Bilbo »

Ok, I've updated this patch for newer trunk and also fixed wrong array size of map colors, see first post for it.

Rest of the bugs still remain ...
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
SmatZ
OpenTTD Developer
OpenTTD Developer
Posts: 351
Joined: 03 Oct 2006 18:26
Location: Prague, Czech Republic
Contact:

Re: Patch: Raising max. height to 127

Post by SmatZ »

Bilbo wrote: * many graphical glitches with tiles of height over 15 (I have no idea why).
The map is 2D. Everything is optimised so it doesn't draw more than it actually needs.
Making map higher would need to scan wider area for anything that can be displayed at given pixel, eg. it would need bigger area to scan in ViewportAddVehicles() etc.
I am afraid this would need huge rewrite of rendering functions, but you are welcome to give it a try ;-)
Image
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Raising max. height to 127

Post by Bilbo »

B. N. SmatZ! wrote:
Bilbo wrote: * many graphical glitches with tiles of height over 15 (I have no idea why).
The map is 2D. Everything is optimised so it doesn't draw more than it actually needs.
Making map higher would need to scan wider area for anything that can be displayed at given pixel, eg. it would need bigger area to scan in ViewportAddVehicles() etc.
I am afraid this would need huge rewrite of rendering functions, but you are welcome to give it a try ;-)
Hmmm ... I probably could just increase the lookup limit from 15 times tile height to 127, but I guess there would be some performance degradation ...

Still, maybe the patch could work so that height will be artificially limited to say 31 - still usable increase, there are enough reasonable colors for minimap for 32 levels, and there is room for further expansion in case someone will solve the glitches. And there are still levels -1 to -128 available for possible deep water patches or other uses.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Raising max. height to 127

Post by Bilbo »

I'd like to inform people who stumble upon this topic and then complain in PM about the patch not working/being for old OpenTTD version.

Look at this thread:

http://www.tt-forums.net/viewtopic.php?f=33&t=40844

Other people have taken off the idea from where I've left it and there is working patch (still with some known bugs, but with much less of them than my patch in this thread) in that thread for current OpenTTD version.

Consider this topic a bit obsolete.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Patch: Raising max. height to 127

Post by dihedral »

let me have a wiled guess: Alain sent you a pm asking you if you could update your patch?
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 1 guest