Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Tue Mar 19, 2019 10:07 pm

All times are UTC




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Jul 12, 2012 10:10 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Oct 04, 2008 11:05 pm
Posts: 2655
Location: Lost in spaces
Hello all.

This patch changes aircraft (normal and disaster) behaviour to adjust their flying altitude according to the terrain below during flight.
I took two patches from the MHL patch and rewrote them for plain trunk while splitting them up further.
Credits for the code go to ic111 and myself but ic111 wrote most of it. ;)

Attached is a series of patches to be applied succesfully.

Commit messages are as follows and should speak for themselves:
Code:
10.diff      Codechange: Rename base_altitude to offset
20.diff      Codechange: Rename GetAircraftFlyingAltitude() to GetAircraftFlyingAltitudeOffset()
30.diff      Codechange: Rename PLANE_HOLDING_ALTITUDE to PLANE_HOLD_MAX_FLYING_ALTITUDE and HELI_FLIGHT_ALTITUDE to HELICOPTER_HOLD_MAX_FLYING_ALTITUDE
40.diff      Codechange: Prepare the code to let aircraft change altitude according to the terrain below afterwards
             Besides a savegamebump and some enums we need the tile height below the aircraft's shadow.
50.diff      Feature: Aircraft change altitude according to terrain below
60.diff      Codechange: Prepare the code to let disaster aircraft change altitude according to terrain below afterwards
70.diff      Feature: Disaster aircraft change altitude according to terrain below
test.diff    Testing.
             Reduced the flightpatch heights of aircraft for easier testing if everything goes allright.
             Increased the frequency of disaster vehicles appearing.



@ Devs
The test.diff should not be commited to trunk as is!
The part that changes aircraft.h is to make aircraft fly lower so that they change altitude more often with "only" 15 heightlevels (This could be applied to trunk, minus the outcommented values, but I fear collision with high buildings).
The part that changes disaster_cmd.cpp is to have disaster vehicles appear more often and all at once instead of during certain periods in time. (this part should not be commited at all IHMO)

Notes / questions:
- In patch 40 I assume a height of level 7, something in the middle of heighest an lowest possible heightlevel, when an aircraft is outside the map and freeformedges is on; this is because the height of void tiles can not be querried. (In the MHL patch tiles outside the map do have a heightlevel and this situation is handled differently there).
Is there a way to get the height of the closest border tile when an aircraft is above a void tile?
- There are two savegamebumps needed one in in patch 40 and one in patch 60. I only increased the value once; ?if/when commiting this patch to trunk as a patchbomb this will not cause an issue with savegames?


Ps:
Testing, bugreporting and suggestions for code improvements much apreciated. ;)


Attachments:
aircraft_change_altitude.7z [6.82 KiB]
Downloaded 58 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.
Top
   
PostPosted: Thu Jul 12, 2012 10:45 pm 
Offline
Tycoon
Tycoon

Joined: Tue Mar 14, 2006 12:46 pm
Posts: 1534
Location: Netherlands
since they can change altitude, make smaller propplanes stay closer to the ground then the huge commercial jetliners?

_________________
Screenshots topic
Scenarios&Heightmaps


Top
   
PostPosted: Fri Jul 13, 2012 12:39 am 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7300
aircraft height depending on speed is in trunk for years already...

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Fri Jul 13, 2012 2:42 am 
Offline
Tycoon
Tycoon

Joined: Sun Dec 16, 2007 10:24 pm
Posts: 1655
Location: Idaho, USA
Eddi wrote:
aircraft height depending on speed is in trunk for years already...

Really? If so, it must be really hard to notice... :?

_________________
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton


Top
   
PostPosted: Fri Jul 13, 2012 8:24 am 
Offline
Tycoon
Tycoon

Joined: Tue Mar 14, 2006 12:46 pm
Posts: 1534
Location: Netherlands
Supercheese wrote:
Eddi wrote:
aircraft height depending on speed is in trunk for years already...

Really? If so, it must be really hard to notice... :?


then the diff is so small i dont really notice it, could use some difference

_________________
Screenshots topic
Scenarios&Heightmaps


Top
   
PostPosted: Fri Jul 13, 2012 8:28 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Oct 04, 2008 11:05 pm
Posts: 2655
Location: Lost in spaces
The difference is best noticed when simply creating two airports and sending a bunch of really slow and really fast aircrafts between them so their flightpatchs are exactly the same.
You will see that the faster airplanes fly higher while overtaking the slower ones. ;)

_________________
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2019 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2019.
Hosted by Zernebok Hosting.