[Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

nisaea
New member
Posts: 5
Joined: Tue Dec 22, 2020 12:55

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by nisaea » Post

Hello o/

What an absolute monster of a thread... so forgive me if it has already been discussed but the search feature is not very helpful.

I ran into a mesecon issue in Minetest Extended so I posted there, and was kindly informed of the existence of this thread.

Basically, I've had heaps of fun playing with this mod and one thing leading to another, I've built a clock and two registers. However, the clock just stops from time to time because its FPGA overheats. I've added an extra delayer to my clock to slow it down, but it's kind of a bummer I have to half the frequency.

Would it help if I used standalone logic gates instead of a FPGA or will I still have intermittent faceplants down the line?

Now, to share the fun, here's the faulty clock:

Image

And the two registers:

Image

Thanks in advance!

Merak
Member
Posts: 116
Joined: Sat Nov 05, 2016 20:34

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Merak » Post

Would you direct me to a circuit design for the registers or latches?

User avatar
v-rob
Developer
Posts: 969
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by v-rob » Post

Essentially everything in Mesecons overheats at some point if it switches too much. The idea is that rouge circuits shouldn't be able to slow down a server, so they break at too high a speed. So, I would guess that a delayer or some other way to slow it down would be your only bet. Perhaps you could chain delayers in parallel in some way so that if one is delaying, another starts delaying in a tiered way to slow down the circuit, but not so much as a single delayer would. Alternatively, you could look in the code and change the amount of time the delayer delays.
Core Developer | My Best Mods: Bridger - Slats - Stained Glass

nisaea
New member
Posts: 5
Joined: Tue Dec 22, 2020 12:55

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by nisaea » Post

Merak wrote:
Wed Dec 23, 2020 04:28
Would you direct me to a circuit design for the registers or latches?
Of course! But I don't have a document or anything, I just followed Ben Eater's explanations about his breadboard 8-bit computer. You can find the first video he made about register logic here, and his D flip-flop video here.

I use 3 FPGAs for each bit:
- One for the logic needed between the bus, the load signal and the flip-flop input and output
- One for the D flip-flop
- One for the "tri state transceiver" which is just an and gate in my case (we can't have 3 states anyway), but I still used an FPGA for space management reasons.

Also added pretty lights to see what's stored from afar:
Image

Next step would be an adder, hopefully this isn't too hard to reproduce.
v-rob wrote:
Wed Dec 23, 2020 05:15
Essentially everything in Mesecons overheats at some point if it switches too much. The idea is that rouge circuits shouldn't be able to slow down a server, so they break at too high a speed. So, I would guess that a delayer or some other way to slow it down would be your only bet. Perhaps you could chain delayers in parallel in some way so that if one is delaying, another starts delaying in a tiered way to slow down the circuit, but not so much as a single delayer would. Alternatively, you could look in the code and change the amount of time the delayer delays.
I see, thanks a lot for the explanation and suggestions. I'm probably not going to touch the code, it's not that big a deal tbh. At least for now. xD

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Desour » Post

@nisaea:
There are setting for configuring the cooldown:
mesecon.overheat_max (max allowed heat),
mesecon.cooldown_time (how long it takes to cool down from max heat to 0, in seconds) and
mesecon.cooldown_granularity (defines how often the cooldown step is done, don't set this too low)
If you set the latter two high/low enough, overheats will get very unlikely or impossible: devices can only get active once every step. how long one minetest step is, is also controlled by some setting

Anyways, you might still want to keep the overheating and add some delay.

Delayers aren't the only way of delaying. Gates always have a delay of exactly two steps. One can place multiple diode gates after another and the delay in steps is always the same. Delayers on the other hand are not exact in terms of steps, which can result in signals that are only one step long, such signals can result in fast blinking in some circuits.

Btw. there still much potential to build your memory smaller, even without fpgas. ;)
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

nisaea
New member
Posts: 5
Joined: Tue Dec 22, 2020 12:55

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by nisaea » Post

Thanks a lot, that's very helpful info!
DS-minetest wrote:
Thu Dec 24, 2020 00:17
Btw. there still much potential to build your memory smaller, even without fpgas. ;)
Yeah, ik I'm probably not doign a very good job, but I'm very new to Minetest, and never played Minecraft or build a circuit irl so... even if it's not perfect I'm already pretty proud it works tbh x) (plus I'm playign on minetest extended so I don't have things like digilines or those lua thingies)

