I added Crafting to my Minecraft Clone!
10,330
Published 2024-08-04
#cpp #programming #gamedevelopment #minecraft
Join my Discord🤖:
discord.gg/eehehsPAka
Check Out ALL MY MINECRAFT clone VIDEOS! 😱:
• Minecraft clone
Source Code 📜:
github.com/meemknight/ourCraft
Check out my Steam Game Midnight Arrow 🕹️:
store.steampowered.com/app/2310670/Midnight_Arrow/
Join this channel if you want to support me 😻:
youtube.com/channel/UChkC4u4KdnIDFh9hPqExLDg/join
Music: Evan King - Booty Shake Robotcontextsensitive.bandcamp.com/Minecraft soundtrack: C418 - Aria MathMinecraft soundtrack: C418 - Moog
All Comments (21)
-
For crafting, what you could do is make a hash list, at startup: you generate a list of the same size as the recipe list, calculate a hash for each of them and put the hashes in the new list, then when crafting: you could calculate the current recipe hash, and check for each of them in that list, it gives better performances on bigger recipe list, but it can have some performances drawbacks when the current recipe match the first one in the list (idk if that makes sense). What you could do is to mix both too, when the searching time become too long, you switch the the hash list technique (with pre-calculated hashes). I think you could maybe add a main menu and procedural worldgen next, could be very interresting i think. Multithreading nightmare will be on it's way to haunt you tho. Btw doing everything on the server is an aweful technique, while yes it works well on single player, on multiplayer: it will be a nightmare for the ones with poor connection quality. What you could do instead is to do server logic on both client and server, that way it could benefits some players. Also, instead of sending each data separately, you could send them all at once each frames, if no data needs to be sent, it sends nothing. (if you don't do that already) Anyway, good video.
-
I feel like 6:20 Could be solved at 0(1) constant time using a hashing, since you can check if a certain item at a certain position matches a hash and allow the player to create the item.
-
5:20 Monday left me broken
-
You should add JSON serialisation, so new recipes (and other things) can be added with just JSON files
-
Please man I’m shitting myself watching these because there’s no hand sway
-
instead of checking all the recipes ones per frame from 0 to N, make it start searching at X where X is the last successfully found recipe. also, since your server has to perform the crafting checks, too a 100 player server is 8.100.000 checks in your scenario. There is a reason for mods like FastWorkbench and FastFurnace.
-
thats awesome. after finishing the project you may add the forge/fabric mod support.
-
The metadata is nbt, you can just use that in the item data struct
-
7:19 ah yes recepie
-
Yo GameDev how much time it took you to let's say be at ease with OpenGL? Appriciate the content that you make keep it up! (ps sorry for my bad english :-) )
-
Wish me luck I am trying to make a Mario type game in python. And I found your tutorials very useful
-
for the verification of crafting, you can make an id of the recipe of the player in the player's crafting table and then search in a look up table the item that supposed to be crafted. for example: if the gold nugget recipe id is 33 (34 if in top center, 35 if in top right ect...) then the item id will be item_id_look_up_table[33]
-
Gotta add 3d block previews in the inventory
-
my biggest issue with performance is generally if i know it will scale badly i always try to optimize it even tho my optimisation sometimes causes more overhead and would only be worth it if my system actually needs to scale
-
You are a living legend really just want to make games like you
-
Oooo nice!!!
-
Monday left me broken
-
I'd recommend installing a spellchecker into your code editor. That way you'll automatically learn better English writing while coding.
-
No one gonna mention how the recipes in code are called "recepie".... now im hungry and want a recepie.... whatever that is jokes aside cool vid 😎
-
just code minecraft from scratch and then add it to this minecraft clone all together duh