#Hello All, I am really new to Java LWJGL and made a MC clone but am having trouble

1 messages · Page 1 of 1 (latest)

quaint obsidian
#

I am making a Minecraft clone, and I have a small chunk system, so far just one chunk, but it keeps breaking. textures work good, so do most face renderings of each cube in the chunk. Everything is properly culled, however the issue arises when placing or destroying blocks. My chunk size is 17x17x17, (In actuality its 16x16x16) and if I place a block, it distorts all blocks textures, by swapping them from 16x16x16 to wherever the player placed a block or near it. It also causes from the same coord of 16x16x16 to have faces disappear. And if you reverse what the player does, almost in a ordered fashion the visual glitches and texture swapping reverses little by little until the chunk is back to how its supposed to be. I will share some videos and screenshots, and am completely willing to share the project files if need be.

Video Link to the issue: https://www.youtube.com/watch?v=hq36Io7giXQ&ab_channel=MrMorgan

Unfortunately, I do not have enough space to share the code, so instead I will share the GitHub page of the project
The code is in the package ChunkUtilities with ChunkMesh being the main code thats the issue.

Any help is greatly appreciated!

https://github.com/bmo316/voxelGame

GitHub

Contribute to bmo316/voxelGame development by creating an account on GitHub.

modern quartzBOT
#

<@&987246399047479336> please have a look, thanks.

modern quartzBOT
#

@quaint obsidian

Your question has been closed due to inactivity.

If it was not resolved yet, feel free to just post a message below
to reopen it, or create a new thread.

Note that usually the reason for nobody calling back is that your
question may have been not well asked and hence no one felt confident
enough answering.

When you reopen the thread, try to use your time to improve the quality
of the question by elaborating, providing details, context, all relevant code
snippets, any errors you are getting, concrete examples and perhaps also some
screenshots. Share your attempt, explain the expected results and compare
them to the current results.

Also try to make the information easily accessible by sharing code
or assignment descriptions directly on Discord, not behind a link or
PDF-file; provide some guidance for long code snippets and ensure
the code is well formatted and has syntax highlighting. Kindly read through
https://stackoverflow.com/help/how-to-ask for more.

With enough info, someone knows the answer for sure 👍

quaint obsidian
#

Please any help woiuld be greatly appreciated

open zinc
#

so is it 17x17x1x7 or 16x16x16?

radiant mountain
quaint obsidian
#

Well its 17 cubed, but the way the for loops work its really 16 cubed. I'll check with the LWJGL server

open zinc
#

this makes no sense

#

it's either 17 or 16

quaint obsidian
#

Okay. So Inset the chunk size as 17 because the way thr for loop goes, it ends up as only 16 length, width, and height.

open zinc
#

uh, well, that's not a good reason to change chunk size constant at all

#

you can loop 16 times with a size of 16 just fine

#

either from 0 to 15 or from 1 to 16

#

if your chunks are cubic, create an array of blocks of size 4096 (16x16x16), and then you can easily index into it by doing x + y * 16 + z * 256 (assuming looping from 0 to 15)

meager edge
#

because 16 is a power of two

quaint obsidian
#

Ok