The Perfect Energy System

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Lathanael

New Member
Jul 29, 2019
959
0
0
Side note 2:

I am working on a realistic Nuclear Reactor mod - primarily intended to serve as the interface between IC2 and RotaryCraft, as that is otherwise nonexistent.
In that realism will be failure. If you fail to cool it down, or pull a Chernobyl and retract all the control rods, it will melt down, causing a possible reactor containment breach by way of hydrogen explosion and thus spewing radioactivity (as an ambient effect rooted to the location) over a large area. In the interest of gameplay, I do intend to either make it decay or be able to be cleaned up, however.

Welcome to the FTB Forums Reika :)
This reactor mod sound very intersting i'll stay tuned and watch your threads!
 
  • Like
Reactions: SpitefulFox

Reika

RotaryCraft Dev
FTB Mod Dev
Sep 3, 2013
5,079
5,331
550
Toronto, Canada
sites.google.com
Welcome to the FTB Forums Reika :)
This reactor mod sound very intersting i'll stay tuned and watch your threads!
I plan to make the ReactorCraft thread on the MC forums tonight. Now, that mod is still very in-development, but I have already written the core of the nuclear reaction simulation engine, so I will have screenshots.
 
  • Like
Reactions: Eyamaz

Caaameron

New Member
Jul 29, 2019
16
0
0
My 4-step plan

1. Create a pack without IC2 or EU

2. Change pipes/conduits so they all have a min and max MJ limits. (Too high and they break, too low and there is loss). Add transformer pipes to step up/down voltage

3. Create multiblock structures that can generate huge amounts of MJ/t

4. Add endgame items that require huge amounts of MJs (no MPS and Quantum Suit makes other armor viable)
 
  • Like
Reactions: SpitefulFox

Hydra

New Member
Jul 29, 2019
1,869
0
0
Although I like how it works I can see simulations like these put a rather hefty strain on the server. How are you taking that into account?
 
  • Like
Reactions: SatanicSanta

Lathanael

New Member
Jul 29, 2019
959
0
0
Although I like how it works I can see simulations like these put a rather hefty strain on the server. How are you taking that into account?
It depends on how often you let those simulations run. If you only do it every second, or every 10 Ticks the load is really small compared to most other things.
 
  • Like
Reactions: Eyamaz

Hydra

New Member
Jul 29, 2019
1,869
0
0
It depends on how often you let those simulations run. If you only do it every second, or every 10 Ticks the load is really small compared to most other things.


I'm a java dev so you don't have to explain this to me. I am asking the mod maker. If every 'hit' has the possibility of generating another with very large systems this is prone to give runaway simulations. Also; this isn't simply a 1+1 calculation, you're actually checking the presence of other blocks in a certain radius, which is relatively expensive.

The author could for example create a multiblock structure that only does the simulation when the multiblock changes, and aside from that just paints pretty neutrons. That's much less costly than actually simulating every neutron collision every X ticks because there will be a lot of neutrons flying around in big reactors.
 

draeath

New Member
Jul 29, 2019
456
0
0
Yep, in most things calculating things up-front is best unless they are typically one-off events. Same with graph traversal. Do it once, and cache the result.
 

King Lemming

New Member
Jul 29, 2019
664
0
0
Yep, in most things calculating things up-front is best unless they are typically one-off events. Same with graph traversal. Do it once, and cache the result.

That would indeed be the case, if chunks didn't load/reload. ;) Conduit code is pretty crazy.
 

Reika

RotaryCraft Dev
FTB Mod Dev
Sep 3, 2013
5,079
5,331
550
Toronto, Canada
sites.google.com
The code is actually in the Neutron entities. On impact with each block - which happens about 5 times a second, given their translational velocity - it checks a few properties. Simplified:
Is reactor machine (done with ID & meta test)? Yes -> call onNeutron(); No:
Is steel block (done with ID & meta test)? Yes -> 80% chance of absorption; No:
Is concrete block (done with ID & meta test)? Yes -> 65% chance of absorption; No:
Is opaque cube? Yes -> Get blast resistance -> chance of absorption; No:
get Light Opacity -> chance of absorption

As for issues with calculations, they are surprisingly light. Of course if you have a runaway reaction that has 10000 neutrons in a reactor, it will lag, but that is from so many entities, not from any code they are running.

Additionally, you never will be able to get that sort of reaction to sustain long enough to pose an issue; the reactor will overheat and melt down first.