I'm just enjoying the learnign experience and trial and error process ^^ maybe I'll check out how other people did it later.

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Miniontoby » Post

nisaea wrote:
Thu Dec 24, 2020 00:36
Thanks a lot, that's very helpful info!
DS-minetest wrote:
Thu Dec 24, 2020 00:17
Btw. there still much potential to build your memory smaller, even without fpgas. ;)
Yeah, ik I'm probably not doign a very good job, but I'm very new to Minetest, and never played Minecraft or build a circuit irl so... even if it's not perfect I'm already pretty proud it works tbh x) (plus I'm playign on minetest extended so I don't have things like digilines or those lua thingies)

I'm just enjoying the learnign experience and trial and error process ^^ maybe I'll check out how other people did it later.
For more Ben eaters build check the Mesecons Computer Builds: viewtopic.php?f=12&t=24034
There are prebuild machines and downloads of them
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

Minsc
New member
Posts: 8
Joined: Fri Dec 04, 2020 13:42

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Minsc » Post

Old Phantasy Star Online player here.

I recalled the image of a Mese Crystal when suddenly the currency "Meseta" from PSO popped into my mind. Is there a conspiracy here? They look too similar.

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by PolySaken » Post

Minsc wrote:
Sat Dec 26, 2020 15:21
Old Phantasy Star Online player here.

I recalled the image of a Mese Crystal when suddenly the currency "Meseta" from PSO popped into my mind. Is there a conspiracy here? They look too similar.
Mese in minetest_game is based on a finnish(?) programming joke so it's somewhat plausible that PSO devs extrapolated from that, but It being a yellow diamond is too much of a coincidence. Either it's pure chance, or someone wasn't truthful about where 'mese' came from lol.
I'm betting on pure chance since the world is huge and the combination of yellow gem + 'mese' isn't weird or esoteric, just unlikely.
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

Minsc
New member
Posts: 8
Joined: Fri Dec 04, 2020 13:42

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Minsc » Post

PolySaken wrote:
Sun Dec 27, 2020 10:36
Minsc wrote:
Sat Dec 26, 2020 15:21
Old Phantasy Star Online player here.

I recalled the image of a Mese Crystal when suddenly the currency "Meseta" from PSO popped into my mind. Is there a conspiracy here? They look too similar.
Mese in minetest_game is based on a finnish(?) programming joke so it's somewhat plausible that PSO devs extrapolated from that, but It being a yellow diamond is too much of a coincidence. Either it's pure chance, or someone wasn't truthful about where 'mese' came from lol.
I'm betting on pure chance since the world is huge and the combination of yellow gem + 'mese' isn't weird or esoteric, just unlikely.
If I recall, Meseta originated in Phantasy Star for the Master System. I hardly played those classic RPG's so I don't know if the Meseta shape and colour originated there.

That double pyramid shape (what is the actual name?) of the crystal is common enough. Yellow is close enough to gold so I can see why they went with that colour. PS originated in Japan so Meseta does follow their language character structure. It may have been one of those cool coincidences. Or maybe one of the Japanese devs had a Finnish (?) dev friend. Perhaps the joke was even floating around the programming world back in the late 80's.

No matter really, just a fun thing to note. :)

User avatar
Ghaydn
Member
Posts: 54
Joined: Sat Sep 26, 2020 11:58
In-game: ghaydn
Location: Moscow, Russia

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Ghaydn » Post

I've made the Snake game on Mesecons-luacontroller. It works: see this video.
Also, I've built it on the "Crimea HiTech&magic" server, works ok. Main controller. You can edit any gameplay parameters and screen size.
Spoiler

Code: Select all

--SNAKE game for luacontroller in MINETEST

--gameplay constants
local apple_probability = 0.05
local bomb_probability = 0.05
local level_time = 50
local max_level = 100
local speed = 3

--screen_size
local screen_size = {12, 12}

--aliases for more readability
local X = 1
local Y = 2

if event.type == "program" then
   mem.var = {
      ["on"] = false,
      ["snake"] = {},
      ["length"] = 3,
      ["level"] = 1, 
      ["apples"] = {},
      ["bombs"] = {},
      ["blink"] = false,
      ["command"] = "no",
      ["direction"] = "right",
      ["dead"] = false,
      ["reason"] = "no",
      ["time"] = 0,
      ["interval"] = 1,
      ["score"] = 0,
      ["hiscore"] = 1000
   }
   digiline_send("lcd", "Snake controller ready. Hi-score: " .. mem.var.hiscore .. ".")
