JonathanSafer / screeps

Screeps AI
MIT License
25 stars 7 forks source link

Fix Path planning to score highways correctly #199

Open jordansafer opened 2 years ago

jordansafer commented 2 years ago

Right now in utils.ts, highwayMoveSettings() lines 84-101, we return an empty cost matrix in many cases. We initially wanted to return a terrain based costmatrix, with 3x scores for highway rooms, but for some reason have always been returning an empty cost matrix instead. And in some cases multiplying all the 0s by 3. I removed the 0s by 3 part, since it was using _.map(), which doesn't work properly on cost-matrixes. This ticket is to use Terrain map cost matrix, and the regular cost matrix APIs for tripling the values in the matrix.

If we want to use _.map(), the underlying data type is { "bits": [0,0,0,0,0,0,0,0,0,0...] } (2500 long) on MMO. We could just do bits x 3. This function is mainly used for roomplanning and some military usecases