This document describes low-level changes to the codebase which are not generally visible when actually running/playing the game, this is a non-exhaustive list.
This document describes low-level changes to the codebase which are not generally visible when actually running/playing the game, this is a non-exhaustive list.
This document does not describe the player-visible changes/additions described in the main readme.
This document does not describe the player-visible changes/additions described in the main readme.
### Crash logger and diagnostics
### Crash logger and diagnostics
@ -22,151 +23,151 @@ This document does not describe the player-visible changes/additions described i
#### Assertions
#### Assertions
Various assertions are extended to log further information on failure.
* Various assertions are extended to log further information on failure.
Various assertions which check the state of a tile are extended to dump the tile state (m1 - m8, etc.) on failure.
* Various assertions which check the state of a tile are extended to dump the tile state (m1 - m8, etc.) on failure.
#### Scope annotations
#### Scope annotations
Scopes (in the main thread) can be annotated with a functor/lambda which is called in the event of a crash to provide further information to add to the crash log.
* Scopes (in the main thread) can be annotated with a functor/lambda which is called in the event of a crash to provide further information to add to the crash log.
#### NewGRF debug window
#### NewGRF debug window
Add various supplementary non-GRF information, e.g. vehicle variables and flags.
* Add various supplementary non-GRF information, e.g. vehicle variables and flags.
#### Logging
#### Logging
Add yapfdesync, linkgraph and sound log levels.
* Add yapfdesync, linkgraph and sound log levels.
Extend desync and random logging.
* Extend desync and random logging.
### Map
### Map
Store tunnel start/end pairs in a pool, indexed in the start/end tiles.
* Store tunnel start/end pairs in a pool, indexed in the start/end tiles.
Set bit in map if level crossing is possibly occupied by a road vehicle.
* Set bit in map if level crossing is possibly occupied by a road vehicle.
Cache inferred one-way state of road tiles.
* Cache inferred one-way state of road tiles.
De-virtualise calls to AnimateTile().
* De-virtualise calls to AnimateTile().
Cache animated tile speed.
* Cache animated tile speed.
### Viewport
### Viewport
Cache bridge/tunnel start and ends.
* Cache bridge/tunnel start and ends.
Cache station sign bounds.
* Cache station sign bounds.
Split sprite sort regions when more than 60 sprites present.
* Split sprite sort regions when more than 60 sprites present.
Reduce unnecessary region redraws when scrolling viewports.
* Reduce unnecessary region redraws when scrolling viewports.
Reduce viewport invalidation region size of track reservation and signal state changes.
* Reduce viewport invalidation region size of track reservation and signal state changes.
Cache landscape background in map mode.
* Cache landscape background in map mode.
### Rendering
### Rendering
Track dirty viewport areas seperately from general screen redraws, using a zoom-level dependant sized grid.
* Track dirty viewport areas seperately from general screen redraws, using a zoom-level dependant sized grid.
Use a rectangle array for general screen redraws instead of a block grid.
* Use a rectangle array for general screen redraws instead of a block grid.
Add a dirty bit to windows and widgets, for redrawing entire windows or widgets.
* Add a dirty bit to windows and widgets, for redrawing entire windows or widgets.
Clip drawing of window widgets which are not in the redraw area.
* Clip drawing of window widgets which are not in the redraw area.
Reduce unnecessary status bar and vehicle list window redraws.
* Reduce unnecessary status bar and vehicle list window redraws.
Filter out tile parts which are entirely outside the drawing area, within DrawTileProc handlers.
* Filter out tile parts which are entirely outside the drawing area, within DrawTileProc handlers.
### Data structures
### Data structures
Various data structures have been replaced with B-tree maps/sets (cpp-btree library).
* Various data structures have been replaced with B-tree maps/sets (cpp-btree library).
Various lists have been replaced with vectors or deques, etc.
* Various lists have been replaced with vectors or deques, etc.
Remove mutexes from SmallStack, only used from the main thread.
* Remove mutexes from SmallStack, only used from the main thread.
Use std::string in CommandContainer instead of a giant static buffer.
* Use std::string in CommandContainer instead of a giant static buffer.
Add a third parameter p3 to DoCommand/CommandContainer.
* Add a third parameter p3 to DoCommand/CommandContainer.
Add a free bitmap for pool slots.
* Add a free bitmap for pool slots.
Maintain free list for text effect entries.
* Maintain free list for text effect entries.
Many fields have been widened.
* Many fields have been widened.
### Vehicles
### Vehicles
Cache the sprite_seq bounds.
* Cache the sprite_seq bounds.
Index the order list in vector.
* Index the order list in a vector.
Observe the operation of the NewGRF when getting the vehicle image/sprite, and elide further calls to the NewGRF if it can be determined that the result will be the same.
* Observe the operation of the NewGRF when getting the vehicle image/sprite, and elide further calls to the NewGRF if it can be determined that the result will be the same.
Update train/road vehicle image/sprite on demand (i.e. when on screen) when image is continuously updated by GRF.
* Update train/road vehicle image/sprite on demand (i.e. when on screen) when image is continuously updated by GRF.
Add consist flag for case where no vehicles in consist are on a slope.
* Add consist flag for the case where no vehicles in consist are on a slope.
Add vehicle flag to mark the last vehicle in a consist with a visual effect.
* Add vehicle flag to mark the last vehicle in a consist with a visual effect.
Index the vehicle list in per type arrays for use by CallVehicleTicks.
* Index the vehicle list in per type arrays for use by CallVehicleTicks.
Cache whether the vehicle should be drawn.
* Cache whether the vehicle should be drawn.
### Network/multiplayer
### Network/multiplayer
Add supplementary information to find server UDP packets and reply in an extended format with more info/wider fields if detected.
* Add supplementary information to find server UDP packets and reply in an extended format with more info/wider fields if detected.
Paginate UDP packets longer than the MTU across multiple packets.
* Paginate UDP packets longer than the MTU across multiple packets.
Use larger "packets" where useful in TCP connections.
* Use larger "packets" where useful in TCP connections.
Send vehicle caches from network server to clients to avoid desyncs caused by non-deterministic NewGRFs.
* Send vehicle caches from network server to clients to avoid desyncs caused by non-deterministic NewGRFs.
### Sprites/blitter
### Sprites/blitter
Add a fast path to Blitter_32bppAnim::Draw.
* Add a fast path to Blitter_32bppAnim::Draw.
Replace sprite cache implementation.
* Replace sprite cache implementation.
### Link graph
### Link graph
Completely change link graph job scheduling to make the duration of a job and the number of jobs per thread instance variable according to the estimated size of the job.
* Completely change link graph job scheduling to make the duration of a job and the number of jobs per thread instance variable according to the estimated size of the job.
Various use of custom allocators, etc.
* Various use of custom allocators, etc.
Early abort link graph threads if abandoning/quitting the game.
* Early abort link graph threads if abandoning/quitting the game.
Various forms of caching and incremental updates to the link graph overlay.
* Various forms of caching and incremental updates to the link graph overlay.
Change FlowStat from an RB-tree to a flat map with small-object optimisation.
* Change FlowStat from an RB-tree to a flat map with small-object optimisation.
Change FlowStatMap from an RB-tree to a B-tree indexed vector.
* Change FlowStatMap from an RB-tree to a B-tree indexed vector.
Replace MCF Dijkstra RB-tree with B-tree.
* Replace MCF Dijkstra RB-tree with B-tree.
Reduce performance issues when deleting stale links with refit to any cargo.
* Reduce performance issues when deleting stale links with refit to any cargo.
### Pathfinder
### Pathfinder
YAPF: Reduce need to scan open list queue when moving best node to closed list
* YAPF: Reduce need to scan open list queue when moving best node to closed list
### Save and load
### Save and load
Feature versioning, see readme and code.
* Feature versioning, see readme and code.
Extend gamelog to not truncate version strings.
* Extend gamelog to not truncate version strings.
Save/load the map in a single chunk, such that it can be saved/loaded in one pass.
* Save/load the map in a single chunk, such that it can be saved/loaded in one pass.
Various other changes to savegame format and settings handling, see readme and code for details.
* Various other changes to savegame format and settings handling, see readme and code for details.
Replace read/write accessors and buffering.
* Replace read/write accessors and buffering.
Perform savegame decompression in a separate thread.
* Perform savegame decompression in a separate thread.
Pre-filter SaveLoad descriptor arrays for current version/mode, for chunks with many objects.
* Pre-filter SaveLoad descriptor arrays for current version/mode, for chunks with many objects.