end


if event.type == "digiline" and event.channel == "snake_controller" then
   --on/off switch
   if event.msg == "on" then
      mem.var.on = true
      mem.var.time = 0
      mem.var.level = 1
      mem.var.interval = 0.5 * speed/math.sqrt(mem.var.level)
      mem.var.score = 0
      mem.var.snake = {{6, 5}, {5, 5}, {4, 5}, {3, 5}, {2, 5}}
      mem.var.length = 5
      mem.var.bombs = {}
      mem.var.apples = {}
      mem.var.direction = "right"
      interrupt(0.21, "game_loop")
      mem.var.blink = true
      mem.var.dead = false
      digiline_send("lcd", "GO")
      --interrupt(0.3, "blink")
   elseif event.msg == "off" then
      mem.var.on = false
      if mem.var.score > mem.var.hiscore then
         mem.var.hiscore = mem.var.score
         digiline_send("new_record", true)
         digiline_send("indicator", "level")
      end
      mem.var.score = 0
      digiline_send("lcd", "Snake stopped. Hi-score: " .. mem.var.hiscore .. ".")
      
   --clear screen
      digiline_send("screen", "clear")

   --commands to the snake
   elseif event.msg == "up" then
      if mem.var.direction == "left" or mem.var.direction == "right" then
         mem.var.command = "up"
      end
   elseif event.msg == "down" then
      if mem.var.direction == "left" or mem.var.direction == "right" then
         mem.var.command = "down"
      end
   elseif event.msg == "left" then
      if mem.var.direction == "up" or mem.var.direction == "down" then
         mem.var.command = "left"
      end
   elseif event.msg == "right" then
      if mem.var.direction == "up" or mem.var.direction == "down" then
         mem.var.command = "right"
      end
   end
end

