Warzone2100 / warzone2100

Command the forces of The Project in a battle to rebuild the world after mankind has been nearly destroyed by nuclear missiles. A 100% free and open source real-time strategy game for Windows, macOS, Linux, BSD+
https://wz2100.net
GNU General Public License v2.0
3.23k stars 533 forks source link

Perfectly centered truck can't build factory on top of itself #4137

Open aco4 opened 1 week ago

aco4 commented 1 week ago

Before building a structure, units will get pushed out of the way. This doesn't happen if the unit is perfectly centered on the tile.

Video

In the first video (attached below), I start a game with 1 truck and try to build a factory on top of it. The truck doesn't get pushed, and the factory can't be built. I then try to build the factory 1 tile to the right. The truck gets pushed, and the factory is built:

https://github.com/user-attachments/assets/23261f6b-45e2-483c-8176-45210312bd4a

In the second video (attached below), I start a game with 4 trucks and try to build a factory on top of one of the trucks. It does get pushed, and I can build the factory:

https://github.com/user-attachments/assets/5db0eba6-087e-4b96-a89c-b107af1fc1f0

To Reproduce

Start a skirmish game with the map below. (Rename .zip to .wz)

10c-Lekiro.zip

  1. Kill 3 of the 4 starting trucks.
  2. Build a factory on top of the remaining truck
  3. The factory doesn't build.

Restart the skirmish game.

  1. Don't kill any of the 4 starting trucks.
  2. Build a factory on top of a truck
  3. The trucks get pushed and the factory is built.

Expected behavior

The truck(s) should always get pushed. If perfectly centered, choose any arbitrary direction to push the truck.

System

Additional Context

Not tested with smaller structures (e.g. research facility, bunker)

Monsterovich commented 5 days ago

I have no idea how to place a unit in the center of a building preview without using scripts.

aco4 commented 5 days ago

When you start a game, the trucks are typically centered perfectly.

Monsterovich commented 5 days ago

For some reason the droid doesn't even make it onto the list of nearby droids.

Chewbakka-Wakka commented 1 day ago

This has been known for some time, which is why AI bots have some specific code behavior to avoid it. Good issue report. Prob best to update the AIs following.