I would like to implement a new framework to account for all of the suggestions for disasters:
- realistic disasters: http://www.tt-forums.net/viewtopic.php?t=14818
another call for disasters: http://www.tt-forums.net/viewtopic.php?t=19883
modifiable air crash: http://www.tt-forums.net/viewtopic.php?t=32202
auto-replace air crashed airplane: http://www.tt-forums.net/viewtopic.php?t=32074
1. Divide disasters into four categories.
Code: Select all
enum DisasterType {
DISASTER_NATURAL = 0,
DISASTER_VEHICLE,
DISASTER_INDUSTRY,
DISASTER_OTHER,
DISASTER_MAX
};
Natural disasters would be forest fire, earthquake, floods, avalanche, and so forth. Currently none exist within the game.
Vehicle disasters would be plane crash upon landing, zepplin crash, broken train signal, train brake failure, road vehicle brake failure, and ship running aground. Only the first two currently exist.
Industry disasters would be oil refinery explosion, factory explosion, coal mine collapse, insect plague at farms, etc. The first three already exist.
Other disasters would be submarine attack and UFO landings. These are the disasters that I personally hate.
2. Each disaster type has an independent, customizable frequency.
The _opt structure contains a single variable that completely disables or enables all disasters. It would become an array of delay counters:
Code: Select all
struct GameDifficulty {
// ...
int disasters[DISASTER_MAX];
// ...
};
3. Each disaster has its own delay loop.
In disaster_cmd.cpp there is a single counter, _disaster_delay, that governs when the next disaster occurs, with air crashes are treated differently. The proposal is to have four counters, each with a varying delay amount (ResetDisasterDelay()). Each counter will then trigger an appropriate disaster when it reaches zero.
I would like some comments before I implement these changes. Thanks.
Disclaimer: I am a long-time player of OpenTTD and have wanted to join development of the program. When I downloaded the source code I was pleasantly surprised at how well documented it was, as compared to other open source projects.