--main game loop
if event.type == "interrupt" and mem.var.on then
if event.iid == "game_loop" and not mem.var.dead then
   --aliases to simplify the code
   local head = mem.var.snake[1]
   local tail = {mem.var.snake[mem.var.length][X], mem.var.snake[mem.var.length][Y]}
   
   --apply previously pressed command
   if mem.var.command == "left" or mem.var.command == "right" or mem.var.command == "up" or mem.var.command == "down" then
      mem.var.direction = mem.var.command
      mem.var.command = "no"
   end
   
   --shift all snake except for the head
   for key, value in ipairs(mem.var.snake) do
      local index = mem.var.length - key + 1
      if index ~= 1 then
         mem.var.snake[index][X] = mem.var.snake[index - 1][X]
         mem.var.snake[index][Y] = mem.var.snake[index - 1][Y]
      end
   end

   --shift head
   if mem.var.direction == "right" then
      mem.var.snake[1][X] = head[X] + 1
   elseif mem.var.direction == "down" then
      mem.var.snake[1][Y] = head[Y] + 1
   elseif mem.var.direction == "left" then
      mem.var.snake[1][X] = head[X] - 1
   elseif mem.var.direction == "up" then
      mem.var.snake[1][Y] = head[Y] - 1
   end
   head = mem.var.snake[1]
   
   
   --make sure the head is in iside the screen
   --to make it simple, our screen is toroid
   if head[X] < 1 then mem.var.snake[1][X] = screen_size[X] end
   if head[Y] < 1 then mem.var.snake[1][Y] = screen_size[Y] end
   if head[X] > screen_size[X] then mem.var.snake[1][X] = 1 end
   if head[Y] > screen_size[Y] then mem.var.snake[1][Y] = 1 end
   

   --check if the snake bites itself
   for hkey, body in ipairs(mem.var.snake) do
      if head[X] == body[X] and head[Y] == body[Y] and hkey ~= 1 then
         --snake dies
         mem.var.reason = "bite itself"
         mem.var.dead = true
         digiline_send("indicator", "bomb")
      end
   end


   --check apples
   for key, value in ipairs(mem.var.apples) do
      if head[X] == value[X] and head[Y] == value[Y] then
         mem.var.length = mem.var.length + 1
         mem.var.snake[mem.var.length] = {}
         mem.var.snake[mem.var.length][X] = tail[X]
         mem.var.snake[mem.var.length][Y] = tail[Y]
         table.remove(mem.var.apples, key)
         mem.var.score = mem.var.score + mem.var.length * mem.var.level
         digiline_send("indicator", "apple")
      end
   end

   --check bombs
   for key, value in ipairs(mem.var.bombs) do
      if head[X] == value[X] and head[Y] == value[Y] then
         table.remove(mem.var.snake, mem.var.length)
         mem.var.length = mem.var.length - 1
         table.remove(mem.var.bombs, key)
         digiline_send("indicator", "bomb")
         if mem.var.length < 1 then
            --snake dies
            mem.var.reason = "ate to many bombs"
            mem.var.dead = true
         end
      end
   end

   --create new apple
   if math.random() < apple_probability then
      local new_apple = {math.random(1, screen_size[X]), math.random(1, screen_size[Y]), ["ok"] = true}
      --check if it is inside the snake
      for key, value in ipairs(mem.var.snake) do
         if new_apple[X] == value[X] and new_apple[Y] == value[Y] then
            new_apple["ok"] = false
         end
      end
      --check if it is inside another apple
      for key, value in ipairs(mem.var.apples) do
         if new_apple[X] == value[X] and new_apple[Y] == value[Y] then
            new_apple["ok"] = false
         end
      end
      --check if it is inside a bomb
      for key, value in ipairs(mem.var.bombs) do
         if new_apple[X] == value[X] and new_apple[Y] == value[Y] then
            new_apple["ok"] = false
         end
      end
      
      if new_apple["ok"] then
         table.insert(mem.var.apples, {new_apple[X], new_apple[Y]})
      end
   end

   --create new bomb
   if math.random() < bomb_probability then
      local new_bomb = {math.random(1, screen_size[X]), math.random(1, screen_size[Y]), ["ok"] = true}
      --check if it is inside the snake
      for key, value in ipairs(mem.var.snake) do
         if new_bomb[X] == value[X] and new_bomb[Y] == value[Y] then
            new_bomb["ok"] = false
         end
      end
      --check if it is inside an apple
      for key, value in ipairs(mem.var.apples) do
         if new_bomb[X] == value[X] and new_bomb[Y] == value[Y] then
            new_bomb["ok"] = false
         end
      end
      --check if it is inside another bomb
      for key, value in ipairs(mem.var.bombs) do
         if new_bomb[X] == value[X] and new_bomb[Y] == value[Y] then
            new_bomb["ok"] = false
         end
      end
      
      if new_bomb["ok"] then
         table.insert(mem.var.bombs, {new_bomb[X], new_bomb[Y]})
      end
   end
   
   --LCD monitoring
   local message = "Snake"
   if mem.var.dead then
      digiline_send("lcd", "Snake died: " .. mem.var.reason .. ". \nScore: " .. mem.var.score .. ", \nHi-score: " .. mem.var.hiscore)
      if mem.var.score > mem.var.hiscore then
         mem.var.hiscore = mem.var.score
         digiline_send("new_record", true)
      end
      mem.var.score = 0
      interrupt(10, "end")
   else
      digiline_send("lcd", "Level: " .. mem.var.level .. ", \nLength: " .. mem.var.length .. ", \nScore: " .. mem.var.score .. ", \nHi-score: " .. mem.var.hiscore .. ".")
   end
   
   --tic tac
   mem.var.time = mem.var.time + 1
   if mem.var.time >= level_time then
      mem.var.level = mem.var.level + 1
      mem.var.time = 0
      mem.var.bombs = {}
      mem.var.apples = {}
      mem.var.interval = 0.5 * speed/math.sqrt(mem.var.level)
      mem.var.score = mem.var.score + mem.var.level
      digiline_send("indicator", "level")
      if mem.var.level >= max_level then
         mem.var.dead = true
         digiline_send("lcd", "Level " .. max_level .. ". Score: " .. mem.var.score .. " Hi-score: " .. mem.var.hiscore .. ".")
         if mem.var.score > mem.var.hiscore then
            mem.var.hiscore = mem.var.score
            digiline_send("new_record", true)
         end
         mem.var.score = 0
         interrupt(10, "end")
      end
   end
   
