Author Topic: Redstone-oriented Minecraft clone  (Read 15534 times)

0 Members and 1 Guest are viewing this topic.

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Redstone-oriented Minecraft clone
« Reply #15 on: August 23, 2014, 07:00:41 pm »
I'm tired, so I'll get MCP tomorrow and have a look at the source, but I could get something even weirder. Which version of MC do you have?


Offline harold

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 226
  • Rating: +41/-3
    • View Profile
Re: Redstone-oriented Minecraft clone
« Reply #16 on: August 23, 2014, 07:28:05 pm »
Ah yes, that shows the problem pretty well.
I do most of my experiments in 1.6.2, I haven't found any differences between that and 1.7.10 though. Doesn't mean there aren't any, but from what I've heard, this area of redstone hasn't seen much change after 1.5
Blog about bitmath: bitmath.blogspot.nl
Check the haroldbot thread for the supported commands and syntax.
You can use haroldbot from this website.

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Redstone-oriented Minecraft clone
« Reply #17 on: August 23, 2014, 09:13:14 pm »
I just tried the same thing as above in 1.6.2, the screenshot was made using 1.5.2, and it seems to work, although still "buggy".
I'd expect that:
1. Redstone gets powered
2. Repeaters realize they get powered -> Repeaters turn on
3. Repeaters realize they're powered by another repeater -> Lock on state
4. This state is stable

But it's more like:
1. Redstone gets powered
2. One repeater realizes it's getting power -> Turns on
3. Repeater next to 2. realizes it's being powered by another repeater -> Lock current (still off) state
4. Repeat for next two -> Pattern
5. Also stable state
Bug? Or two, actually (2. + 3.)
There may also be a relationship with repeater orientation, the locked repeaters face the same/opposite direction.
If the ticks were in a specific order, the pattern wouldn't be diagonal, would it?

Screenshot:

Offline harold

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 226
  • Rating: +41/-3
    • View Profile
Re: Redstone-oriented Minecraft clone
« Reply #18 on: August 23, 2014, 09:38:36 pm »
Is it the orientation though? In my test, also moving the level made a difference. Perhaps it's the relative position of the level with repeaters?
Blog about bitmath: bitmath.blogspot.nl
Check the haroldbot thread for the supported commands and syntax.
You can use haroldbot from this website.

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Redstone-oriented Minecraft clone
« Reply #19 on: August 26, 2014, 10:08:51 am »
Oh, I thought it was your implementation... The reason could be that minecraft does it the way I mentioned: Random ticks per chunk, but it has to tick every block in a chunk first before it ticks a block the second time (I'm not sure how to explain it better). What happens if you connect two not gates to the repeater inputs (input & lock) instead of a repeater? Does the behaviour change if you change orientation, location etc.?
Could you draw the circuit?


I found out that sometimes it's visible that the right torch turns on slightly faster than the left one, sometimes the opposite.

Quote
With statefulness my old Minecraft clone (years ago, lwjgl) achieved a 2-calls-per-chunk renderer :P (IIRC. It was an experiment how to get most performance out of LWJGL with a lot of cubes and big worlds)
Well how? glBindVertexArray, glDrawElements .. nothing left to change state. I'd have 2 calls if it wasn't for the uniform buffer.
It was GL 2.0 back then, fixed function pipeline etc. I'd get the source but it's on my old hard drive I put somewhere in my room :/
[/quote]

It's the north/south and east/west bias. As the program reads the chunks in a certain way, there is a slight difference between positions and orientations.

Offline harold

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 226
  • Rating: +41/-3
    • View Profile
Re: Redstone-oriented Minecraft clone
« Reply #20 on: August 27, 2014, 04:08:36 pm »
Eiyeron, it does this thing in all directions. In the "2 repeaters, one locks the other, both receive power at the same time" case, the locker always win.
Blog about bitmath: bitmath.blogspot.nl
Check the haroldbot thread for the supported commands and syntax.
You can use haroldbot from this website.

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Redstone-oriented Minecraft clone
« Reply #21 on: August 28, 2014, 04:08:36 pm »
I had a quick look at the redstone code in minecraft, most of it is handles by BlockRedstoneLogic.java and it doesn't seem that there is any double-buffering happening at all. That doesn't explain the patterns, though.

Offline harold

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 226
  • Rating: +41/-3
    • View Profile
Re: Redstone-oriented Minecraft clone
« Reply #22 on: October 31, 2014, 12:05:02 pm »
After some discussion on an other forum, I've decided that this issue will actually not be resolved.
Only the "normal" behaviour (the usual descriptions of how redstone elements work) will be replicated, not this sort of thing that doesn't follow any clear set of rules.

edit: I've worked on it again, so despite appearances it may not be entirely dead. Simulation still has severe bugs though, so it may not go anywhere.
« Last Edit: January 26, 2016, 12:55:41 pm by harold »
Blog about bitmath: bitmath.blogspot.nl
Check the haroldbot thread for the supported commands and syntax.
You can use haroldbot from this website.