diff options
author | matthijs <matthijs@openttd.org> | 2005-01-31 11:23:10 +0000 |
---|---|---|
committer | matthijs <matthijs@openttd.org> | 2005-01-31 11:23:10 +0000 |
commit | a2dec6c32a8a7907fc3faaae761c97132c11a088 (patch) | |
tree | d44a0a41fee496e1abc2bb31d1f29e733309f757 /variables.h | |
parent | b64c375f2f9cbe0dca4f88e3fe3f613db03b84a4 (diff) | |
download | openttd-a2dec6c32a8a7907fc3faaae761c97132c11a088.tar.xz |
(svn r1751) - Feature: New PathFinder (NPF).
- Supports trains, road vehicles and ships.
- Uses A* pathfinding (same codebase as the new ai).
- Currently unlimited search depth, so might perform badly on large maps/networks (especially ships).
- Will always find a route if there is one.
- Allows custom penalties for obstacles to be set in openttd.cfg (npf_ values).
- With NPF enabled, ships can have orders that are very far apart. Be careful, this will break (ships get lost) when the old pathfinder is used again.
- Feature: Disabling 90 degree turns for trains and ships.
- Requires NPF to be enabled.
- Ships and trains can no longer make weird 90 degree turns on tile borders.
- Codechange: Removed table/directions.h.
- table/directions.h contained ugly static tables but was included more than once. The tables, along with a few new ones are in npf.[ch] now. Better suggestions for a location?
- Fix: Binary heap in queue.c did not allocate enough space, resulting in a segfault.
- Codechange: Rewritten FindFirstBit2x64, added KillFirstBit2x64.
- Codechange: Introduced constant INVALID_TILE, to replace the usage of 0 as an invalid tile. Also replaces TILE_WRAPPED.
- Codechange: Moved TileAddWrap() to map.[ch]
- Add TileIndexDiffCByDir(), TileIndexDiffCByDir().
- Codechange: Moved IsTrainStationTile() to station.h
- Add: IsRoadStationTile() and GetRoadStationDir().
Diffstat (limited to 'variables.h')
-rw-r--r-- | variables.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/variables.h b/variables.h index f80e2e160..214406b26 100644 --- a/variables.h +++ b/variables.h @@ -128,6 +128,7 @@ typedef struct Patches { bool nonuniform_stations;// allow nonuniform train stations bool always_small_airport; // always allow small airports bool realistic_acceleration; // realistic acceleration for trains + bool forbid_90_deg; // forbid trains to make 90 deg turns bool invisible_trees; // don't show trees when buildings are transparent bool no_servicing_if_no_breakdowns; // dont send vehicles to depot when breakdowns are disabled @@ -186,6 +187,13 @@ typedef struct Patches { byte drag_signals_density; // many signals density bool ainew_active; // Is the new AI active? + /* New Path Finding */ + bool new_pathfinding_all; /* Use the newest pathfinding algorithm for all */ + + uint32 npf_rail_firstred_penalty; /* The penalty for when the first signal is red */ + uint32 npf_rail_station_penalty; /* The penalty for station tiles */ + uint32 npf_rail_slope_penalty; /* The penalty for sloping upwards */ + bool population_in_label; // Show the population of a town in his label? } Patches; @@ -434,6 +442,9 @@ VARDEF byte _vehicle_design_names; /* tunnelbridge */ #define MAX_BRIDGES 13 +/* For new pathfinding. Define here so it is globally available */ +#define NPF_TILE_LENGTH 100 + /* Autoreplace vehicle stuff*/ VARDEF byte _autoreplace_array[256]; VARDEF uint16 _player_num_engines[256]; |