--part of blink code
   --clear screen
   local screen = {}
   for xkey = 1, screen_size[X] do
      for ykey = 1, screen_size[Y] do
      screen[xkey] = {}
      screen[xkey][ykey] = false
      end
   end

   --draw snake
   for key, value in ipairs(mem.var.snake) do
      screen[value[X]][value[Y]] = true
   end
   --draw apples
   for key, value in ipairs(mem.var.apples) do
      screen[value[X]][value[Y]] = true
   end
   --draw bombs
   for key, value in ipairs(mem.var.bombs) do
      if mem.var.blink then
         screen[value[X]][value[Y]] = true
      end
   end
   --send info to the screen controllers
   digiline_send("screen", screen)
   

   interrupt(mem.var.interval, "blink")
--   interrupt(mem.var.interval, "game_loop")

elseif event.iid == "blink" then
   --clear screen
   local screen = {}
   for xkey = 1, screen_size[X] do
      for ykey = 1, screen_size[Y] do
      screen[xkey] = {}
      screen[xkey][ykey] = false
      end
   end

   --draw snake
   for key, value in ipairs(mem.var.snake) do
      screen[value[X]][value[Y]] = true
   end
   --draw apples
   for key, value in ipairs(mem.var.apples) do
      screen[value[X]][value[Y]] = true
   end

   
   --send info to the screen controllers
   digiline_send("screen", screen)
   
   --repeat screen refresh
--   mem.var.blink = not mem.var.blink

   interrupt(mem.var.interval, "game_loop")
--   interrupt(0.333, "blink")
elseif event.iid == "end" then
   digiline_send("screen", "clear")
   digiline_send("lcd", "Stopped. Pull the lever to restart. Hi-score: " .. mem.var.hiscore .. ".")
end
end
Pixel controller. Each one must have it's own coordinates x1, x2, x3 and y; also edit ports to which ones you use.
Spoiler

Code: Select all

--light controller: controls 3 pixels at once

--local constants: connecting lights with ports
--coordinates of current controller
local x1 = 1
local x2 = 2
local x3 = 3
local y = 1

--ports for it's lights
local lights = {
[x1] = "c",
[x2] = "b",
[x3] = "a"
}

--message is just a 2D table with booleans
if event.type == "digiline" then
   if event.channel == "screen" and event.msg ~= "clear" then
      port[lights[x1]] = event.msg[x1][y]
      port[lights[x2]] = event.msg[x2][y]
      port[lights[x3]] = event.msg[x3][y]
   end


   if event.channel == "clear" or event.msg == "clear" then
      port = {["a"] = false, ["b"] = false, ["c"] = false, ["d"] = false}
   end
end
Indicator. Indicates game events: apples, bombs, new levels and death. Edit ports locals to whatever you need:
Spoiler

Code: Select all

--Snake indicator

local bomb = "a"
local apple = "d"
local level = "b"

if event.type == "digiline" and event.channel == "indicator" then
   if event.msg == "bomb" then
      port[bomb] = true
      interrupt(1.5)
   elseif event.msg == "apple" then
      port[apple] = true
      interrupt(1.5)
   elseif event.msg == "level" then
      port[level] = true
      interrupt(1.5)
   end
end

if event.type == "interrupt" then
   port.a = false
   port.b = false
   port.c = false
   port.d = false
end
Inputs. Also edit ports.

Code: Select all

--Snake inputs
--edit pin names to correct values
if event.type == "on" then
   if event.pin.name == "A" then
      digiline_send("snake_controller", "left")
   elseif event.pin.name == "B" then
      digiline_send("snake_controller", "up")
   elseif event.pin.name == "C" then
      digiline_send("snake_controller", "right")
   elseif event.pin.name == "D" then
      digiline_send("snake_controller", "down")
   end
end
On/off switch.
Spoiler

Code: Select all

--Snake switch
--edit pin name to correct value
local pin = "D"

if event.type == "on" and event.pin.name == pin then
   digiline_send("snake_controller", "on")
end

if event.type == "off" and event.pin.name == pin then
   digiline_send("snake_controller", "off")[/spoiler]
end
LCD digiline channel is "lcd"
Nobody understands me... — вРН БШ ЯЙЮГЮКХ?

User avatar
Minix
Member
Posts: 144
Joined: Thu Nov 12, 2020 13:51
In-game: Minix

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Minix » Post

Hello dear mesecons users, I run a survival server which features mesecons, and a player requested me to add a recipe so that sticky blocks can be crafted. My question is, why does the sticky block not have a recipe ?

