Configurable Forcefields

This is the place to request new mods or give ideas about what could be done.
Post Reply
Akillibirisi
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Jan 07, 2021 11:23 pm
Contact:

Configurable Forcefields

Post by Akillibirisi »

I've long been thinking about this and since I don't have any modding experience, just wanted to leave it here hoping it to inspire somebody.

Forcefields are invisible physical barriers surrounding any structure, protecting them from damage. They run on high currents of electricity.

The damage a structure with forcefield protection takes is first reflected to the forcefield until depleted before actually damaging the structure itself.

Forcefields would regenerate themselves after sustaining damage, just like a self-repair.

Here's my implementation:

The Forcefield Generators would generate the forcefields and slowly regenerate the barrier after it is damaged, they would have a low amount of capacity serving as forcefield health since their primary purpose is to replenish forcefield health rather than increasing maximum health. Upon complete depletion of the total forcefield health (including Forcefield Capacitors explained below), the generators would shut down and remain unoperational for several seconds before starting to replenish the forcefield health again, leaving the forcefield protected structures defenseless during its recovery.

The Forcefield Capacitors would serve to increase the health capacity of forcefields. Basically, they increase the maximum health of the forcefield.

Forcefield Radiator Poles would work similar to electric poles. They would have a certain coverage area around it which applies forcefield protection to the structures contained within. Structures would still be completely protected with forcefield even if some portion of them remains outside of the coverage area of the pole, just like the way electric poles do. This would be better if there is an option to configure the individual tiles or structures affected by forcefield protection since the player may want to exclude some areas from protection. Forcefield Radiator Poles would be protected by the forcefield they emit as well.

Forcefield Walls would function as regular walls as long as powered by forcefield radiator poles' coverage area.

And lastly, the forcefield wiring, which would be used to interconnect the generators, capacitors and radiators to function together. This way seperate setups will become possible.

The forcefield generators and capacitors must have high electric costs to keep things balanced. Electricity usage should drastically increase when shields are recharging after sustaining damage. Additionally there should be a passive power cost per tile that is protected with forcefield using the forcefield radiator pole to prevent the player from mass protecting their whole facility at no cost.

I don't even know if the current modding API allows for these features, please don't hesitate to share your thoughts.

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Configurable Forcefields

Post by PFQNiet »

So I could imagine this working with regular power poles rather than dedicated forcefield poles.

When an entity takes damage, check what electric network ID it's connected to. Scan the surface for forcefield generators owned by the damaged entity's force. If one exists on the same electric network, drain power from it proportional to damage taken and heal the entity to nullify the damage.

The forcefield generator can then simply be an electric-energy-interface. The "batteries" can be accumulators with usage priority set to primary-input, and energy may be drawn from them instead of the generator directly.

Akillibirisi
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Jan 07, 2021 11:23 pm
Contact:

Re: Configurable Forcefields

Post by Akillibirisi »

PFQNiet wrote:
Fri Jan 08, 2021 9:07 am
So I could imagine this working with regular power poles rather than dedicated forcefield poles.

When an entity takes damage, check what electric network ID it's connected to. Scan the surface for forcefield generators owned by the damaged entity's force. If one exists on the same electric network, drain power from it proportional to damage taken and heal the entity to nullify the damage.

The forcefield generator can then simply be an electric-energy-interface. The "batteries" can be accumulators with usage priority set to primary-input, and energy may be drawn from them instead of the generator directly.
I believe that's a viable option to skip all the hassle for designing new items while offering the same functionality, I just thought it would be characteristic to implement some unique mechanics. But still, simply absorbing all incoming damage by electricity is still too overpowered for my expectations, as one could throw in an additional series of nuclear reactors for the sole purpose of protection and never ever have to reconsider their defenses. I'd only propose such a powerful tool to be available late-game. Construction costs for the forcefield components and their massive electricity consumption should be compelling.

But, yeah. I just realized accumulators are near perfect templates for forcefield capacitors, if only the rate at which they recharge could be attributed to the generators instead then that's perfect. But I'd still rather have the connections function seperately from main power grid for the forcefield radiators and requiring only capacitors and generators to be powered that way for an added difficulty and uniqueness, a different medium to transfer "forcefield energy" so to say.

PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Configurable Forcefields

Post by PFQNiet »

If you want the forcefield to be transmittable then the vanilla electric network is the best bet. Another alternative would be to have the forcefield generators work on a surrounding area. Forcefield-specific batteries may be harder but with this system you could say that when an entity is damaged, search for a forcefield generator in range and pull energy from it to absorb the damage.

You can limit the input flow rate for the generator to restrict how fast it can regenerate, allowing large attacks to punch through the forcefield even if you have large amounts of power.

Having forcefield-specific "electricity" would involve a lot more scripting but could be done by having the "batteries" be some other kind of storage. One option might be a pump with no actual fluid box connections (allowing it to store fluid and be connected to electric networks). The script can then add or remove a fake "fluid" to represent the energy being stored. It's definitely a hack, but it could totally work!

Akillibirisi
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Jan 07, 2021 11:23 pm
Contact:

Re: Configurable Forcefields

Post by Akillibirisi »

PFQNiet wrote:
Fri Jan 08, 2021 2:32 pm
If you want the forcefield to be transmittable then the vanilla electric network is the best bet. Another alternative would be to have the forcefield generators work on a surrounding area. Forcefield-specific batteries may be harder but with this system you could say that when an entity is damaged, search for a forcefield generator in range and pull energy from it to absorb the damage.

You can limit the input flow rate for the generator to restrict how fast it can regenerate, allowing large attacks to punch through the forcefield even if you have large amounts of power.

Having forcefield-specific "electricity" would involve a lot more scripting but could be done by having the "batteries" be some other kind of storage. One option might be a pump with no actual fluid box connections (allowing it to store fluid and be connected to electric networks). The script can then add or remove a fake "fluid" to represent the energy being stored. It's definitely a hack, but it could totally work!
I tried to achieve in-depth configurability with the forcefield-specific setup, for example one may invest in regeneration speed with generators while keeping the maximum capacity low or vice-versa, also managing equal distribution of the incoming damage among the forcefield sources when an entity is protected with 2 or more seperated forcefields must be taken into account to avoid potential bugs. This will require the components to communicate with each other, which I attempted to achieve with custom cables, any other way of doing it would be fine as well.

I'd expect forcefield generators and capacitors to be big, bulky and resource-intensive, not to mention power cost. That's why I wanted to be able to utilize their power elsewhere far from them. If the regular poles could be customized to accept a different wiring that should do the trick. Also smaller poles mean more flexibility with the layout. As for the customization, they might come in different types each with different area of effect, just like regular poles, or there may be an option to choose individual tiles or entities within its range to be affected by protection.

Since I'm not familiar with the API, I can't quite predict what kind of build would make it easier to implement.

Post Reply

Return to “Ideas and Requests For Mods”