I've got picking by and large working. Except for one completely confusing bug. The top of the transparent block never stops rendering. I eventually figured out why.
I made an array of chunks of blocks, knowing that I would eventually be working with more than one at a time. So I made the code for everything loop through all chunks. The reason the top never stopped rendering is because I HAD OVERLAYED TEN CHUNKS IN THE SAME SPACE.
So I change it to only initialize a single chunk. Null error. I have it check for null. I start it up, and... nothing. Empty space everywhere. I reinitalize all chunks. The world is back. Hmm. I have been diagnosing the thing for quite a while. And here's where we get to the bizarre part.
Chunks 5-9 absolutely must be initialized for the world to render. One less and nothing renders. 0-4 are completely meaningless. I really have no idea why this is the case. I mean, I was working with chunk 5 as the main chunk - you know, numpad directions to keep things straight. Though the more I think about it, I only need one central chunk - the one the player is in. The ones outside of that can work on different logic, being out of the immediate vicinity of the player. Anyway, it's bizarre. It isn't that 5 is critical. It is that 5,6,7,8, and 9 are all critical. And any time I've tried to mess with that formula, the world blips out of existence.
Anyway, I'll work with that, and soon have block digging working properly.
No comments:
Post a Comment