Construction Probe

by Eketek

Scan new constructions within and around a logistics network to assist in automated delivery of construction materials. Proficiency in the use of combinators for mixed shipments is recommended. Or a good set of blueprints.

Content
1 year, 9 months ago
1.1
208
Logistics Logistic network Circuit network Blueprints
Owner:
Eketek
Source:
N/A
Homepage:
https://forums.factorio.com/viewtopic...
License:
MIT
Created:
2 years ago
Latest Version:
1.4.0 (1 year, 9 months ago)
Factorio version:
1.1
Downloaded by:
208 users

The Construction Probes mod is a *performant and non-hand-holding means to automate the delivery of materials to construction sites. This will monitor construction-related activity or events, will determine what the material requirements are for it, and will emit pulsed circuit-network signals at the nearest valid construction probe (a buildable circuit-connected entity). These signals may then be used either as inputs into your circuit-controlled logistics system, or as statistics to capture & display. It is up to you to design and build the logistics system.

This specifically monitors blueprint placement, ghost-building, direct construction (items held by you), and destruction. As such, it will assist in construction of new builds, in repairs after destructive events, and replenishment of personal supplies.

Construction probes uses three methods for determining which probe(s) to send signals to. The first method is to check to see if construction is taking place within a probed logistics network (common case, handled fastest). The second method is to search for the nearest probed logistics network. The third method is simply to search for the nearest construction probe. Combined, this allows construction probes to recognize construction within a logistics network, construction on the periphery of a logistics network, and construction out in a remote/undeveloped area with a minimal setup. If there are multiple probes attached to a logistics network, signals for construction associated with that network will be sent to all probes within that network.

Construction probes mod is also performant. There is no continuous scanning of large sections of your base. The only per-tick activity occurs while sending circuit-network signals (for which it uses only a transient event handler). All construction monitoring is accomplished using construction events. The only heavyweight operations involve placement of excessively large blueprints.

For interoperability, construction probes mod handles 'script_raised_built' events, and if that is not enough, it also includes an interface for directly emitting signals from construction probes (though chances are if you want to directly manipulate construction probes from another mod, you'd be better off either using your own circuit-connected entities or forking this mod and adjusting it to suit your intent). See 'Integration with other mods' in readme.txt for details.
ng

(*) Performance Test Information
Performance testing thus far is quite subjective, but it is the best I have thus far (and is better than the aspirational statement I've been running with for a long time).

Test setup:
1. Enable Creative Mod and Construction Probes Mod, but leave other mods out.
2. Start a game, and use a map with high water coverage and high scale. (A lot of land to place blueprints on, and a lot of water around to prevent placement of large amounts of said blueprints)
3. Set up a large area with radar visibility and logistic network coverage.
4. Place a construction probe with trivial setup in the logistic network (memory cell wired to construction probe).
5. Create or import an unreasonably large blueprint consisting only of entities (preferably an entire megabase). Put the blueprint in your blueprint library.
6. Create or import an unreasonably large blueprint consisting only of tiles (100000+ tiles will do). Put the blueprint in your blueprint library.
(NOTE: blueprints from the blueprint library and blueprints from the inventory use different handling, so all tests need to be duplicated to cover both code paths)

Test #1: Using the blueprint library, place the entity blueprint on land. Ensure that the cost of the blueprint is stored in the wired memory cell.
Using the blueprint library, place the entity blueprint on land (with shift+click) such that the mouse cursor is within the logistic network, but the majority of entities are over water. Ensure that the cost of the blueprint is stored in the wired memory cell.

Test #2: Using the blueprint library, place the tile blueprint on land. Ensure that the cost of the blueprint is stored in the wired memory cell.
Using the blueprint library, place the tile blueprint on land (with shift+click) such that the mouse cursor is within the logistic network, but the majority of entities are over water. Ensure that the cost of the blueprint is stored in the wired memory cell.

Test #3: Repeat test #1, but either use a blueprint from your inventory, or copy & paste from the map.
Test #4: Repeat test #2, but either use a blueprint from your inventory, or copy & paste from the map.

During all tests, ensure you are doing something to get visual feedback from the game which can indicate a major performance hit (such as walking or scrolling in map view).

These tests aim to compare the performance hit of scanning a blueprint versus scanning the blueprint plus actually placing the entities in the blueprint. The intention of the unreasonably large blueprints is to induce an easily observed performance hit. The use of large water areas is to create a situation in which the large blueprint does not carry as large of a performance impact (as of 1.1.79, the Factorio handles blueprint placement much faster if large amounts of it is unplaceable due to presence of water). Construction Probes does the same scan regardless of what gets placed in a world (only looks at what's in the blueprint, and not at the actual result of its placement).

The testing I have done thus far has always had placement over land cause a large performance hit, but placement over water cause only a minor one (using the same blueprint) -- this suggests that the performance cost of a Construction Probes scanning operation is less than the performance cost of Factorio's internal placement routines (at least as of 1.1.76).

The other parts of the Construction probes mod are probably negligible by comparison. Other routines to consider would be the one which pulses out complex signals, and the one which finds the best available construction probe (when a logistic network is not immediately available) -- but these are not expected to be an issue unless there simply are a lot of construction probe entities in your world (which may necessitate incorporating some reasonable administrative controls if this mod gets picked up for substantial multiplayer use).