I added Crafting to my Minecraft Clone!

Поделиться
HTML-код
  • Опубликовано: 7 янв 2025

Комментарии • 136

  • @darkfllame
    @darkfllame 5 месяцев назад +47

    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.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад +10

      yo so yes a hash would work probably, but that system is not worth optimizing since it will probably literally be the last one to cause performance problems. So to answer the other part of the comment, I actually already have procedural world gen with structures, I have a video on that, and also I do actually have a lot of predictions on the client, you can search my videos on that if you want to know more details 💪 And I also have multi threading on the server

    • @kiryonnakira7566
      @kiryonnakira7566 5 месяцев назад

      i'd use a tree instead of a hash list. You only have n checks to do at most no matter the recipe, n being the number of cells in your crafting grid.
      I'm not good at explaining so here is how i see it:
      if the only recipe was a wooden pickaxe, here is what it would look like:
      `{"plank": {"plank": {"plank": {"": {"stick": {"": {"": {"stick": {"": "wooden_pickaxe"}}}}}}}}}`
      if the only recipe is a crafting table:
      `{"": {"": {"": {"": {"plank": {"plank": {"": {"plank": {"plank": "crafting_table"}}}}}, "plank": {"plank": {"": {"plank": {"plank": {"": "crafting_table"}}}}}}}, "plank": {"plank": {"": {"plank": {"plank": {"": {"": {"": "crafting_table"}}}}}}}}, "plank": {"plank": {"": {"plank": {"plank": {"": {"": {"": {"": "crafting_table"}}}}}}}}}`
      now the 2 merged together:
      `{"plank": {"plank": {"plank": {"": {"stick": {"": {"": {"stick": {"": "wooden_pickaxe"}}}}}},"": {"plank": {"plank": {"": {"": {"": {"": "crafting_table"}}}}}}}},"": {"": {"": {"": {"plank": {"plank": {"": {"plank": {"plank": "crafting_table"}}}}},"plank": {"plank": {"": {"plank": {"plank": {"": "crafting_table"}}}}}}},"plank": {"plank": {"": {"plank": {"plank": {"": {"": {"": "crafting_table"}}}}}}}}}`
      But heh, what do i know, it probably has many flaws.

    • @reedthorngag1810
      @reedthorngag1810 5 месяцев назад +7

      @@lowlevelgamedev9330 it may be worth it to optimize it for the sake of the server, as wasting cpu time on stuff like that will make a noticible difference in how many clients it can support at once when you get more recipies, especially if modding support is added. You could put it on a list of easy optimizations tho, and then forget about it for now.

    • @windy6191
      @windy6191 3 месяца назад

      @@kiryonnakira7566 this looks good

  • @DEADLY_SIGNAL
    @DEADLY_SIGNAL 5 месяцев назад +22

    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.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад +3

      yes totally, tho there is no need to do that besides as an exercise. There are other systems that are actually slow and really need optimization that I should work on next.

    • @kitamashi
      @kitamashi 4 месяца назад

      this wouldn't work alone since recipes sometimes can be done different ways, but since the same recipe have always the same amount of the same items, you could build a dictionary hash, yeah
      and boi would that be fast af

    • @DEADLY_SIGNAL
      @DEADLY_SIGNAL 4 месяца назад

      @@kitamashi That's the thing, you could easly add a branch or two to fix that.

  • @TheJasonParser
    @TheJasonParser 5 месяцев назад +60

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

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад +14

      😂😂 okok fain I'll add it

    • @mineral9gang
      @mineral9gang 5 месяцев назад +1

      Bruh it’s so BAD

    • @TheOriginalManTrust
      @TheOriginalManTrust 5 месяцев назад

      Same...

    • @st20332
      @st20332 4 месяца назад

      Gotta say I always turn off bobbing, thought a lot of people did, makes me confused with the jitter tbh

  • @TheJasonParser
    @TheJasonParser 5 месяцев назад +21

    5:20 Monday left me broken

    • @TheoParis
      @TheoParis 5 месяцев назад +1

      Avicii 🔥

  • @MoJaKF
    @MoJaKF 4 месяца назад

    Amazing job man!

  • @KaptanUfuk
    @KaptanUfuk 5 месяцев назад

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

  • @Soraphis91
    @Soraphis91 5 месяцев назад +6

    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.

    • @depralexcrimson
      @depralexcrimson 5 месяцев назад +2

      yeah honestly idk why he doesn't precalculate all possible crafting recipes as a hash, and only send the packet (hash) for confirmation when he ends up clicking on the item he gets from the craft.

    • @Soraphis91
      @Soraphis91 5 месяцев назад +1

      ​@@depralexcrimson well, you could get hash collisions, and you'd need to verify that the player has the material to craft it. So, some of the things feel warranted, but there are some trivial optimizations that don't require a complete rework so there is imho no reason not to use those...

    • @RRKS_TF
      @RRKS_TF 5 месяцев назад

      ​@@Soraphis91Hash collisions could be a feature rather than a bug - consider when mods have conflicting recipes. And either way it would drastically reduce the number of direct recipe-recipe comparisons which might be expensive for certain recipes such as metadata or script dependent.

    • @Soraphis91
      @Soraphis91 4 месяца назад

      @@RRKS_TF sure, you can have some form of buckets that allow you to reduce the number of checks, but the guy before proposed only sending the hash (between server and client) but that would not be enough information, to identify what has been crafted.

    • @RRKS_TF
      @RRKS_TF 4 месяца назад

      @@Soraphis91 you would only need to include an extra 8 bytes at most though even 2 would likely be enough to uniquely identify recipes from hash collisions or duplicate recipes. Alternatively you could have the hash map + buckets store an offset into a global list of all recipes. Though it doesn't really matter because this is not something that he really needs to do, he has done recipes and no plan to support user-defined recipes.

  • @gky93
    @gky93 5 месяцев назад

    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]

  • @griffinmartin6356
    @griffinmartin6356 2 месяца назад

    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

  • @Simple_OG
    @Simple_OG 5 месяцев назад

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

  • @MrCrompz
    @MrCrompz 5 месяцев назад +1

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

    • @faultboy
      @faultboy 4 месяца назад +1

      Data driven is the keyword

  • @muhammadumar2952
    @muhammadumar2952 5 месяцев назад +5

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

    • @salim444
      @salim444 5 месяцев назад

      good luck ❤️

  • @spaffx
    @spaffx 5 месяцев назад

    7:19 ah yes recepie

  • @sharokhkeshawarz2122
    @sharokhkeshawarz2122 5 месяцев назад +1

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

    • @faultboy
      @faultboy 4 месяца назад

      Just get started :-)

  • @nein9420
    @nein9420 2 месяца назад

    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.

  • @theaiguy_
    @theaiguy_ 5 месяцев назад +1

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

    • @faultboy
      @faultboy 4 месяца назад

      Or you can use something more performant the CPP way...

  • @vycdev
    @vycdev 5 месяцев назад +1

    Gotta add 3d block previews in the inventory

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад +2

      It would be cool to write some code to render the blocks automatically into a texture, tho that will take some time, will see

  • @Kaama21
    @Kaama21 5 месяцев назад +1

    Monday left me broken

  • @entchenkleinente5747
    @entchenkleinente5747 5 месяцев назад

    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

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад

      yes that is an issue, you have to understand that nothing is free, adding an optimization is not free, it takes time and adds complexity to your code, and that is very important. So if you optimize a system that will never scale, not only you risk making it performe worse, because lol you are not google you don't search over milions of elements, but you increase your code complexity for no reason

  • @niicespiice
    @niicespiice 4 месяца назад

    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?

  • @devwckd
    @devwckd 5 месяцев назад

    really cool dude

  • @Aerobiker1
    @Aerobiker1 5 месяцев назад

    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?

    • @darkfllame
      @darkfllame 5 месяцев назад

      minecraft's first moddability/expandability thoughs came really late in the dev process you know ? modding will probably be added in 5 devlogs or maybe more. And to be honest, mojang is trying to remove modding from minecraft by trying to stop updates to mc java. Just, the lack of moddability isn't a big deal yet.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад

      ok so I don't think I will add moding. I will defenetly add things like chests or furnaces tho 💪. The system can already hold thousands and thousands of items and blocks and crafting recepies, so I won't ever have a problem

    • @diadetediotedio6918
      @diadetediotedio6918 5 месяцев назад

      I think a modern CPU can handle at least some millions of items pretty darn fast

  • @painkiller7769
    @painkiller7769 5 месяцев назад +1

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

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад +1

      yo so I have optimized the game but I still have a wierd lag spike that I still haven't figured out how to fix :((

    • @faultboy
      @faultboy 4 месяца назад

      ​@@lowlevelgamedev9330Look into profiler libraries

  • @YoikySploiker
    @YoikySploiker 4 месяца назад

    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.

  • @Jurasebastian
    @Jurasebastian 5 месяцев назад

    Could you make for example book item contain some form of id that will be used later when player use the book then player do separete request to the server to retrieve content of the book or save new content?

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад

      yes but that would really overcomplicate the code by a lot so it is not worth it

  • @AlbertIkolo-bq7qj
    @AlbertIkolo-bq7qj 4 месяца назад

    I'm a student at a boarding, and I don't feel like learning c++, but I planned to use C and lua to make it give me help I want to pass my final exam

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  4 месяца назад

      yo so, I mean cpp has a few usefull features, I use cpp like it is c, but if you want c thats ok. About lua, I don't really like the idea of using a scripting language for game programming, like the idea is that you can let artists code, but you are not an artist you are a programmer so you don't get much benefit. So I have some videos to help beginners start making games from scratch maybe those will help 💪💪

  • @YoikySploiker
    @YoikySploiker 4 месяца назад

    What libraries are you using?

  • @potatoking5602
    @potatoking5602 5 месяцев назад

    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 😎

  • @AndyQuinteroM
    @AndyQuinteroM 5 месяцев назад

    Wouldn’t having a vector allow for DDOS attacks? Like the book exploit that happened in Java Minecraft?

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад

      I mean I will have a maximum size for items, I still have to take care of that tho

  • @dantheplanner
    @dantheplanner 5 месяцев назад

    You're so awesome.

  • @echo_the_developer
    @echo_the_developer 5 месяцев назад

    can you add a texture pack system like minecraft has? you can have a directory assets/resources/textures/blocks and assets/resources/textures/items and entites and so on

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад

      I just did it 😂😂😂😂 fr, like I just pushed 30 min ago, you can find some ss on my discord server

  • @bayroot7385
    @bayroot7385 5 месяцев назад

    When hand sway?

  • @cubymc6338
    @cubymc6338 2 месяца назад

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

  • @coyo_t
    @coyo_t 5 месяцев назад

    does the crafting grid take into account mirroring like minecraft does
    because you can craft things horizontally mirrored
    also how will shapeless recipes get slotted into the system

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад

      yo so I havent implemented this but it is very easy, I will just add flags to recepies for miroring or shapeless. Right now I just have a flag that allows for recepies to use any wood type 💪💪

  • @ohimdabiggestbird
    @ohimdabiggestbird 5 месяцев назад +2

    just code minecraft from scratch and then add it to this minecraft clone all together duh

  • @razvan795
    @razvan795 4 месяца назад

    i understand that you don't need to optimise crafting recipes, but how about store a hash value for the recipes?

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  4 месяца назад +1

      honestly it is hot worth the effort. As I have my code now its way easier to check for specific cases like shapeless recepies or recepies that also read the metadata of items. Adding an optimization is never free. It takes time and it usually removes code flexibility

  • @razvan795
    @razvan795 4 месяца назад

    revision number cannot be exploited if the rule is predictable? like increase with one? if i know that server will invalidate my action, i can send in the next package the illegal item by knowing the next revision number

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  4 месяца назад +1

      Good question. No because I don't only check the revision number but also the item. The server know my exact state so he knows if I introduce a random new item

  • @Speiger
    @Speiger 4 месяца назад

    Interestingly getting to 5 digit recipes isn't hard in minecraft itself. Especially modded.
    Also you are not accouting for things like automation.
    Though a "last recipe cache" would help drastically there.
    Also the reason people say its a bad way of checking recipes is because minecraft already showed how it can be done better.
    Simply have a way of checking things per recipe type.
    Its very unlikely you reach an early out anyways in the first place.
    Shaped recipes for example can be optimized by using a recipe size compare. (Aka how big the grid being used is, EDIT: I mean slots being used in the inventory. A simple rectangle compare of width/height)
    That discards recipes that dont have the same shape without testing its contents.
    Shapeless recipes can just compare in the beginning how many items are present in the grid and if the number doesnt match then thats skipped.
    After that you dont compare slots but lists of elements.
    There are more types of recipes but they usually extend these two usually and just need a hook at the initial comparing stage.
    And both of these requirements for each recipe type can be precomputed (lazily) and are effectively reducing the slowness of recipe comparison...
    Technically minecraft does more than that but these are the biggest optimizations that are actually free since you generate caches 1x that are faster to generate then comparing 9 recipes.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  4 месяца назад

      I mean that is true but optimizing this system would be a waste of tine since it is literally the last system in the game that can cause lag problems. I have to optimize rendering networking chunks and others before this one. So I would just add code complexity for no reason

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  4 месяца назад

      like my point is I could optimize it and give you the 2 versions of the game, and you would never be able to guess not even after profiling the game, which version is the optimized one

    • @Speiger
      @Speiger 4 месяца назад

      ​@@lowlevelgamedev9330 WTF youtube. Not telling me that this comment was answered to.
      I saw your second video and read these two comments.
      But doesn't your answer proof my point in the first place? (Especially your second comment)
      Yes when you only apply the optimization to "That part of the game" but nothing else you wouldn't notice it.
      But if you repeat the sentiment you are suggesting you run in the exact issue because it is a death of 1000 needles.
      There are simple optimizations that have barely any complexity increase in them but lets you early out of an rather complex check in the first place then you gain a lot without investing a lot.
      And your argument that "I have worse systems to invest", kinda proofs that point in the first place.
      I don't argue that you shouldn't micro optimize, and that is true, but your cases and the example shown on both sides proof the point that i am making is right.
      Yes PCs are fast to have 1-2-3 or 15 slow systems. But after a certain point you will be caught up by your "its fast enough" suggestion.
      And that clearly happend due to your argumentation.
      Anyways. I think microoptimization isn't a good idea in the beginning, but early outs and optimized design choices (aka using sets instead of lists for checking if something is inside) should be at least applied.
      Small note:
      I hope you wouldn't think that I am a beginner.
      I am just more into optimization than the average coder :)
      Also what i am making a optimization can be the difference between a 45GB file and a 2-4GB file :)

  • @AtsuDeveloper
    @AtsuDeveloper 4 месяца назад

    finally, minecraft jedrock edition

  • @NovaCraftRealest
    @NovaCraftRealest 5 месяцев назад

    minecraft c++ edition

    • @darkfllame
      @darkfllame 5 месяцев назад

      @@NovaCraftRealest that's called minecraft bedrock lmao

    • @crazylabz_ha
      @crazylabz_ha 5 месяцев назад

      ​@@darkfllamewas just gonna say that

  • @MaskMajor
    @MaskMajor 5 месяцев назад

    Imi place directia in care iei jocul

  • @depralexcrimson
    @depralexcrimson 5 месяцев назад

    Why make 2 functions that do the same thing, craft4 and craft9 should easily be made into one, either with a switch case + argument with enum like CraftingType::Inventory and CraftingType::Bench or pass the argument of 4 and 9 based on whether player inventory is open or not if the player is crafting for (int i = 0; i < arg; i++), or if you want to do it the ugly/fast way just check if player inventory is open or not that way you can figure out whether it's a crafting bench (9 slots) or inventory crafting (4 slots), plus on top of that I saw that you do Item(); in the recipe thing (also misspelt recepie), why allocate a whole ass structure that does nothing instead of passing NULL as a sign of "nothing", seems like a waste of memory and additional performance that could be gained(unless im wrong).
    Also IDK why you would want to know on which slot everything is in the player's inventory, seems like a HUGE waste of bandwidth especially for those on metered connections, it would make much more sense if you did all the inventory sorting on client side as long as the items+count match on server-client there shouldn't be a problem at all, you could just make whatever inventory QoL stuff you want to execute on the client strictly in the client code, and execute those functions by communication via packets, this seems like a much friendlier approach for the overall performance of the server, this way u keep the security of cheating and also offload the sorting and stuff to the actual player/client, so you avoid doing unnecessary stuff on the server, could even save the order in a json file or something on the client cache folder, imho when you do the chest inventories and other stuff you could also make better decisions than minecraft like doing caching on both client and server, for example if u don't do anything with the inventory - no updates whatsoever, then you avoid sending useless packets to server, like minecraft does when you open an inventory even if you don't do anything you are sending useless packets.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад

      ok so to answer the first function, I have 2 functions craft 4 and craft 9, but craft 4 reuses craft 9, so it is just for convinience. Keep in mind that I take an array of 4 and an array of 9 elements, to call this functions, and the memory ordering is not the same, so craft 4 takes that elements and rearanges them to call craft 9 corectly. For optimization related things, in order to pass null I would need to take pointers to those elements, and that can cause other problems and indirections that can cause in the end maybe even performance problems. Regardless, this system is not worth optimizing, it is very fast as it is, I don't think you could even measure its cost, the game runs even in debug mode at 60 fps, the bottleneck is the gpu stuff and chunk building. So what matrers most here is how well I am able to maintain this system. And how it id right now it is quite convinient to work with

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад

      and for the second question, I wanted to do that but you can't really do it. Imagine closing the game, the server needs to know how to save your inventory exactly, also because of the example that I showed in the video. So the server needs to know exactly my inventory. This is not really a problem tho, keep in mind that I send a packet only when I move an item, and that packet is actually very small, like it doesn't have the whole item data in it. And I don't send packets when nothing changes.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад

      to put it simply, what you are sugesting works on paper but if you try to do it, you will see that there will be many problems, the server needs to be able to do a lot of things, so in the end you can't get away with it not knowing your state. The server decides if I take items because otherwise, if the client needs to decide that, I need to add a ton of logic to accunt for undoing an illegal item take (if someone else took it before you)

  • @SuperLlama88888
    @SuperLlama88888 5 месяцев назад

    Oooo nice!!!

  • @uis246
    @uis246 5 месяцев назад

    Now make minecraft client that can connect to minecraft servers. Like uis246/AltCraft

  • @Kim-e4g4w
    @Kim-e4g4w 5 месяцев назад

    How fast is the startup time? (I wonder because it takes forever with Java version)

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад +1

      honestly it is pretty fast, in a few secconds you are in the game

    • @Kim-e4g4w
      @Kim-e4g4w 5 месяцев назад

      @@lowlevelgamedev9330 I am impressed of your work, very good. I wish more people that are aspiring to become game developers could watch this just so people could understand why coding close to the metal is always going to be the optimum for making games running fast and efficient. Keep up the good work.

  • @alexandrucoman1082
    @alexandrucoman1082 5 месяцев назад

    are you a Romanian?

  • @lu2000luk
    @lu2000luk 5 месяцев назад

    You made a typo in the description. Line 1 last word. Cline => Clone

  • @chromemtv
    @chromemtv Месяц назад

    how i dowload

  • @kenaniahmc
    @kenaniahmc 5 месяцев назад

    is your camera position wrong?

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад +1

      I don't think so, the fov is wierd tho, I'll change it

    • @kenaniahmc
      @kenaniahmc 5 месяцев назад

      @@lowlevelgamedev9330 alright, I can't wait to see what it looks like!

  • @Noober666
    @Noober666 5 месяцев назад

    You better work on the lighting next or ima crash out 🙏🏿 👅

  • @sachahjkl
    @sachahjkl 5 месяцев назад

    TODO(you): Fix typo "recepie" -> "recipe"

  • @faultboy
    @faultboy 4 месяца назад

    1:52 Jesus christ, that will end in 100s of if-else... you need a mpre generic way

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  4 месяца назад

      I thought of that but the solution isnt really much better, and it is way slower, so if chains will remain for now. They are also very fast as you will see in today's video

  • @AntonioNoack
    @AntonioNoack 5 месяцев назад +6

    I'd recommend installing a spellchecker into your code editor. That way you'll automatically learn better English writing while coding.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад +3

      that would not be a bad idea, tho I don't really like the idea of it

    • @AntonioNoack
      @AntonioNoack 5 месяцев назад

      @@lowlevelgamedev9330 I'm recommending it, because I'm always spotting spelling errors when you show code on screen 😅

    • @4F6D
      @4F6D 5 месяцев назад

      @@lowlevelgamedev9330 That would be an extremely bad idea. My Codeeditor suggests words and when I use a word from german or something else the code editor goes crazy and tries to correct me which is annoying af

  • @alexandrucoman1082
    @alexandrucoman1082 5 месяцев назад

    esti Român frate?

  • @nerts4720
    @nerts4720 5 месяцев назад

    impossible level 😦😦

  • @faultboy
    @faultboy 4 месяца назад

    Using C++ but not using classes with inheritance for the Item data structure? Kinda sus

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  4 месяца назад

      I mean I don't see why should I do that, an item is just an int. And sure polymorphism sounds cool but than I need to alocate all the items on the heap to use them so no thank you. I can just do that like I currently do it

  • @doodocina
    @doodocina 5 месяцев назад

    server don't really need to know where item is located, bad networking programming detected

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад

      than how will the server save your inventory lol? Also its easier to do this and than the server can handle item pickup than pick the item up myself and than undo that. Also how can the server know if it is possible for me to pick up an item since the arangement of the inventory items matters

    • @doodocina
      @doodocina 5 месяцев назад

      @@lowlevelgamedev9330 when you exit game, server saves items with their positions. arrangement of the inventory don`t matter since you can only pick items that in your inventory.
      good luck having more than 10 players without lags with current networking style

  • @mathieucayeux
    @mathieucayeux 5 месяцев назад

    Your implementation of networking won't be as cross platform as you'd like as it doesn't respect endianness nor the sizes of primitives (you send the struct raw data)

    • @mathieucayeux
      @mathieucayeux 5 месяцев назад

      You could at the very least use fixed size types like std::uint8t so that it would be usable on a x32 machine architecture

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад

      so first of all, the game wouldn't work on a x32 bit machine :))) You need a decent gpu to play it. So I don't really care about little endian, is there any modern desktop architecture that uses big endian?

    • @mathieucayeux
      @mathieucayeux 5 месяцев назад

      ​@@lowlevelgamedev9330 Didn't think about the GPU ! True for the endianness, there isn't much computers still using it to this day.
      I was more thinking about aligns and types size but if you keep a single version of it on a same architecture I guess that's fine !

    • @mathieucayeux
      @mathieucayeux 5 месяцев назад

      Really was nitpicking lol, great project anyway !

  • @natanmaia3575
    @natanmaia3575 5 месяцев назад

    Something that Minecraft does under the hood that you might want to steal is that the inventory has a Cursor slot to store items you picked up with the mouse. If you close the inv, if the inv closes because someone broke the source block or you die, items in the cursor slot drop to the ground.

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад +2

      yess, I actually have that, I just have to add the drop to the ground part when you close the inventory

  • @Iowercasebtw
    @Iowercasebtw 5 месяцев назад

    fix your hand bruv and the fov

  • @marks_shot
    @marks_shot 5 месяцев назад

    cまけ

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад +1

      I have a feeling I know what that means 😂😂

    • @F776-b2s
      @F776-b2s 5 месяцев назад

      @@lowlevelgamedev9330 cmake

  • @rileyhawksworth8362
    @rileyhawksworth8362 5 месяцев назад +1

    second

  • @imacutecatt
    @imacutecatt 5 месяцев назад

    10th comment

  • @yds6268
    @yds6268 5 месяцев назад

    Books can be used to "break" Minecraft for item duping. I would just not implement books altogether. There's only a marginal use for them anyway

    • @trashtrash2169
      @trashtrash2169 5 месяцев назад

      Can't you just do it right?

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  5 месяцев назад +1

      I mean yes but I still need to add various items metadata things like enchantments. So I supppse I will add books why not but with a smaller text size, and I'll see how it goes

    • @yds6268
      @yds6268 5 месяцев назад

      @@lowlevelgamedev9330 yeah, smaller text size would work

    • @mansurbm_
      @mansurbm_ 5 месяцев назад

      ​@@trashtrash2169 no. Why would you ever even suggest that?

    • @trashtrash2169
      @trashtrash2169 5 месяцев назад

      @@mansurbm_ Damn.