Rework grid to use timer instead of abm #10

Open
opened 2022-04-08 20:25:08 +00:00 by nephele · 0 comments
Owner

Basically go from this:
-> abm checks all energy nodes
--> abm runs energy_distrib on master
-> random on_timer events on blocks on different timescales eat energy

To this:
-> net_master has a timer on a predictable timestamp
--> master force loads all members
--> energy_distrib is ran on master node
--> master node calls _sparktechwork (or similar function) on all nodes which perform work and eat energy

Each energy node would have a _sparktechwork function that does the actual sparktech related task, the on_timer function would be replaced with a default implementation from sparkapi. It will be enabled and disabled by the net rebuilding code automatically.

Also, use the "elapsed" function from on_timer to catch up lost stuff, this way, unlike an abm, we can catch up everything that should have happened in that time :D (assuming all sparkwork functions are coded to perform the operation and don't artificially delay anything)

Should also consider whether "enabled" state is considered for grid energy distribution

Basically go from this: -> abm checks all energy nodes --> abm runs energy_distrib on master -> random on_timer events on blocks on different timescales eat energy To this: -> net_master has a timer on a predictable timestamp --> master force loads all members --> energy_distrib is ran on master node --> master node calls \_sparktechwork (or similar function) on all nodes which perform work and eat energy Each energy node would have a \_sparktechwork function that does the actual sparktech related task, the on_timer function would be replaced with a default implementation from sparkapi. It will be enabled and disabled by the net rebuilding code automatically. Also, use the "elapsed" function from on_timer to catch up lost stuff, this way, unlike an abm, we can catch up everything that should have happened in that time :D (assuming all sparkwork functions are coded to perform the operation and don't artificially delay anything) Should also consider whether "enabled" state is considered for grid energy distribution
nephele added this to the (deleted) milestone 2022-04-19 09:12:41 +00:00
nephele added the
v-next
Api
labels 2022-04-19 09:16:05 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: nephele/minetest-gamemode-orion#10
No description provided.