I added Crafting to my Minecraft Clone!

preview_player
Показать описание
In this video, I will add crafting and inventory to my C++ Minecraft cline!

#cpp #programming #gamedevelopment #minecraft

Join my Discord🤖:

Check Out ALL MY MINECRAFT clone VIDEOS! 😱:

Source Code 📜:

Check out my Steam Game Midnight Arrow 🕹️:

Join this channel if you want to support me 😻:

Рекомендации по теме
Комментарии
Автор

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.

darkfllame
Автор

Please man I’m shitting myself watching these because there’s no hand sway

TheJasonParser
Автор

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.

DEADLY_SIGNAL
Автор

thats awesome. after finishing the project you may add the forge/fabric mod support.

KaptanUfuk
Автор

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.

Soraphis
Автор

You should add JSON serialisation, so new recipes (and other things) can be added with just JSON files

MrCrompz
Автор

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 :-) )

sharokhkeshawarz
Автор

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]

gky
Автор

each item has an ID so you should add each item ID in a crafting recipe together and that gives the hash of that crafting ID. then you use a hashmap and do the same thing in the crafting recipe to get what recipe the person is trying to build.

if there are multiple recipes with the same hash then you can create a loop and do your solution for finding the correct recipe. This does mean every recipe would be shapeless so you could also add code to make sure its in the correct recipe

griffinmartin
Автор

Wish me luck I am trying to make a Mario type game in python. And I found your tutorials very useful

muhammadumar
Автор

You are a living legend really just want to make games like you

Simple_OG
Автор

Gotta add 3d block previews in the inventory

vycdev
Автор

The metadata is nbt, you can just use that in the item data struct

theaiguy_
Автор

6:22 It should not even be once per frame but rather once per item inserted, so the performance really does not matter that much.

nein
Автор

you said you're planning on adding things like extra-big crafting tables and more inventory slots, so i don't know if it's really a "minecraft clone." do you want to go more in an RPG direction like terraria?

niicespiice
Автор

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

entchenkleinente
Автор

Amazing ideas presented, but, have you thought abbout modding (adds many blocs and recipes)? And what about functional blocks like a furnace or modded minecraft blocks like the Extreme Crafting Station or AE2 system? Wouldn't it be better to make your system handle 2^32 items or recipes?

Aerobiker
Автор

Why not make a hash that holds the data of all items in the crafting table instead of manually checking. I think with some good implementation there would be flexibility with the crafting.

YoikySploiker
Автор

I have seen 3 people making minecraft clone with different languages.

cubymc
Автор

why does the camera movement not seem really smooth like in the original minecraft ?

painkiller
join shbcf.ru