Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Dec 17, 2018 4:07 am

All times are UTC




Post new topic  Reply to topic  [ 52 posts ]  Go to page 1 2 3 Next
Author Message
PostPosted: Sat May 26, 2007 9:51 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Sun Jan 14, 2007 3:10 pm
Posts: 244
Location: West Norfolk, England
I've made a patch to change the rate of crashes of aircraft on large airports. This will not affect jets on small airports, there is a cheat for that one, this makes a more realistic rate of crashes (1:1000000) as opposed to the previous (1:1500).
This will also affect small aircraft on small airports.

Currently the option appears right at the bottom of the vehicles tab in configure patches, and is a bit difficult to see.

Down the page is newest version.

_________________
Quote:
Ways of Preventing Death:
* Don't breathe air. Seriously. Everyone born before 1870 breathed the substance at some point in their life and every one of them is dead today. A coincidence? I think not.


Taken from uncyclopedia


Last edited by RainierWatcher on Tue Jun 05, 2007 8:28 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Sat May 26, 2007 10:06 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Thu Feb 09, 2006 7:15 pm
Posts: 3815
First, this patch makes that chance 0, not 1000000.
Second, the lowest chance is 1 in about 65000 when you do not want to chance lots of code
Third, I personally think the chance becomes too little with this patch. Maybe in real life 1 in 1000000 planes crashes, but they make an average of say 500 flights a year, in the TTD world you would be happy if you get 12 flights a year. Furthermore you use much less planes than in real life, so calculating for all these factors 1 in 10000 might be more 'real life' than taking the actual real life number.


Top
   
 Post subject:
PostPosted: Sat May 26, 2007 10:58 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Apr 27, 2007 5:58 pm
Posts: 97
Location: Vegas baby
What if you had the probability customizable? 1/1500, 1/10000, 1/65000, 0.

_________________
I'm on the Zoloft to keep me from killing yall

My patches: Better graphs - Train acceleration - Crash rates


Top
   
 Post subject:
PostPosted: Sat May 26, 2007 11:13 pm 
Offline
Engineer
Engineer
User avatar

Joined: Thu Jul 14, 2005 7:48 pm
Posts: 8
Location: Ciudad Real, Spain
And why not a variable value based on the plane's reliability? Also with greater chance to crash if it has broken down.


Top
   
 Post subject:
PostPosted: Sun May 27, 2007 8:04 am 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Sun Jan 14, 2007 3:10 pm
Posts: 244
Location: West Norfolk, England
Rubidium wrote:
First, this patch makes that chance 0, not 1000000.
Second, the lowest chance is 1 in about 65000 when you do not want to chance lots of code
Third, I personally think the chance becomes too little with this patch. Maybe in real life 1 in 1000000 planes crashes, but they make an average of say 500 flights a year, in the TTD world you would be happy if you get 12 flights a year. Furthermore you use much less planes than in real life, so calculating for all these factors 1 in 10000 might be more 'real life' than taking the actual real life number.


How does it make it 0? Is it due to the size of the object to store the probability? I guess it is from the number quoted of 65000.

the average number of accidents and fatalities per year is as follows:
Quote:
14 accidents, 340 fatalities


This is 14 air accidents a year, and the fatalities figure comes from the total killed in planes which are certified to carry more than 13 passengers.
(from the Aviation safety network)

Of course this is worldwide, and there are some airlines which haven't had a crash for about 10 years or more.

Having said that, a value that is ten times lower than the current one would seem fairly good.

_________________
Quote:
Ways of Preventing Death:
* Don't breathe air. Seriously. Everyone born before 1870 breathed the substance at some point in their life and every one of them is dead today. A coincidence? I think not.


Taken from uncyclopedia


Top
   
 Post subject:
PostPosted: Sun May 27, 2007 8:43 am 
Offline
Traffic Manager
Traffic Manager

