Mesecons guidelines

From Pandorabox
(Redirected from Mesecons optimization)
Jump to navigation Jump to search
just... why?
Screenshot 20190918 192832.png

Overview

This page should help to keep the mesecons performant and efficient so that everybody can play with them

On/Off switches

  • Please add On/Off switches to your machinery and toggle them on only if you use them

Intervals

  • Use intervals of 5 seconds or more, depending on how much is connected to the wire
  • Shorter intervals are ok if the executed action is not that heavy (for example: a simple light or signal)

Size/Length limits

  • Try to limit the amount of machines triggered by LuaC's or blinkys
This should work fine with a 3 to 5 seconds interval
Monitoring-mesecons-2.png

Luacontroller with on/off switch

The following program generates a signal-change every 5 seconds. It can be toggled with a switch on port A and generates the signal on port B

if event.type == "program" or event.type == "interrupt" then
 interrupt(5)
 if not pin.a then
  return
 end
 port.b = not port.b
end

Debugging

  • Use the Monitoring page to see how the mesecons are working right now: https://monitoring.minetest.land/d/LjYzPumWz/mesecons?orgId=1&refresh=5s
  • You can check out the lag-stats, if the average value is above ~750 milliseconds there is something wrong...
  • Please also enable the mesecons hud with "/mesecons_hud on" to see how much CPU usage the current mapblock/position consumes
  • You can also see the Penalty the usage results in. Penalty refers to the throttling of mesecons activity in that mapblock.
Example of heavy mesecons activity
Monitoring-mesecons-1.png