Overv / WebCraft

Minecraft clone written in Javascript.
zlib License
385 stars 183 forks source link

Extending world #13

Closed p3rlphr33k closed 2 years ago

p3rlphr33k commented 8 years ago

This is not really an issues, but more of a question of capability.. Would it be possible to extend the world dynamically as you explore? Example: World loads, you are in a 64x64x16 chunk. Your field of view is set to 60. As you step forward, another row is generated dynamically in that direction and the row behind you (now out of view) is no longer updated unless you step back into view that is. This could (potentially) continue on in any direction.

Overv commented 8 years ago

Sure, you'd have to implement a chunk system where only some of the chunks are sent to clients.

warengonzaga commented 8 years ago

I already notice that. I want to put something to be pop up when you died from falling from that chunk closely look on Minecraft when you fall to inner world.

p3rlphr33k commented 8 years ago

I have written respawn code already. I'm trying to extend the block world infinitely like mine craft. I will let you know how it works out. I have already started adding chunk caching and chunk coordinates sw and sv. Each block within the chunk starts over with 0,0 coordinates on x,y so the numbers don't climb to large as you wander from spawn. Spawn coordinates will have to be sw, sv, sx,sy,sz.

Bayside308 commented 6 years ago

@p3rlphr33k Would you mind posting your version to Github? 😄

andrewgrider commented 6 years ago

I was looking in Render.js and I was wondering if there was a way to create blocks with textures that aren't listed in the terrain.png sprite map. For example if the BLOCK.CUSTOM.IMAGE_TEXTURE = "custom.png" instead of using a sprite

Overv commented 6 years ago

You would have to render these blocks separately from the rest because blocks are drawn in large chunks with a single texture that contains all materials.

develperbayman commented 6 years ago

Ok so like a year ago i managed to add different textures to each block the downside is the code was lost in a hard drive failure....sad.....but i can tell you it ran hella slow im gonna try it out again sometime but i gotta move soon

Hmmm two threads two seperate engines working side by side one to render the geometry the other to render the textures utilising ID'S that might work faster im thinking we might add another file gfxrender.js maybe

There are a couple of benifits here i think

Keeping the geoengine and texture engines seperate would allow greater control overall for render settings

If it works right it should be fast??

I cant code right now unfortunatly

On Sun, Apr 8, 2018, 9:33 AM Alexander Overvoorde notifications@github.com wrote:

You would have to render these blocks separately from the rest because blocks are drawn in large chunks with a single texture.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Overv/WebCraft/issues/13#issuecomment-379559196, or mute the thread https://github.com/notifications/unsubscribe-auth/AI3D-BTQvgfHX59bn7oFfzuy0k_8BUI_ks5tmi3VgaJpZM4JwDV8 .

p3rlphr33k commented 5 years ago

I am still working on extending the world on and off among other improvements... Its a slow process but I am making headway. I think moving to 32^3 or 64^3. I am trying to cut out rendering of below ground blocks. I have dynamic terrain generation using perlin noise working as well as random block placement based on some ratio such as ore blocks, water levels, when dirt or snow can be placed and where trees should be generated (only one type of tree so far). Otherwise the chunk system should be functional soon. I am also breaking the chunks into separate world files to allow smaller transmissions over the network although I suspect meeting the corners of 4 chunks will give me rending problems to I may have to lower the chunk sizes to max or 62^3 to prevent exceeding the 254 limit!

ZombieBrine13092 commented 5 years ago

I expanded my world by editing singleplayer.html. Finding the world generation options, I can see: var world = new world( 16, 16, 16 ) I changed it to: var world= new world( 50, 50, 50)

This expands the world generation to a 50x50 world every time you start up the game.