Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411490 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 24, 2024, 04:26:25 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsNew Soils - browser-based minecraft clone with a twist
Pages: [1]
Print
Author Topic: New Soils - browser-based minecraft clone with a twist  (Read 1813 times)
_bm
Level 2
**


i'm so confused


View Profile WWW
« on: June 24, 2017, 03:44:11 PM »


I decided that I wanted to try making a browser-based Minecraft clone, and hey here we are!



What?

New Soils is a Minecraft clone with a twist or two. You can play it in your browser, given that your browser is Chrome or Edge.
It's currently playable, but I'm not planning on release until the game has a few critical features. This is what it looks like now:




What's The Twist?

I'm currently doing a few things differently from MC. Namely:
Cubic chunks, meaning infinite height and depth (this also means cubic regions)
• One world, all players, MMO style
• Allowing for an arbitrary number of 'dimensions' a player can travel to. I'll explain how/why in another post.

And some things I'm planning:
• Crafting will be done quite a bit differently, using a 'prototype' system. More on this later!
• Building will be made such that it is easier to create aesthetically pleasing structures (again, more on this later)
• Lighting will be done on the GPU

In addition to these things, I have some other long-term gameplay ideas that I'm not going to share quite yet. I don't want to delve too deep into those concepts until I'm a little more sure about this project's scope.

Other Stuff

 Hand Point Right http://www.indiedb.com/games/new-soils
 Hand Point Right http://gamejolt.com/games/new_soils/261088
« Last Edit: June 26, 2017, 08:06:54 PM by _bm » Logged

Zireael
Level 4
****


View Profile
« Reply #1 on: June 25, 2017, 05:02:02 AM »

What is the "twist or two" about?
Logged
_bm
Level 2
**


i'm so confused


View Profile WWW
« Reply #2 on: June 25, 2017, 07:50:14 AM »

What is the "twist or two" about?

I'm currently doing a few things differently from MC. Namely:
• Cubic chunks, meaning infinite height and depth (this also means cubic regions)
• One world, all players, MMO style
• Allowing for an arbitrary number of 'dimensions' a player can travel to. I'll explain how/why in another post.

And some things I'm planning:
• Crafting will be done quite a bit differently, using a 'prototype' system. More on this later!
• Building will be made such that it is easier to create aesthetically pleasing structures (again, more on this later)
• Lighting will be done on the GPU, like this:



In addition to these things, I have some other long-term gameplay ideas that I'm not going to share quite yet. I don't want to delve too deep into those concepts until I'm a little more sure about this project's scope.

If you have any other questions about anything mentioned above, please do ask!  Smiley
Logged

_bm
Level 2
**


i'm so confused


View Profile WWW
« Reply #3 on: June 26, 2017, 08:05:53 PM »

so, ambient occlusion, this effect:



is not lookin quite right on the edges of chunks:



this is because chunks are sent to be meshed by webworkers (basically multithreading for browsers) and those workers don't know that there are voxels surrounding the chunk that was sent to it! Hand Thumbs Down Right

the solution is to simply send the necessary voxel data to these workers
but, wait, what if there's not a chunk adjacent to the chunk being meshed? Blink that's the problem

some possible ways to handle this issue are:
 • only send adjacent voxels to workers when all their neighbors are loaded (pretty bad idea)
 • update adjacent chunks when a chunk is updated (Hand Any Key way too many updates tho)
 • Huh?

in all likelyhood i'm going to end up sticking with the latter option, but if anybody has a better idea i'd be happy to hear you out  Kiss



next is some fun stuff! i added some janky fog back in:



and logs and leaves!



also, it's worth mentioning that all of the textures are temporary because i sneakily stole them from the painterly pack



that's going to do it for now. i'll have some nice explanations of game mechanics / systems later on. if you want to keep updated, make sure you click notify  Gomez
Logged

_bm
Level 2
**


i'm so confused


View Profile WWW
« Reply #4 on: June 27, 2017, 08:45:14 PM »

today i implemented a method to help make sure chunks that are closer to the player get requested, loaded and meshed sooner

i could've done this by sorting the queue every time a chunk was added, but that would've been too expensive. so i decided to implement an array method that simply inserts an element depending on a 0.0 thru 1.0 value that scales to the size of the array. what this means is that chunks nearer to the player get inserted towards the head of the list, and farther chunks get inserted at the tail.

using this priority system is cheap but doesn't always provide the best result:





(there are only a few meshing webworkers running, so meshing is rather slow in the video, to show the effect of prioritizing)



another issue i've noticed is that some chunks get... left behind:



this is somehow related to the chunk deactivating system client-side, but im not sure yet exactly how
Logged

_bm
Level 2
**


i'm so confused


View Profile WWW
« Reply #5 on: June 29, 2017, 07:43:02 PM »

today i implemented a class i like to call ColorRamp

it's pretty simple:
Code:
class ColorRamp {
constructor(list) {
this.list = list;
this.color = new THREE.Color();
}

at(t) {
//Find indexes
let start = Math.floor(t * this.list.length)[clamp](0, this.list.length - 1);
let end = (start + 1) % this.list.length;

//Amount between two colors
let tt = (t * this.list.length)[clamp](0, this.list.length - 1) - start;

//Copy and interpolate, return color
this.color.copy(this.list[start]);
this.color.lerp(this.list[end], tt);
return this.color;
}
}

all it does is interpolate linearly between colors. currently im using this to keep the fog color consistent with the sky:



imagine how nice it'll look when i implement lighting!
Logged

_bm
Level 2
**


i'm so confused


View Profile WWW
« Reply #6 on: July 01, 2017, 01:35:06 PM »

Value Noise

today i attempted to swap over from simplex noise to value noise for generating terrain. supposedly, that latter is faster and simpler. the problem is that my implementation of value noise seems to be noticeably slower than the simplex noise library i was using! so i reverted.  Shrug

Geometry Buffer Fix

New Soils uses three.js's geometry buffers for faster rendering and terrain manipulation. the drawback is that you have to have a constant max number of vertices and faces. you can't increase this number unless you completely replace the geometry. this is the simple formula i use to determine a reasonable limit to the number of faces/verts:

Code:
max = 2000 + vertices;

the max is kept throughout the lifetime of the chunk. so what if you place enough objects to run over that buffer of 2000? before now, nothing. the chunk just failed to mesh. i've solved this issue such that the chunk is re-created with a new maximum if the received mesh has too many elements. to test this i placed a few dozen voxels in a lattice like so:



this negates any benefits made by greedy meshing and creates huge amounts of vertices
Logged

_bm
Level 2
**


i'm so confused


View Profile WWW
« Reply #7 on: July 02, 2017, 06:54:32 PM »

not much today, but i did add slider to my ui system:

Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic