(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().
This commit is contained in:
matthijs
2005-01-31 11:23:10 +00:00
parent 0e272f2d10
commit eb78cdb2d4
25 changed files with 1418 additions and 265 deletions

View File

@@ -978,7 +978,7 @@ static void MaybePlantFarmField(Industry *i)
int x = (i->width>>1) + Random() % 31 - 16;
int y = (i->height>>1) + Random() % 31 - 16;
tile = TileAddWrap(i->xy, x, y);
if (tile != TILE_WRAPPED)
if (tile != INVALID_TILE)
PlantFarmField(tile);
}
}
@@ -1496,7 +1496,7 @@ static void DoCreateNewIndustry(Industry *i, uint tile, int type, const Industry
int x = Random() % 31 - 16;
int y = Random() % 31 - 16;
uint new_tile = TileAddWrap(tile, x, y);
if (new_tile != TILE_WRAPPED)
if (new_tile != INVALID_TILE)
PlantFarmField(new_tile);
}
}