Joined: Fri Apr 13, 2007 5:07 pm
Posts: 156
Quote:
Third, I personally think the chance becomes too little with this patch. Maybe in real life 1 in 1000000 planes crashes, but they make an average of say 500 flights a year, in the TTD world you would be happy if you get 12 flights a year.

Speaking of realism.
    Trains may crash because of signals failure, switches failure or even because someone is sleeping when he shouldn't. Considering that real trains make about 90 000 kilometers per year and in OpenTTD you can be happy if your trains make 1 000 kilometers, chance to scrap your train should be about 1 in 10. Please note that I didn't think about brake failures, blown engines, terrorists attacks and other random problems with tracks (like in ICE or TGV cases).
    Buses and trucks... oh yeah, there are plenty of accidents caused by truck drivers who were eighter sleeping while in their truck, or drunk or by break failure, loosing control of their vehicle or by violating traffic laws. There were even trucks/busses that crashed into bus stops killing more ppl than single airplane crash kills. Again it should be something around 1 in 1000, maybe 1 in 500 in urban area.
    Ships don't crash too often, unless you like to watch Titanic every day, however there are many disasters, usually caused by weather or big companies which wanted to save couple of bucks and didn't repair everything they should in their tankers.


Why among all of those vehicles only planes have disasters? On top of that pretty offten and impossible to turn off. Why did you make breakdowns and disasters switches if even turning them off doesn't save even single airplane? If I remember correctly turning them off in TTD solved all my problems with plane crashes, or maybe it didn't, but chance of plane crashing was really small then, and together with small maps, using planes wasn't so reasonable.
It's just plain stupid to force disasters if someone doesn't want them to happen, thanks to it playing after year 2050 on big map is more like a challenge to replace all crashed airplanes before they get scraped, with no time to watch little trains/trams/trucks, no time to make any new connection.
Disasters are ok, but only if I can avoid them, I would prefere to avoid them by paying some extra money to enginers and my crew, so I can be assured they will work fine (like in Traffic Giant), since it isn't possible right now and probably not in future I have to mess with source to disable every disaster that I don't want. This is the easiest solution right now.


Top
   
 Post subject:
PostPosted: Sun May 27, 2007 9:05 am 
Offline
Director
Director

Joined: Tue Feb 22, 2005 9:51 am
Posts: 586
Quote:
Why among all of those vehicles only planes have disasters?

Because, in order to have a balance between transport types, they must have positives and negatives. Without crashes, planes have no negatives, and are even more unbalanced. Hence the suggestions (in this thread and the previous discussion one) to come up with a constructive solution rather than just disabling crashes outright.

If you want to argue realism, then combine this with a patch to make planes 15-20 times more expensive to run (or divide profit by 15-20), so that it takes a little more intelligence than just throwing down 500+ planes and counting the profits.


Top
   
 Post subject:
PostPosted: Sun May 27, 2007 12:00 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Sun Jan 14, 2007 3:10 pm
Posts: 244
Location: West Norfolk, England
I've modified the patch, it now still makes air crashes possible, thanks to rubidium pointing it out that before it made them impossible.

It should make crashes 20 times less frequent than they were before.

It now appears in the stations tab of the config. patches window. (It only affects aircraft at airports, which are stations).


Attachments:
customisableaircrashes3.patch [5.28 KiB]
Downloaded 410 times

_________________
Quote:
Ways of Preventing Death:
* Don't breathe air. Seriously. Everyone born before 1870 breathed the substance at some point in their life and every one of them is dead today. A coincidence? I think not.


Taken from uncyclopedia
Top
   
 Post subject:
PostPosted: Mon May 28, 2007 2:52 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Jun 23, 2005 12:09 am
Posts: 3138
knedle wrote:
It's just plain stupid to force disasters if someone doesn't want them to happen, thanks to it playing after year 2050 on big map is more like a challenge to replace all crashed airplanes before they get scraped, with no time to watch little trains/trams/trucks, no time to make any new connection.

