Could redstone simulator use cBlockArea?
#1
While I'm messing around simulators, I noticed that by far the most costly simulator is the redstone. It hogs the most CPU and it spends most of it on calling cWorld::GetBlock(). I was wondering, could it be modified so that it read a small area using cBlockArea and then query that area instead of the entire world? That would most certainly speed things up, since there would be no locking and no chunk lookup needed for each single block. Also it would naturally bound the simulator not to simulate too close to the world edges, because the block area would refuse reading there.
Reply
Thanks given by:
#2
Of course I do not know a lot of c++ but i think it needs to see a range of 15 around a redstone wire becouse a redstone signal can only go 15 blocks far.
Reply
Thanks given by:
#3
I did some timing and here's what popped out:
Code:
cRedstoneSimulator::Simulate: 0 torches, 0 repeaters, 5411 blocks took 362542 ticks (362.54 sec)
A full 67 milliseconds per a single block? WTF?
Reply
Thanks given by:
#4
is that fast or slow?
Reply
Thanks given by:
#5
Normally one game tick takes 1/20 of a second ( = 50 ms). Since a game tick consists of a simulator simulation, the tick when this redstone was simulated took whole 363 seconds. That is 6 minutes instead of 50 ms. Super-slow.
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)