electronic decision making #9

Open
opened 2022-04-06 20:23:07 +00:00 by nephele · 1 comment
Owner

Now that the energy distribution works there should be a way to programmatically turn consumers on or off, for example sparklights draw progressively more power the brighter they are so There should be a way to tell them which mode to use. also to for example only illuminate when there is a need to, say with an light sensor (though time might make more sense, time is the only thing affecting global ambient light at the moment...)

So this might be similar in concept to mesecons or redstone, but probably different in execution... have to think about this more

Design:
A controller block connected to a grid runs scripts periodically (energy tick?) these scripts take inputs which are output from blocks (for example light level) or global stuff. It then takes actions like enabling blocks or setting blocks differently.

  1. Implement new api for existing blocks
  • charger
  • furnace
  • light
  • generator
  • solar
  • quarry
  • capacitor
  • Add tool to configure nodes
  • Add node to configure attached nodes
  • Make multimeter show options
  • Make multimeter show outputs
  1. Implement controller block that does the magic for the grid logic
Now that the energy distribution works there should be a way to programmatically turn consumers on or off, for example sparklights draw progressively more power the brighter they are so There should be a way to tell them which mode to use. also to for example only illuminate when there is a need to, say with an light sensor (though time might make more sense, time is the only thing affecting global ambient light at the moment...) So this might be similar in concept to mesecons or redstone, but probably different in execution... have to think about this more Design: A controller block connected to a grid runs scripts periodically (energy tick?) these scripts take inputs which are output from blocks (for example light level) or global stuff. It then takes actions like enabling blocks or setting blocks differently. 1) Implement new api for existing blocks - [x] charger - [x] furnace - [x] light - [x] generator - [x] solar - [x] quarry - [x] capacitor 2) - [ ] Add tool to configure nodes - [ ] Add node to configure attached nodes - [x] Make multimeter show options - [x] Make multimeter show outputs 3) Implement controller block that does the magic for the grid logic - [ ] ask, nicely, @syrupthinker to do the thing
nephele added the
Game mechanic
label 2022-04-06 20:27:22 +00:00
Author
Owner

furnace
* enabled
* accept items (input inventory)
* accept item removal (output inventory)
<- input items
<- output items
<- remaining burn time (1/2)

light
* enabled
* brightness level
<- brightness level

BOOL = 10
INT = 12
groups = {
        sparkopt_enabled = BOOL
        sparkopt_brightness = INT
},

sparktechnode:setoption()
sparktechnode:getoption()

local setoption(node, name)
	node._sparkvalues[name] = true
	node._sparkoptionschanged(name)
end

local getoption(node, name)
	return node._sparkvalues[name] 
end

_sparkoptionchanged = function(name) end

_sparkvalues = {
	enabled = true
	brightness =  3
}

_sparkoutputs = {
	brightness = function(node) return 3 end
}

_spark.

generator
* enabled
* accept/deny item drops
<- remaining burn-time
<- remaining items

_sparkoutputs = {
	burntime = function(node)
		return node:get_meta("burntime)
	end,
	items = function(node)
		return node:get_inventory():get_list("fuel")
	end
}

solar panel
* enabled
<- light-level
<- light level ambient (assuming the damn engine has something, or we emulate it)

quarry
* enabled
* max speed
* depth (emo)
* accept/deny item leaving
<- current items
<- reached depth (relative to quarry)

capacitor
* enabled
* min fill
* max fill
<- energy-level

charger
* enabled
* min charge
* max charge
<- current item
<- current charge

``` furnace * enabled * accept items (input inventory) * accept item removal (output inventory) <- input items <- output items <- remaining burn time (1/2) light * enabled * brightness level <- brightness level BOOL = 10 INT = 12 groups = { sparkopt_enabled = BOOL sparkopt_brightness = INT }, sparktechnode:setoption() sparktechnode:getoption() local setoption(node, name) node._sparkvalues[name] = true node._sparkoptionschanged(name) end local getoption(node, name) return node._sparkvalues[name] end _sparkoptionchanged = function(name) end _sparkvalues = { enabled = true brightness = 3 } _sparkoutputs = { brightness = function(node) return 3 end } _spark. generator * enabled * accept/deny item drops <- remaining burn-time <- remaining items _sparkoutputs = { burntime = function(node) return node:get_meta("burntime) end, items = function(node) return node:get_inventory():get_list("fuel") end } solar panel * enabled <- light-level <- light level ambient (assuming the damn engine has something, or we emulate it) quarry * enabled * max speed * depth (emo) * accept/deny item leaving <- current items <- reached depth (relative to quarry) capacitor * enabled * min fill * max fill <- energy-level charger * enabled * min charge * max charge <- current item <- current charge ```
nephele added the due date 2010-04-01 2022-04-09 18:08:05 +00:00
nephele added the
Api
label 2022-04-10 00:26:21 +00:00
nephele added the
v-next
label 2022-04-19 09:15:14 +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'.

2010-04-01

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