I know they can be used to make machines that move in the air which seems fine, but I am worried that they could be used to build "lag machines", can the sticky block be used to make a machine that lags the server ?

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Miniontoby » Post

Minix wrote:
Sun Feb 28, 2021 18:47
Hello dear mesecons users, I run a survival server which features mesecons, and a player requested me to add a recipe so that sticky blocks can be crafted. My question is, why does the sticky block not have a recipe ?

I know they can be used to make machines that move in the air which seems fine, but I am worried that they could be used to build "lag machines", can the sticky block be used to make a machine that lags the server ?
It can make a lag machine actualy, but yeah, I should say, ask the player how many they want and then just /give it to them, then they cant do something else.

I could maybe try to make an difficult mod which will remove lag machines or things that look like lag machines, but at least they can only stick an certain amount of block i though.

but yeah mesecons in general is an lag maker.
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
Minix
Member
Posts: 144
Joined: Thu Nov 12, 2020 13:51
In-game: Minix

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Minix » Post

Thanks, I will have to do some testing on a server then.

SFENCE
Member
Posts: 274
Joined: Sun Sep 29, 2019 07:13
GitHub: SFENCE
In-game: SFENCE

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by SFENCE » Post

Great work.
cdb_3P0AYqjEIn68

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Desour » Post

Maybe I forgot it or I didn't test correctly, but I didn't know that pistons actually have a delay of only one step when turned on:
Image
Attachments
screenshot_20210408_005953.png
screenshot_20210408_005953.png (60.1 KiB) Viewed 2584 times
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
TenPlus2
Member
Posts: 22
Joined: Sun May 09, 2021 20:54

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by TenPlus2 » Post

Bug in mesechest init.lua starting at line 117 you are registering crafts for default:mesechest when it is just "mesechest" same for default:mesechest_locked is just "mesechest_locked"

hence the crafts don't register for the chests


Wrong thread sorry.

User avatar
Festus1965
Member
Posts: 4181
Joined: Sun Jan 03, 2016 11:58
GitHub: Festus1965
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

[Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Festus1965 » Post

this but didn't happen under 5.2.0 server, but now 2nd time in 3 days under 5.4.1 version

Code: Select all

2021-06-14 18:14:48: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'technic' in callback environment_Step(): /home/thomas/.minetest/mods/mesecons/mesecons_mvps/init.lua:221: attempt to index a nil value
2021-06-14 18:14:48: ERROR[Main]: stack traceback:
2021-06-14 18:14:48: ERROR[Main]: 	/home/thomas/.minetest/mods/mesecons/mesecons_mvps/init.lua:221: in function 'mvps_move_objects'
2021-06-14 18:14:48: ERROR[Main]: 	...thomas/.minetest/mods/mesecons/mesecons_pistons/init.lua:116: in function 'action_off'
2021-06-14 18:14:48: ERROR[Main]: 	/home/thomas/.minetest/mods/mesecons/mesecons/internal.lua:213: in function </home/thomas/.minetest/mods/mesecons/mesecons/internal.lua:206>
2021-06-14 18:14:48: ERROR[Main]: 	.../thomas/.minetest/mods/mesecons/mesecons/actionqueue.lua:93: in function 'execute'
2021-06-14 18:14:48: ERROR[Main]: 	.../thomas/.minetest/mods/mesecons/mesecons/actionqueue.lua:84: in function <.../thomas/.minetest/mods/mesecons/mesecons/actionqueue.lua:61>
2021-06-14 18:14:48: ERROR[Main]: 	/usr/local/share/minetest/builtin/game/register.lua:422: in function </usr/local/share/minetest/builtin/game/register.lua:406>
2021-06-14 18:14:48: ERROR[Main]: stack traceback:
by reading the lines there I don't see any, that was the reason at other problems ... so

any idea why under 5.4.1 the version, still same from 10.04.2021 is not stable under 5.4.1 ?

added:
at 3rd time this crash I know when:
I had to types of settings: a switching station each on a mv and a hv cable, was taken off the cable when
a) a player detector went off, and via mesecon piston set off, push back
b) a button was turned off, that forced the piston to take switching station away
crash in all cases when piston pushed back, taking the switching station with, off the cable
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

Chrysolite Azalea
Member
Posts: 79
Joined: Sun May 03, 2020 05:38
GitHub: ChrysoliteAzalea

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Chrysolite Azalea » Post

I'd like to ask to correct info on the site mesecons.net

