Fast way to find a spawner given an entire surface/force

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 587
Joined: Tue May 19, 2015 1:56 am
Contact:

Fast way to find a spawner given an entire surface/force

Post by Reika »

Any spawner will do. In all likellihood this would be similar to the internal code used by the artillery weaponry, which also find spawners - presumably without iterating across all entities on a surface.
Image
User avatar
dog80
Filter Inserter
Filter Inserter
Posts: 290
Joined: Thu Dec 08, 2016 11:57 pm
Contact:

Re: Fast way to find a spawner given an entire surface/force

Post by dog80 »

art towers have a position and a radius so the area is clear - how you want to do that without position and radius though?
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 587
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Fast way to find a spawner given an entire surface/force

Post by Reika »

dog80 wrote:art towers have a position and a radius so the area is clear - how you want to do that without position and radius though?
This prospective function could easily request that - though in my case, the radius would be infinity.

My point is that the artillery does not lag like a massive entity scan would, so they must use some internal game engine lookup that I would like exposed in the Scripting API.
Image
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5348
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Fast way to find a spawner given an entire surface/force

Post by Klonan »

Reika wrote:
dog80 wrote:art towers have a position and a radius so the area is clear - how you want to do that without position and radius though?
This prospective function could easily request that - though in my case, the radius would be infinity.

My point is that the artillery does not lag like a massive entity scan would, so they must use some internal game engine lookup that I would like exposed in the Scripting API.
The artillery scans 1 chunk per tick, slowly circling out from its own position, and searched the chunk for any targets

I would say the fastest way is to just let the C++ do it, surface.find_entities_filtered{}
Rseding91
Factorio Staff
Factorio Staff
Posts: 15059
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Fast way to find a spawner given an entire surface/force

Post by Rseding91 »

If you want to get ahold of me I'm almost always on Discord.
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 587
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Fast way to find a spawner given an entire surface/force

Post by Reika »

That is not useful to me, because I need to find a spawner specifically, not just any enemy (which in all likelihood is a unit).
Image
Rseding91
Factorio Staff
Factorio Staff
Posts: 15059
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Fast way to find a spawner given an entire surface/force

Post by Rseding91 »

Reika wrote:
That is not useful to me, because I need to find a spawner specifically, not just any enemy (which in all likelihood is a unit).
Then there's nothing that will do that. The closest is what the artillery does but it iterates chunks of entities at a time until it finds an entity in that chunk that's a spawner or turret.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Modding interface requests”