Applied Energistics 2

Applied Energistics 2

156M Downloads

Add a way to chunkload ME networks

yueh opened this issue ยท 4 comments

commented

Goal

As we expect each ME network is fully chunkloaded for various reasons like consistency, performance and similar, we should provide a native way to achieve this without relying on 3rd party mods.

Add a way to easily track which chunks/worlds a network span (prerequisite)

Currently there is no fast/easy way to determine which chunks a ME network does occupy. It would have to iterate over every grid node and their respective machine and use this to calculate the area each time a network changes.

A simple solution might be to introduce a new IGridCache to track the chunks/worlds just when a grid node is added or removed from a network. It could also track various other statistics for a later use like metrics.

Add the chunk loader itself

Each chunkloader should be pretty straightforward and not force the player to deal with technical details like chunk borders and potentially missing a single one and causing various issues.

To provide a better QoL, each network should just require a single chunk loader similar to a security station and then simply load every chunk the network occupies without forcing a player to deal with the range at all.

In case it is also used for other mods, it might be an idea to calculate a continuous area. e.g. when a network occupies the outer ring of a 3x3 chunk area, but not the middle one. In this case adding that chunk might be a valid option. As well as add a 1 chunk outline as additional buffer around the occupied area. But that could easily load too many chunks.

Balancing

As AE2 does not provide any regenerative resource beside some edge cases like matter balls or singularites, they should not really require some items or fluids as fuel.

An energy requirement like x^numberOfChunks ae/T on the other hand would be certainly be an option to strongly consider.

Optional features and improvements

As it might be a bit tedious to add a chunk loader to every single subnetwork, it might be an option to provide an improved quartz fiber which extends the covered area as well as potentially also providing a proxy for the security station.
However as grids to some degree are directional and it depends on which side the quartz fiber between two networks is located, it behaves differently and might make this feature not possible or be inconsistent in its behaviour.

Impact on servers

As this is would be a new block, servers could simply disable the recipe for them, if they don't want to offer this feature.

commented

Pretty much no. The goal is to have a simple system working out of the box and not tie its function to various hidden conditions.

Unloading chunks once a player goes offline just introduces the issues this aims to prevent back again when other machines suddenly start loading surrounding chunks repeatedly. Or some players sharing a base, but for whatever reason do not have full access for the ME network and it suddenly acts weird once the owner is offline.
If this is a desired behaviour for a server admin, that is certainly fine but they will have to provide their own solution for it.

commented

So obviously this will have quite the impact on servers, disabling the recipe will be okay, but obviously you will have downsides when only parts of the network are loaded, which this is trying to fix in the first place.

Would it be possible to add a config to only do the chunkloading of the whole network when the owner of the network or a player with full perms in the security station is online?

commented

maybe multiply power consumtion per chunk loaded and add a feature to the wrench or viewcell to view chunk borders to allow people mitigate power consumption issues by building more compact and planned in general

commented

Here's my suggestion.

To keep the original idea of simplicity, all devices critical for the network to function should innately keep their chunk loaded for free. This would include Controllers, Drives, Security Terminals, and maybe Energy Acceptors/Cells. Endpoints like Interfaces, Storage Buses, Importers, Exporters, and P2P Tunnels can have an upgrade card inserted that will supply chunkloading for a power cost, either static or multiplicative of the endpoint's power usage.

Again, for simplicity, the documentation for the chunkloading card should say it keeps everything in a 16-block radius loaded, but internally loads a 3x3 chunk. This should be simple enough for people that don't understand chunk borders, but can still count block distance.