It says that functions can be sent through Digilines, although it can be forbidden in the future updates. However, it's already forbidden (there is code in Mesecons that removes functions from messages).
cdb_JQUaRqvA1Vho

Chrysolite Azalea
Member
Posts: 79
Joined: Sun May 03, 2020 05:38
GitHub: ChrysoliteAzalea

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Chrysolite Azalea » Post

I also noticed that, after the Luacontroller is restarted, all functions are wiped from the mem table. I wonder, is it a security function (for example, to prevent griefers from inserting hidden malicious code into controller memory)?
cdb_JQUaRqvA1Vho

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Miniontoby » Post

Chrysolite Azalea wrote:
Fri Jul 16, 2021 20:24
I'd like to ask to correct info on the site mesecons.net
At first to note: I am not an owner of the site.
Chrysolite Azalea wrote:
Fri Jul 16, 2021 20:24
It says that functions can be sent through Digilines, although it can be forbidden in the future updates. However, it's already forbidden (there is code in Mesecons that removes functions from messages).
There is a way to get it to work.

If you let a lua controller send a msg via digilines. Then let an other one check the event.data or so to match that text and then execute a function.

P.s. I will edit this msg with the setup + code for this msg
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

Chrysolite Azalea
Member
Posts: 79
Joined: Sun May 03, 2020 05:38
GitHub: ChrysoliteAzalea

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Chrysolite Azalea » Post

Miniontoby wrote:
Mon Jul 19, 2021 16:05
Chrysolite Azalea wrote:
Fri Jul 16, 2021 20:24
I'd like to ask to correct info on the site mesecons.net
At first to note: I am not an owner of the site.
Chrysolite Azalea wrote:
Fri Jul 16, 2021 20:24
It says that functions can be sent through Digilines, although it can be forbidden in the future updates. However, it's already forbidden (there is code in Mesecons that removes functions from messages).
There is a way to get it to work.

If you let a lua controller send a msg via digilines. Then let an other one check the event.data or so to match that text and then execute a function.

P.s. I will edit this msg with the setup + code for this msg
I doubt it's a good idea to let controllers execute any code that isn't explicitly written in the controller code window, since it can let griefers inject hidden malicious code inside the system that can be very hard to detect (for example, if the attacker managed to reprogram the Luacontroller, player can find that controller and remove malicious code, but if it's passed through Digiline, it would be much harder to find out what's wrong).
cdb_JQUaRqvA1Vho

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by Miniontoby » Post

Chrysolite Azalea wrote:
Tue Jul 20, 2021 17:44
I doubt it's a good idea to let controllers execute any code that isn't explicitly written in the controller code window, since it can let griefers inject hidden malicious code inside the system that can be very hard to detect (for example, if the attacker managed to reprogram the Luacontroller, player can find that controller and remove malicious code, but if it's passed through Digiline, it would be much harder to find out what's wrong).
Tell me: WHAT MALICIOUS CODE CAN GRIEFERS INSERT/USE???

Because I dont see a way how you can do bad stuff with these lua controllers..
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
jwmhjwmh
Developer
Posts: 125
Joined: Sun Jul 18, 2021 14:10
GitHub: TurkeyMcMac

Question: rules function purity

by jwmhjwmh » Post

(Hopefully this is the right topic for this question.)

When a function is used as the value of <node-definition>.mesecons.conductor.rules, does this function need to be pure? I have a mod where this is not completely the case. The return value of the function can change when the position of the conductor changes*. This means that the return value stays the same for a given call to turnon/turnoff, but not across all calls. Will my mod reliably work into the future? I hope it does, as I don't think there's another way to accomplish the same thing if not.

* The node finds its own position through a lookup table where keys are the combined values of param1 and param2. The conductors it connects to work similarly and also change their returned rules when its position changes.

EDIT: I have now made the conducting node immovable, although digging the node and replacing it can still reuse the same values of param1 and param2.

User avatar
pampogokiraly
Member
Posts: 293
Joined: Wed Jan 08, 2020 22:21
In-game: i_love_mesecon

Re: [Mod] Mesecons (= redstone) [GitHub] [minetest-mod-mesecons]

by pampogokiraly » Post

quick question... why is there no xnor gate? I know it is inside the fpga, but it's still weird that there is a standalone gate for every one of them except for the xnor one...
All praise the Bacon God! The one and only god in MineTest

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests