开发者

Alternative approaches to a Minecraft Redstone Simulator

开发者 https://www.devze.com 2023-04-12 14:40 出处:网络
I\'m just programming a Minecraft Redstone Simulator for Android. I\'m doing the simulation with some variations of Dijkstra, but I heard, that the real simulator does something different and updates

I'm just programming a Minecraft Redstone Simulator for Android. I'm doing the simulation with some variations of Dijkstra, but I heard, that the real simulator does something different and updates every redstone block every r开发者_如何学Pythonedstone tick.

How is notch doing it?

Update I know that he uses a HashSet, this doesn't look like Dijkstra, does it?


I will call anything that's redstone-related a "redstone block".

Every tick, Minecraft iterates through the hashset and updates each redstone block.

When more redstone blocks are added, the hashset size is increased, and everything that was in the previous, smaller hashset is scrambled into a random order.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号