Anuken / Mindustry

The automation tower defense RTS
https://mindustrygame.github.io
GNU General Public License v3.0
22.55k stars 2.95k forks source link

In Logic processors, using "Unit Locate" on enemy blocks returns null for "building", even when "found" is 1. #5015

Closed NoExit4U closed 3 years ago

NoExit4U commented 3 years ago

Platform: Windows

Build: steam build 126.1

Issue: Unit Locate on enemy blocks returns null for "building", even when found returned "1".

Why I think this is a bug: It's restricting what is possible with a Logic Block and is counter-intuitive.

As an example: I'm making a patrolling AI Horizon that will bomb nearby enemy turrets until the turret is dead.

Using a new "Unit Locate" to see if it is still alive is a workaround but can sometimes return a different turret because it's a Horizon and it's moving around the target.

There may also be other use cases for this, for example when wanting to know what type of turret the block is or if it is shooting or where it is aiming.

How I tested the issue: This is tested with the following Logic code: 20210328172717_1

The message: (there are 6 enemy Cyclones above) 20210328171911_1

When changing the "enemy" to "false", it can find the Duo turret: 20210328172107_1

Steps to reproduce: Open the save file and look at the message block.

Link(s) to mod(s) used: None were used.

Save file: 591.zip


Place an X (no spaces) between the brackets to confirm that you have read the line below.

Anuken commented 3 years ago

This isn't a bug. The logic block intentionally prevents you from getting enemy buildings; otherwise, you would be able to remotely read arbitrary enemy structure information across the map.

NoExit4U commented 3 years ago

Reading arbitrary enemy (and friendly) structure information across the map is exactly what I'm trying to do as a map maker.

Except for the content of a Core and maybe Power related sensors, I don't see a lot of reasons why sensors like Health, Team, Name, and Type should not be possible.

Anuken commented 3 years ago

Except for the content of a Core and maybe Power related sensors, I don't see a lot of reasons why sensors like Health, Team, Name, and Type should not be possible.

There is no way to prevent using "overpowered" sensors like items and power without being even more un-intuitive and arbitrary.

Even reading health of the enemy core across the map is overpowered. I would rather not have any building returned at all.

joshuaptfan commented 3 years ago

IMO enemy building presence (basic "exists and is alive", and perhaps type) should be detectable, just not any stats, like health or contents.

Like, only things you can see by looking at a building from the outside.