MHeasell / rwe

Robot War Engine - Real-time strategy game engine compatible with Total Annihilation
https://www.robotwarengine.com/
GNU General Public License v3.0
115 stars 16 forks source link

Limit placement of geothermal units to geothermal vents #174

Closed OskarPedersen closed 9 months ago

OskarPedersen commented 10 months ago

This PR makes it so that units with G in their yard map only can be built on geothermal spots on the map.

https://github.com/MHeasell/rwe/assets/14198435/4d947b5c-2aae-4188-af39-cb3d0b01241f

The two geothermal power plants in TA have YardMap=GGGGGGGGGGGGGGGG; as their yard map. They can be built as long as any part of them intersect with a feature with geothermal=1;. In TA if their yard map is changed to for example YardMap=Gooooooooooooooo; their top left corner needs to be on a geothermal vent. And in TA with YardMap=GooooooooooooooG; as a yard map either their top left or bottom right corner needs to be on a thermal vent. Edit: This behavior should now be fully replicated in this PR, allowing for example the ProTA geothermal to work properly,

KevinHake commented 10 months ago

I'm taking a look, I think it's actually very close to being original behavior, which apparently is "if yardmap contains a G, and no G is located on a geo, it's an invalid placement." ProTA mod does depend on this behavior - it uses geo yardmaps

oooo
oGGo
oGGo
oooo

to force only one geothermal generator per vent.

KevinHake commented 10 months ago

For reference on yardmaps: https://www.tauniverse.com/forum/showthread.php?t=42189

OskarPedersen commented 10 months ago

I'm taking a look, I think it's actually very close to being original behavior, which apparently is "if yardmap contains a G, and no G is located on a geo, it's an invalid placement." ProTA mod does depend on this behavior - it uses geo yardmaps

oooo
oGGo
oGGo
oooo

to force only one geothermal generator per vent.

Thanks, that's a good example! I'll update this PR with the full geo yardmap support. Marking it as draft until I've done that.

OskarPedersen commented 10 months ago

I'm taking a look, I think it's actually very close to being original behavior, which apparently is "if yardmap contains a G, and no G is located on a geo, it's an invalid placement." ProTA mod does depend on this behavior - it uses geo yardmaps

oooo
oGGo
oGGo
oooo

to force only one geothermal generator per vent.

@KevinHake I updated the PR now to fully support that behavior.