kyranf / robotarmyfactorio

A mod to add robot troop units and perhaps associated support buildings and items to produce and control them.
MIT License
35 stars 11 forks source link

Robots are prescient #81

Closed Brickcaster closed 8 years ago

Brickcaster commented 8 years ago

I see in squad.lua line 303, robots do not check to see if the base has been spotted. Thus they will beeline towards new bases hidden in the fog of war. This explains some of the behavior I have seen in play.

kyranf commented 8 years ago

yes, early in the mod development I made that line of code that checks if the enemy they want to attack is in a revealed chunk or now, but for simplicity's sake I bypassed that code and just allowed them to "smell" the enemy and go find them. You could re-activate that line of code if you wanted, if you prefer them to need radars to reveal the nests before they can be targeted.

Brickcaster commented 8 years ago

I asked for a "is entity known?" in forums and they said that info isn't stored in the game. The minimap is just a picture. Checking to see if the relevant chunk is charted wouldn't fix anything. It might be possible to check the minimap to see if the color for player force is red but that would be a weird hack. I'll just close this.

kyranf commented 8 years ago

Yep, there is no good way to handle line of sight or fog of war and it might end up being too cpu intensive to do it in a hacky way. The check for charted or not was a simple way to get a pseudo-fog of war droid targetting mechanic but yeah once it has been revealed it would always be a valid chunk to move to attack