:idea: A patch to autoreplace crashed vehicles is actually what is desperately needed. Anyone willing to make it a reality?

_________________
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.


Top
   
 Post subject:
PostPosted: Sat Jun 02, 2007 3:04 am 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Thu Oct 28, 2004 4:42 am
Posts: 702
Location: Catch the Fox if you can... 10 years and counting!
RainierWatcher wrote:
I've modified the patch, it now still makes air crashes possible, thanks to rubidium pointing it out that before it made them impossible.

It should make crashes 20 times less frequent than they were before.

It now appears in the stations tab of the config. patches window. (It only affects aircraft at airports, which are stations).


I love this patch :)

Oh boy with almost 500 planes in my games, this help a lot..

But could you make it customize, so we can change if we want 20 times less probability or no disasters at all?? Like some GUI in pach options.. And update patch to last trunk revision..

Thanks :)


Top
   
 Post subject:
PostPosted: Tue Jun 05, 2007 6:27 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Sun Jan 14, 2007 3:10 pm
Posts: 244
Location: West Norfolk, England
Digitalfox wrote:
I love this patch :)

Oh boy with almost 500 planes in my games, this help a lot..

But could you make it customize, so we can change if we want 20 times less probability or no disasters at all?? Like some GUI in pach options.. And update patch to last trunk revision..

Thanks :)


Right, sorry for the wait, I've tried to do this, and this is on latest revision (r10043).

Unfortunately it doesn't like it:

Code:
 Compiling aircraft_cmd.cpp
