| 69 | ==== possible solutions |
| 70 | (1) |
| 71 | * change the `depth` of the `viking_longship.xml` or |
| 72 | (2) |
| 73 | * Double the `PUSHING_GRID_SIZE`, [https://code.wildfiregames.com/source/0ad/browse/ps/trunk/source/simulation2/components/CCmpUnitMotion_System.cpp$50 CCmpUnitMotion_System.cpp] |
| 74 | |
| 75 | {{{#!cpp lineno=42 marks=50 |
| 76 | /** |
| 77 | * Units push within their square and neighboring squares (except diagonals). This is the size of each square (in meters). |
| 78 | * I have tested grid sizes from 10 up to 80 and overall it made little difference to the performance, |
| 79 | * mostly, I suspect, because pushing is generally dwarfed by regular motion costs. |
| 80 | * However, the algorithm remains n^2 in comparisons so it's probably best to err on the side of smaller grids, which will have lower spikes. |
| 81 | * The balancing act is between comparisons, unordered_set insertions and unordered_set iterations. |
| 82 | * For these reasons, a value of 20 which is rather small but not overly so was chosen. |
| 83 | */ |
| 84 | constexpr int PUSHING_GRID_SIZE = 40; |
| 85 | }}} |