Finally, on why I am doing it this way rather than faking it:
I rather suspect that this method is actually calculationally simpler than having a bunch of TEs check their surroundings at any rate fast enough to be convincing.
Additionally, the reactors are being approached using the concept of emergent behavior, rather than hard-coding everything. Like other emergent engines (like Conway's Game of Life, or, one could argue, even Minecraft itself), the results are far more flexible and powerful than anything coded directly.
 
  • Like
Reactions: SpitefulFox

draeath

New Member
Jul 29, 2019
456
0
0
That would indeed be the case, if chunks didn't load/reload. ;) Conduit code is pretty crazy.

Chunks make me angry :p

You could implement a kind of 'spot loader' functionality in conduits/pipes, such that any chunk with them in it is forced to stay loaded. Shouldn't be too terrible if it only loads the required chunks and not neighbors. Ideally. Of course if you're trying to run an 8-player server on a single-core 1.0ghz box... yea :p

My reasoning there is that if a player is building machinery with pipes/conduits, they probably want them to function when they turn their back to them, after all...
 

Siro

New Member
Jul 29, 2019
638
0
0
I've been seeing, and maybe contributing, a lot of criticism towards the EU and MJ systems and some of the new changes coming out, and that got me wondering:

What would make a good energy system? I'm curious to see what people think would make for a good system as opposed to hearing what people hate about existing systems. :)

Most importantly, though, is what would make a fun energy system to play with. :p

For me, a good+fun energy system would be one that grows organically with the tech tree. Each piece has to stay useful and relevant as you move up the tree with the focus on being able to do more things with more power. So if you start out with a generator or an engine, upgrading that wouldn't be just adding more or crafting it into another recipe; it would simply become part of a larger multiblock device. Machines would work the same way as well, adding functionality or speed as more components are added.

Basically, I don't like it when I have leftover stepping stone machines/power production that just sits in a chest because my other option is to toss it into lava now that I don't need it anymore. I also don't like making the same block over and over when I want more or faster power for something. And there should be things to want more power for. Maybe interesting lights or interesting gadgets or targetable teleporters or maybe even crazy rube goldberg machines that don't actually do anything but look really amazing doing it.
 
  • Like
Reactions: SpitefulFox

SatanicSanta

New Member
Jul 29, 2019
4,849
-3
0
Chunks make me angry :p

You could implement a kind of 'spot loader' functionality in conduits/pipes, such that any chunk with them in it is forced to stay loaded. Shouldn't be too terrible if it only loads the required chunks and not neighbors. Ideally. Of course if you're trying to run an 8-player server on a single-core 1.0ghz box... yea :p

My reasoning there is that if a player is building machinery with pipes/conduits, they probably want them to function when they turn their back to them, after all...
That would be incredibly OP since people generally make conduits by the stack+. ChickenChunks would become useless.
 

CrissHill

New Member
Jul 29, 2019
196
0
0
That would be incredibly OP since people generally make conduits by the stack+. ChickenChunks would become useless.


I wouldn't call that OP since chunkloaders are almost free (on most servers). However, having a separate chunkloaders give more control to the player. You don't always want to chunkload a power network (think having a steamboiler in a non-loaded chunk = not consuming fuel when you dont need it ). So actually not having power networks chunkload makes it easier for people :)
 

SatanicSanta

New Member
Jul 29, 2019
4,849
-3
0
I wouldn't call that OP since chunkloaders are almost free (on most servers). However, having a separate chunkloaders give more control to the player. You don't always want to chunkload a power network (think having a steamboiler in a non-loaded chunk = not consuming fuel when you dont need it ). So actually not having power networks chunkload makes it easier for people :)
Since when are Chunk Loaders free? They require an enchantment table, gold, and an ender pearl.
 

Hydra

New Member
Jul 29, 2019
1,869
0
0
Additionally, the reactors are being approached using the concept of emergent behavior, rather than hard-coding everything. Like other emergent engines (like Conway's Game of Life, or, one could argue, even Minecraft itself), the results are far more flexible and powerful than anything coded directly.

Ofcourse. But flexibility often come with a high tradeoff; resource consumption. I'm assuming you're going to test this extensively because sofar your power generators require a LOT more calculations than say a bunch of boilers for example. And it's just the 'heat' generator part, you also need some form of turbines (but that's hardly an issue, animations are mostly a client-side strain). Don't forget you want to be in modpack together with a lot of other mods that already take their share of CPU power to run. I would hate to see all your hard efforts be worthless because your mod got a reputation of being a resource hog.

Regarding what you're doing; it's a lot more complex than simple calculations. Counting is easy for CPU's, branching sucks for CPU's and you're doing a lot of branching. Misprediction leads to pipeline flushes. Pipeline flushes leads to the dark side. ;)
 

draeath

New Member
Jul 29, 2019
456
0
0
Chunk loaders should be free and easy. They overcome a technical limitation in my mind - ideally there would be no concept of chunks loading/unloading - everything that is, is.
 

Siro

New Member
Jul 29, 2019
638
0
0
Honestly pipe and energy networks should not be unloading at all anyway if they're making energy/items/liquids available to machines with work, tanks/storage with room or vice versa. If one recalls, the fiasco around xycraft tanks was largely related to chunks unloading and reloading because items/liquid were in transit through chunks that weren't chunkloaded. Energy/Item/Liquid networks that keep their entire network loaded while they're doing stuff would be a GOOD thing, if only to prevent constant load/unload. Plus, it could cut down on people chunkloading their entire base just to prevent their pipe networks/machines from breaking all the things as such networks could be made to spotload only the chunks they are in instead of a radius.
 
  • Like
Reactions: PierceSG

SatanicSanta

New Member
Jul 29, 2019
4,849
-3
0
Yes, sorry. I forgot how hard all of those materials are to get.
ender pearls are a pain without ee3. And even so, the point wasn't how difficult it was to get, it was that it requires something.


Sent from a rich kids phone that I stole. (I'll regift it soon)