C:/BuildOTTD/msys/home/ottdsrc/trunk/src/aircraft_cmd.cpp: In function `void MaybeCrashAirplane(Vehicle*)':
C:/BuildOTTD/msys/home/ottdsrc/trunk/src/aircraft_cmd.cpp:1458: error: `patches' undeclared (first use this function)
C:/BuildOTTD/msys/home/ottdsrc/trunk/src/aircraft_cmd.cpp:1458: error: (Each undeclared identifier is reported only once for each function it appears in.)
make[1]: *** [aircraft_cmd.o] Error 1
make[1]: Leaving directory `/home/ottdsrc/trunk/objs/release'
make: *** [all] Error 2


New patch attempt (edit to say, I think it doesn't like how I define my variable, but it accepted this sort of code when it was boolean):

Code:
Index: src/aircraft_cmd.cpp
===================================================================
--- src/aircraft_cmd.cpp   (revision 10043)
+++ src/aircraft_cmd.cpp   (working copy)
@@ -1455,7 +1455,7 @@
    Station *st = GetStation(v->u.air.targetairport);
 
    /* FIXME -- MaybeCrashAirplane -> increase crashing chances of very modern airplanes on smaller than AT_METROPOLITAN airports */
-   uint16 prob = 0x10000 / 1500;
+   uint16 prob = 0x10000 / (patches.less_air_crashes);
    if (st->Airport()->flags & AirportFTAClass::SHORT_STRIP &&
          AircraftVehInfo(v->engine_type)->subtype & AIR_FAST &&
          !_cheats.no_jetcrash.value) {
Index: src/lang/english.txt
===================================================================
--- src/lang/english.txt   (revision 10043)
+++ src/lang/english.txt   (working copy)
@@ -1108,6 +1108,7 @@
 STR_CONFIG_PATCHES_MAX_ROADVEH                                  :{LTBLUE}Max road vehicles per player: {ORANGE}{STRING1}
 STR_CONFIG_PATCHES_MAX_AIRCRAFT                                 :{LTBLUE}Max aircraft per player: {ORANGE}{STRING1}
 STR_CONFIG_PATCHES_MAX_SHIPS                                    :{LTBLUE}Max ships per player: {ORANGE}{STRING1}
+STR_CONFIG_PATCHES_LESS_AIR_CRASHES                             :{LTBLUE}Set probabilty level for air crashes of aircraft of suitable size for the airport: {ORANGE}{STRING1}
 
 STR_CONFIG_PATCHES_AI_BUILDS_TRAINS                             :{LTBLUE}Disable trains for computer: {ORANGE}{STRING1}
 STR_CONFIG_PATCHES_AI_BUILDS_ROADVEH                            :{LTBLUE}Disable road vehicles for computer: {ORANGE}{STRING1}
Index: src/settings.cpp
===================================================================
--- src/settings.cpp   (revision 10043)
+++ src/settings.cpp   (working copy)
@@ -1239,7 +1239,7 @@
 #endif /* WIN32 */
 
 static const SettingDescGlobVarList _misc_settings[] = {
-   SDTG_MMANY("display_opt",     SLE_UINT8, S, 0, _display_opt,       (1 << DO_SHOW_TOWN_NAMES | 1 << DO_SHOW_STATION_NAMES | 1 << DO_SHOW_SIGNS | 1 << DO_FULL_ANIMATION | 1 << DO_FULL_DETAIL | 1 << DO_WAYPOINTS), "SHOW_TOWN_NAMES|SHOW_STATION_NAMES|SHOW_SIGNS|FULL_ANIMATION||FULL_DETAIL|WAYPOINTS", STR_NULL, NULL),
+   SDTG_MMANY("display_opt",     SLE_UINT8, S, 0, _display_opt,       (DO_SHOW_TOWN_NAMES|DO_SHOW_STATION_NAMES|DO_SHOW_SIGNS|DO_FULL_ANIMATION|DO_FULL_DETAIL|DO_WAYPOINTS), "SHOW_TOWN_NAMES|SHOW_STATION_NAMES|SHOW_SIGNS|FULL_ANIMATION|FULL_DETAIL|WAYPOINTS", STR_NULL, NULL),
     SDTG_BOOL("news_ticker_sound",          S, 0, _news_ticker_sound,     true,    STR_NULL, NULL),
     SDTG_BOOL("fullscreen",                 S, 0, _fullscreen,           false,    STR_NULL, NULL),
      SDTG_STR("videodriver",      SLE_STRB,C|S,0, _ini_videodriver,       NULL,    STR_NULL, NULL),
@@ -1391,7 +1391,7 @@
    SDT_BOOL(Patches, wagon_speed_limits,            0, 0,  true,                    STR_CONFIG_PATCHES_WAGONSPEEDLIMITS,     NULL),
    SDT_CONDBOOL(Patches, disable_elrails, 38, SL_MAX_VERSION, 0, 0, false,          STR_CONFIG_PATCHES_DISABLE_ELRAILS,      SettingsDisableElrail),
    SDT_CONDVAR(Patches, freight_trains, SLE_UINT8, 39, SL_MAX_VERSION, 0, 0, 1, 1, 255, 1, STR_CONFIG_PATCHES_FREIGHT_TRAINS, NULL),
-
+   
    /***************************************************************************/
    /* Station section of the GUI-configure patches window */
    SDT_BOOL(Patches, join_stations,           0, 0,  true,        STR_CONFIG_PATCHES_JOINSTATIONS,       NULL),
@@ -1406,6 +1406,7 @@
    SDT_CONDBOOL(Patches, gradual_loading, 40, SL_MAX_VERSION, 0, 0,  true, STR_CONFIG_PATCHES_GRADUAL_LOADING,    NULL),
    SDT_CONDBOOL(Patches, road_stop_on_town_road, 47, SL_MAX_VERSION, 0, 0, false, STR_CONFIG_PATCHES_STOP_ON_TOWN_ROAD, NULL),
    SDT_CONDBOOL(Patches, adjacent_stations,      62, SL_MAX_VERSION, 0, 0, true,  STR_CONFIG_PATCHES_ADJACENT_STATIONS, NULL),
+   SDT_VAR(Patches, less_air_crashes,SLE_UINT16, S, 0, 30000, 65000, 20, STR_CONFIG_PATCHES_LESS_AIR_CRASHES,     NULL),
 
    /***************************************************************************/
    /* Economy section of the GUI-configure patches window */
Index: src/settings_gui.cpp
===================================================================
--- src/settings_gui.cpp   (revision 10043)
+++ src/settings_gui.cpp   (working copy)
@@ -648,6 +648,7 @@
    "gradual_loading",
    "road_stop_on_town_road",
    "adjacent_stations",
+   "less_air_crashes",
 };
 
 static const char *_patches_economy[] = {
@@ -703,7 +704,7 @@
    "no_servicing_if_no_breakdowns",
    "wagon_speed_limits",
    "disable_elrails",
-   "freight_trains",
+   "freight_trains",   
 };
 
 struct PatchEntry {
Index: src/variables.h
===================================================================
--- src/variables.h   (revision 10043)
+++ src/variables.h   (working copy)
@@ -133,6 +133,7 @@
    byte liveries;                      // Options for displaying company liveries, 0=none, 1=self, 2=all
    bool prefer_teamchat;               // Choose the chat message target with <ENTER>, true=all players, false=your team
    bool advanced_vehicle_list;         // Use the "advanced" vehicle list
+   uint16 less_air_crashes;              // Reduction in number of air crashes at large airports
 
    uint8 toolbar_pos;                  // position of toolbars, 0=left, 1=center, 2=right
    uint8 window_snap_radius;           // Windows snap at each other if closer than this

_________________
Quote:
Ways of Preventing Death:
* Don't breathe air. Seriously. Everyone born before 1870 breathed the substance at some point in their life and every one of them is dead today. A coincidence? I think not.


Taken from uncyclopedia


Top
   
 Post subject:
PostPosted: Tue Jun 05, 2007 7:30 pm 
Offline
Director
Director

Joined: Tue Jan 03, 2006 8:45 pm
Posts: 560
Location: Netherlands
It might be better to modify the probability directly instead of by the division
Code:
prob = 0x10000 / (patches.less_air_crashes);

The problem is that a whole lot of values of patches.less_air_crashes yield the same probabilty. For instance, any number from 32769 to 65535 gives 1 as the result of the division. By changing the number (for instance) from 35000 to 60000 the user expects that his/her planes crash less often, but this doesn't happen. That may be experienced as being a bug.
I think it is better to define the probability by percents of the default value, so that one could do it with
Code:
prob = 0x10000 * (patches.air_crash_prob) / 150000;
so that setting the value to 100 gives the default value, and lower values give lower chances of crashing aircraft. The range may then be set from 5% (minimal probability) to something well over 100% (increased probability).


Top
   
 Post subject:
PostPosted: Tue Jun 05, 2007 8:00 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Sun Jan 14, 2007 3:10 pm
Posts: 244
Location: West Norfolk, England
Got it working now, but the explanation trails off the edge of the patches window, and it comes up with an error stating that as well, but apart from that, it seems to work.


Attachments:
File comment: Patch with user defined rates of crashes, against r10043
modifiableplanecrashesv2.patch [5.28 KiB]
Downloaded 282 times

_________________
Quote:
Ways of Preventing Death:
* Don't breathe air. Seriously. Everyone born before 1870 breathed the substance at some point in their life and every one of them is dead today. A coincidence? I think not.


Taken from uncyclopedia
Top
   
 Post subject:
PostPosted: Tue Jun 05, 2007 11:19 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Fri Dec 02, 2005 3:43 pm
Posts: 619
Location: Drancy(93) - France
In settings.cpp, the two first changes are wrong (the first reverts a fix in trunk, the second adds a tab).

In settings_gui.cpp, the second change is not needed either (you added a tab).

In variables.h, wrong comment align.


Top
   
 Post subject:
PostPosted: Wed Jun 06, 2007 4:01 am 
Offline
Engineer
Engineer
User avatar

Joined: Fri Apr 27, 2007 5:58 pm
Posts: 97
Location: Vegas baby
Here it is with adjustable rates: 1/1500, 1/10000, 1/30000, 0.

After I finished I realized RainierWatcher had made it adjustable already.. oh well. =)


Attachments:
adjustable_crash_rates_r10046.diff [3.73 KiB]
Downloaded 393 times

_________________
I'm on the Zoloft to keep me from killing yall

My patches: Better graphs - Train acceleration - Crash rates
Top
   
 Post subject:
PostPosted: Wed Jun 06, 2007 8:30 am 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Sun Jan 14, 2007 3:10 pm
Posts: 244
Location: West Norfolk, England
Well, yours is probably more usable anyway, so I don't mind. Actually, I'm going to concede that yours is far better and more user friendly, so I think yours should be the one used. Not out of laziness, but I really think that was the better way to do it, to use set values.

I've tried to make mine right, but I only seem to be able to change the value to 65000 and 20, which should be the max and minimum values.

Anyway;


Attachments:
modifiableplanecrashesv3.patch [3.43 KiB]
Downloaded 348 times

_________________
Quote:
Ways of Preventing Death:
* Don't breathe air. Seriously. Everyone born before 1870 breathed the substance at some point in their life and every one of them is dead today. A coincidence? I think not.


Taken from uncyclopedia


Last edited by RainierWatcher on Wed Jun 06, 2007 4:04 pm, edited 2 times in total.
Top
   
 Post subject:
PostPosted: Wed Jun 06, 2007 2:58 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Fri Dec 02, 2005 3:43 pm
Posts: 619
Location: Drancy(93) - France
settings.cpp: ..., 30000, 65000, 20, ...
means default: 30000, min: 65000, max: 20, something looks wrong ;)


Top
   
 Post subject:
PostPosted: Wed Jun 06, 2007 3:58 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Sun Jan 14, 2007 3:10 pm
Posts: 244
Location: West Norfolk, England
glx wrote:
settings.cpp: ..., 30000, 65000, 20, ...
means default: 30000, min: 65000, max: 20, something looks wrong ;)


Oh well :)

The wiki must be wrong then:

Code:
SDT_VAR( <settings group>, <varname>, <vardef>, <savewhereflags>, <gui flags>, <initial value>, <max value>, <min value>, <display string>, <onchange callback proc>),


In which case, I put them the other way round in the code, still doesn't work.

_________________
Quote:
Ways of Preventing Death:
* Don't breathe air. Seriously. Everyone born before 1870 breathed the substance at some point in their life and every one of them is dead today. A coincidence? I think not.


Taken from uncyclopedia


Top
   
 Post subject:
PostPosted: Wed Jun 06, 2007 7:12 pm 
Offline
Director
Director

Joined: Tue Jan 03, 2006 8:45 pm
Posts: 560
Location: Netherlands
This is from the macro in settings.cpp:
Code:
SDT_VAR(base, var, type, flags, guiflags, def, min, max, interval, str, proc)

The problem might be that interval is set to 0. This number is used to increment/decrement the value of the variable. Keeping in mind that you want to be able to change te value, it might be a bad idea to set it to 0.* Try setting it to 1 or a to higher number; for instance, 5, 10 or 20 will be fine.


*Close inspection shows that many of the variables have interval set to 0. It might be that the game interprets 0 as 1 in this case.


Top
   
 Post subject:
PostPosted: Tue Jun 12, 2007 1:20 pm 
Offline
Engineer
Engineer

Joined: Wed May 09, 2007 6:46 pm
Posts: 15
How I do I use this?

I'm more of a player than developer and not sure what to do, I just know my 500 planes are crashing quickly!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 52 posts ]  Go to page 1 2 3 Next

All times are UTC


Who is online

Users browsing this forum: Deicide 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-2018 phpBB Limited

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