I Made Minecraft's Terrain Generation in Roblox
HTML-код
- Опубликовано: 1 окт 2024
- thank you for watching!
My Discord Community
➤ / discord
Socials
GitHub ➤ github.com/mus...
Twitter ➤ / 2nixrblx
Roblox Account ➤ www.roblox.com...
Roblox Group ➤ roblox.com/gro... - Игры
You did a little mining off camera
You did a little mining off camera
You did a little mining off camera
You did a little mining off camera
You did a little mining off camera
You did a little mining off camera
For the grass, to spread it out more I recommend using the perlin noise values as a chance for grass to spawn instead of it always spawning if it’s higher than some value. This should make smoother transitions for the edges of the grass patches.
It’s more difficult to implement things like perlin noise into roblox studio than things like unity and stuff.
@@CraizyMotion its pretty easy with the math.noise function
@@CraizyMotion well perlin noise isnt hard at all to implement plus roblox already has it built-in, also did you not watch the video? he literally used perlin noise in it.
2:10 use a quadratic Bézier curve for it to be smooth
Also for 5:25, the model item drop issue, use a cframevalue, then lerp based off math.sin(tick) towards up and down and multiply by CFrame.Angles() and again math.sin(tick) lerp, you can specific lerp goals yourself, then connect .Changed on the cframe value and pivot the model to the value
Also you should have a matrix of blocks generated on the server virtually, separated by chunks. When a player gets within a certain distance, physically generate that chunk. Make sure that distance is a multiple of the size of a chunk (32?). Secondly, only generate (physically) the surface level. When mining, index adjacent cells from the matrix to generate.
No bezier curves are used for that, the correct way to do it is by creating a basic raycast physics constant simulation, you have to take gravity, initial velocity and ground material friction into account, this is how minecraft does it
@@RealVeggreminder: this is a Roblox game, not a Minecraft creation. Which is why the coding, scripts and so on have different physics and meanings considering they are two different games. Take that into account.
@@ZekeTubeOG What I said can be done in Roblox Studio thanks to CFrame and RayCasting, you just have to do a physical simulation by defining some variables and using basic physics operations, the same thing that is done with springs in First Person Shooter games on Roblox and by True, bezier should not be used for this because bezier defines a trajectory between points, but when we talk about moving bodies, bezier is not used, in fact it is counterproductive because it does not give the desired effect and is more expensive to process.
🤓
What would be really good is item stacking (when you drop or when an item is on the ground, they stack together like in Minecraft and display a stacked version of the item) and the items looping their falling animation until they hit a block as they currently float. Another thing that I don't believe was added is that when you run, your hand bobs a little and the screen bobs too. Also when you are making multiplayer, add a tablist (in Minecraft you press the tab button while in multiplayer to show a list of players as well as a visual colour coded internet bar showing their ping. This also shows a little avatar of them) I don't know how this would be added considering roblox has their own tablist. Maybe it could be manipulated to look, act and position differently? Anyways, you're doing really well!
My fix to the tab list would be to remove the built-in one and make the tab list yourself
@@lol_oker Good thinking! Also I’ve been wondering how the grass could be made and I think that the darker patches of perlin noise could be used to indicate a higher density of grass while the lighter white part of perlin noise might be a rarer less dense patch of spread out grass
he also needs to fix that the block textures are still loading on all side eventho you cant see all sides
we also need player list like, while you click tab, it will show player in multiplayer. but if singleplayer, it wont let you show player list
@@kevindonthaveid4389 i suppose its pretty easy to implement by checking for the amount of players in game
I'm obsessed with this series!! Can't wait for the next episode! Reminds me of the guy remaking simpsons hit & run
You need to create a custom mesh and add all the blocks to the mesh instead of spawning cube objects for performance. Without this eventually performance will be awful
Pretty sure that's not a thing in roblox studio
@@luafish oh, didnt realise as I've never really done anything in roblox.
@@luafish its possible
@@Speed-xb6vb the closest thing to this that roblox have is unions which will make the performance even worse
It is a thing. I have literally made 3d models in blender and imported it into roblox. Importing meshes has literally been a feature for a long time. You can import fbx and obj files.
For the animation issue with the blocks dropping you can just use a bezier curve and for the 2nd point you can get the midpoint between the origin and end position then add an offset to the y. That should give the desired effect you want
he can just tween it 2 times just 1st time orientation is half way and the thing is up and 2nd it's down and still spinning
@@ObamaMan656 that would not feel natural and you'd be able to see it visually go up and then down. but yeah
@@MagicCats ehh ig there's always a way of doing it
yo Can you make an options menu because some players like me like to switch left click to place and right click to break and other stuff.
16:05 hey! you can actually generate random numbers with a seed! it's just a different function
something like:
local random = Random.new(seed)
random:NextInteger(1, 50)
i was thinking this too
Thank you so much for this piece of info! That's a game changer
i believe u can use a table such as {Position = value, Orientation = value} for the problem you're having on the flowers, also did you ever considered a union for the flowers or using the primarypart to make the model act like a part
if you have other problems i would be glad to help
Be extremely careful with doing calculations on the client side-- if someone exploits, it would be extremely easy for them to falsify chunk data and do whatever they want with it. By allowing clients to determine the chunk loading, you are essentially reverting many benefits brought about by filtering enabled.
Block mining/placing will be verified by the server. First of all, the server will check whether the client's character model is near the block passed. When placing a block the server will check whether the block given is in a valid spot (touching a another block). I will probably add a break/place rate limit as well, preventing spam placement/breaking
The client is only responsible for loading chunks. The server will create it's own model of the chunk when verifying.
@@twonix ohhh okay I misunderstood your methodology. That makes a lot of sense, can't wait to see more progress!
I was so excited for part 2! So happy to see that you didn't just quit or give up on the project, it's awesome! I'm making a drifting game myself and to be completely honest, I have like zero funds and need scripters, devs, gfx makers etc, so its difficult to make my dream project, but I'm very glad you're still making this!
This should by no means be implemented within the coming videos, but you could make a system where you can paste a decal id to set the character skin to an actual Minecraft skin.
that would be really cool
Yes but not the minecraft skin
that would probably be kinda hard. you would have to make the player model a Minecraft character.
@@SophisticatedArc that would be so easy
@@jackithink0000 copyright wise
In 2:00 part - you can make it go curve by using bezier curves. Research about it, I'm pretty sure it's something that you need
I have a question. If i want 2 decals really close to eachother the one behind is the one that is visible. How do i make them both visible?? Like the flowers u have?? (if they are even decals)
Or is it just a roblox bug that cant be fixed?
Something Minecraft does is on each side of a block, it checks if another block is already there and it hides that texture to save resources. And as soon as there is no longer a block on that side the texture appears.
I also think instead of having the grass generate in just patches, allow it to still randomly generate on each block while still allowing patches but with decreased density, like a chance of the grass in a patch just simply not being placed.
Also, this is one of the best videos I've seen about making Minecraft in Roblox!
I agree, he can add an event system for when a block gets placed/destroyed that will point to the chunk where it happened, the position in that chunk, and then updating the blocks immediately around it. I think he should also generate all blocks in the initial world generation and not when the game is actively being played.
I will look into the performance savings of only rendering visible surface's decals. @KoloBear I will be adding the block mining/placement chunk updates next, however in order to make the world infinite, I have to generate each chunk as the player moves through the world.
@@twonix At 2:10 you could try bezier curve maybe, the starting point being the original blocks coords, midpoint being how high you want it to go, and landing point in a random direction
@@twonix The texture system is actually a good idea, with your current system there will still be some lag due to blocks having all sides of their textures being rendered. Only the sides that face air should have their textures rendered.
I also agree with them on the grass part, the current grass patches don't look very good. A combined version of the old and the new system would be a pretty good idea.
I don't know if you can make the world infinite, even Minecraft has a limit where you can go lol. Though chunk loading distance should be increased since with the current chunk distance you cannot make out a lot of things. I think this would be easy to do with the texture method I mentioned above.
@@twonix You can use a plane to construct blocks, which allows you to cull faces which the client doens't see. Ik another voxel game on roblox that does this and it runs pretty well
Will we have world creation option for singleplayer and multiplayer we can create a server to play with our friends only so we can invite them to our server basically and the other player will need an invite to join the world I know it's a lot but there was a very popular game that got discontinued cuz roblox had a lot of limitations it ended up becoming an io game called bloxd and many people bought it and from 2020 it's broken and roblox won't refund anyone. Also it will make your game stand out from other mc clones on roblox with out these it will just seem like a bland everyday mc clone with that minecraft kit to people who don't know about this channel
you can make grass generate the same way on the seed without perlin noise,
just specify ur random object: Random.new(seed)
then you can call newRandom:NextNumber(1,25) but its always the same in same order
I tried to make minecraft in roblox like 3 years ago and when i was working on terrain generation my computer crashed so many times lol
Minecraft actually hides faces that are not visible. You were close, but not correct.
YOOOO I WAS WAITING
same
in order to spin the flowers, you could tween the primaryrootpart orientation so it spins the entire model.
Also welding all parts together
Will you make every chunk a square, or make it go down to bedrock? I feel like making it a square would optimise the game greatly.
Only blocks neighbouring air will be rendered, which is typically just the surface level (but also potential caves or holes / tunnels other players have created)
I have an idea use AI to make the block textures you can also add a little fog so when the terrain infront of you is generationg you cant see it so it will look like it was already there
maybe interview some Minecraft player's to see how the game works btw
2nix has the actual Minecraft so he just uses that
I'm gonna be honest I didn't understand like any of the code talk but I stil thoroughly enjoyed this video
Suggestion
Make the hit box a whole square that covers the whole body and make it possible to prevent collision on the block you're standing on so you wont be sliding of the block and makes walking on the edge of the block more easier.
I like this idea
Cant Wait To Play This XD! On My Yt When its out just reply (:
Bro your so talented even chatgpt told me you cant make mc in roblox 😂😂😂
why u making this it's gonna get taken down anyway
ah i waited for this for month
how much optimization have you done? youll regret making the game framework messy in the future
2:10 use bezier curves instead of tweening
very good idea
LET HIM COOOOK 🔥🔥🔥
By the way you can preload all the important blocks like diamonds and other stuff and generate them beneath the map or you can make it so when a block is destroyed, the blocks that spawn around it has a chance of being a special block if your under a certain amount of height and if you mine a special block it has more chance of having the same special block spawn around it
wow you really continued the game, i thought it's abbadoned game already
When 2nix hasn't uploaded in a long time, and then uploads, you know it's gonna be a good one
this will be so much more better than the cash-grab minecraft clones on roblox
I've never played roblox. But this is amazing.
btw what coding language is this?
Thank you so much! This is coded in Lua (a very light weight and embeddable language)
Try Bezier curves to fix the trangular block dropping (it could be laggy idk test both)
whoops am late
Pretty sure when you are tweening model you could make a primary part and weld everything to that part and made those part unanchored except the primary part. Then tween the primary part only and everything will be rotated/position with the primary part as long as ur tweening the "CFrame" of the primary part, do not tween position or orientation as that only effect the local part.
Amazing video! Though I do have some opinions on how to make it look better:
Stacking blocks
Scattering the grass more
And the generation distance should be higher
Also, I got a question, how does the chunk system work exactly? Does the server generate the chunk once and store the block data in that chunk and give the client the data so it builds the chunk, or it's just a different chunk every time?
All of your concerns shall be concerned by part 3.
The server generates a seed once created, passing it to the client, and the client generates the terrain. By the next part hopefully, the client will be requesting chunk data from the server determining what blocks were placed / mined.
So the server will only be responsible for verifying blocks and storing any player made changes.
@@twonix That's great! I think this will also be helpful in unloading and loading cases.
For the trees, I think that instead of checking every single block for a tree, you check every 5 blocks or something, so the trees are naturally more spread apart! Hope this helps!
Interesting
I remember trying to create this, but faced so many challenges with optimizing the terrain generation. I remember trying figure out how only render the visible planes of the cube instead of the whole cube, but the logic behind it became pretty difficult. Pretty impressed you made a lot of progress into this kind of game!
in roblox if you go to far, the character desintegrates and it gets pixelated (like the farlands in minecraft), so you should add a barrier or leave it like that
And add redstone
oh also when you fall from a high hight it does the particle thing when u hit the ground
You could make the grass and the flowers into meshes with textures, that would fix the lighting problem and also the CFrame problem
Use a deterministic random function for generating the grass instead of perlin noise
What if you approached this differently by starting with recreating the first ever version of Minecraft, uploading it, then gradually updating the Roblox game along with the updates Notch made to Minecraft until your at full release. That would break parts of development up making the task of recreating Minecraft much less daunting, but if you get it too right then Microsoft will come after you and steal your kidney.
After implementing the very basic mechanics of minecraft (mining, placing, world generation, and crafting) I will steer this game towards my own direction to avoid any potential issues.
@@twonix Know what, I'm not a Dev. And the best game comes from the Dev's vision. Good luck!
bro this is only episode 2 and you're already making a better game then how Minecraft started ;--;
EDIT: if you want to post videos without TOO MUCH TIME (probably) I should post "doing what your comments say" videos. I think its kinda easy, I'm not really.. popular to make one so I'm not sure.
you might wanna use a custom rng function for stuff like trees and grass since perlin noise is over 4 times slower, roblox has one but you have to change the seed every time you wanna use it so its better to make a custom one, heres one i made
function rand2d(x, y)
x = x+0.87214
y = y+0.39237
x = x*x+x
y = y*y+y
return (x-y)*((x+y)%1+1)%1
end
As for the lag, the more parts the laggier it is. This is a bad explaination, The CPU has to tell the GPU however Roblox is single-threaded on CPU actions. which means it has to do 1 part at a time. Other engines can do more than 100+ objects at once to the GPU which can increase GPU usage but increase peformance greatly. This is a Roblox limitation.
Why am I doing the same thing??? Also. Btw. You can rotate and move models at the same time. Like so: "CFrame = obj.CFrame * (CFrame.new(0,1,0)*CFrame.Angles(0,180,0))". Make sure to replace the obj with the model's primary part/the part youre tweening
6:54 I think you can save some lines of code when getting delta y instead of checking what value is bigger you can use math.abs(oldYPos - currentYPos)
looool thank you my brain stopped working right there
@@twonix yea no biggie, it happens to us a lot😂👍
this is kinda unrelated but
Random guy : finally, i've finished my roblox game after 5 years!
Massive roblox update :
As for chunk loading try using Actors which let you do more than 1 action at once with less peformance loss. But it has tons of limitations and im not sure if you can clone or not with it. But it can be useful for generating chunk data.
Bro how do I code in roblox I want to make this
for your up and down tween just use the reverse perimeter in your tweeninfo , it auto reverse it to where it started by tweening it back to the orignal CFrame , as im sure your making the tween go on forever optimally with -1 as the reverse count param (hopefully else thats gonna be buggy.) and for the flowers just open your output and add a few prints for when your system detects a flower broken to figure out where the code is breaking at
i have a suggestion. whenever you do make a mineblocks menu screen, with singleplayer, multiplayer and such. i think it would be a good idea when if you press multiplayer it will show all the servers in roblox and you can pick what server youd wanna go in. also you could make private servers but like it would look more like minecraft.. its not super neccesary because roblox already has that, but it would feel more like minecraft if you would add a menu screen with all those things.
Yo by the way we can't join your group!!
I plan on learning how to code in roblox, but currently Im learning modeling within roblox and within blender. Really the only coding Ive done is within Scratch which is completely different. But I will learn how to do it eventually.
w video like always, lmk if u ever wanted a builder for a video (i think u might have said something on discord i forgot lmao)
Hello, i wanna tell ya this is so good! Also, can you tell me where i can get these plastic blocks models for minecraft thing?
Man your channel is still kinda new but i love this kind of content! Like just making games.
I'm excited when you add completely randomized caves, gon be painful to code.
Here is how Minecraft does this: When you break a block the chunk is stored. And make fake pre-generated chunks when breaking or placing a block and storing that action. at the location and new block (if there was no block maybe set it as nil and handle nil blocks as air.)
hi Brandon i don’t know if you remember me but ty for FINALLY uploading
You can make some Bezier Curve Tweens for the dropping blocks
8:22 - beginning video.
the falldamage system is pretty bugged, think about this:
player starts climbing ladders, y= 40
player jumps off from ladders, y = 50
player lands, y= 40
player did not take any damage
this is something stupidly late, but for the grass you can use the random.new() method in the paranthesis you can write a seed. to get a random number you use random.new(seed):NextInteger(minNumber, maxNumber) this is basically math.random but it will give the same answer depending on the seed. so its kinda like your old method of spawning grass.
also for the loading thing, you can assemble the Chunk in like replicatedstorage or serverstorage and then parenting it to workspace (or it's folder if you have one) might be less laggy
(i'm not rlly experienced in optimizing if you can't tell)
"You can't have Ro or Blox in the name of your game"
*Blox Fruits panicing noises*
Blox Fruits makes roblox a lot of money, they won't delete it as long as they make them all that chedda! *Sorry for saying that.*
@@boblox_studio_dev Ik lol
I need the name of the gameeeeeee ALSO PVP WOULD BE REALLY AMAZING LIKE FIREBALLS LIKE BEDWARS MAYBE? MAYBE?
walking on grass makes green particles not brown
Nice free assets, you clearly didn’t make that UI, it’s a freemodel that I’ve seen other mass upload games use. The view model is broken and they are missing features. Stop trying to pass this off as your own.
Will there be an option to create and load worlds for singleplayer? If yes, that would be a cool feature!
For the buggy terrain generation i was thinking of something. Instead of loading blocks, why not load faces just like minecraft. Bassicaly instead of multiple faces which are hidden by other faces why not absolutely hide those faces. So the code will check if that face of a block is facing toward air. If true then the face will appear but if there is block then it will not.
By the way i learn this from another video called "why minecraft is technology feat" or smth like that. :^
Seeded random number generators would work better in favour of the perlin noise for the grass generation. That way, you can still have a chance of getting grass on a grass block AND still have that minecraft feel.
As for perlin noise, we have 3 maps, One for height and tempature (used by biomes) and i don't rememeber the last one.
i recommend changing the game name from "mineblox" to something more original because lots of roblox minecraft games (that really suck) already have the "mineblox" name and people will maybe think that your game is another one of those bad quality games.
Awesome work! I’m thinking about using perlin noise for an infinite backrooms game, thoughts?
I am pretty sure that you are..... AMAZING! LIKE FOR REAL NO JOKE NO JOKE!
Epic video! i can't wait for the relase! you should add vr support
Imagine you completed the game and when you upload it,it immediately gets copyrighted/deleted by Minecraft/Roblox
Imagine you completed the game and when you upload it,it immediately gets copyrighted/deleted by Minecraft/Roblox
Your terrain generation looks so much more varied in height and better than what I got from a tutorial
Good job
Hey i wanted to ask. I made world generation and it lags a lot even with only a 64x64 world. I was wondering if u did something for optimization to make it not as much
dude! you should save the game once or twice as a file, because if roblox deletes your game you could just copy paste the file in studio and post it under a other unbanned name.
btw when are you releasing a demo? i cant wait to try it (or could i maybe playtest it?)
For making patches of grass, use both Perlin's noise and the 25% chance for grass to spawn
no way, 100K views on the last video!?!??!!?? THAT'S 700 DOLLARS
Hey I’m trying to do random terrain generation with a checkerboard pattern block. Could you show me the script bro?
You need to add phyisics cuz when you dig down its just flying
Hopefully by part 3, when an item is mined/dropped, the dropped item will find the lowest surface point and animate itself there.
OMG ANIX I MISS UR BLOXBURG VIDEOS SM! I'M SO HAPPY YOUR STILL POSTING! I LOVE UR VIDEOS EVEN IF THEY R NO BB RELATED! AHHH!, YOUR THE ONLY REASON I STARTED PLAYING BLOXBURG!
as both a fix for the inventory and spinning of the flowers, instead of using two parts with decals on them use one, this would allow it to spin and would look much better in the inventory.
What about hitbox then
@@someguyigotbann7753 no clue, i was just throwing a simple idea to help it, i feel as though it wouldn't change much but id be unaware.
@@miwako1976 oh
ANIX!! IM DOING EXACTLY WHAT YOU'RE DOING AND IM A LITTLE BIT AHEAD OF YOU, HOW DARE YOU IT WAS ME WHO WAS SUPPOSED TO RECREATE MINECRAFT AND GET RICH😭😭
some tips:
to make smooth curves on block drops use bezier curves
to make models spin just tween the primary part and unanchor/weld the rest to the primarypart
6:58 you can just do math.abs(hrp_position.y - last_y) instead of a clunky if-else statement
18:10 i knew it, i would do the same too lol
You did a but of ooff camera mining for a month