I added Entities to my Minecraft Clone 🐽!
Вставка
- Опубліковано 10 чер 2024
- In this video, I will add entities to my C++ Minecraft Clone!
#cpp #minecraft #opengl #gamedev #programming
Join my Discord 🕹️😎:
/ discord
Check out my game Midnight Arrow:
store.steampowered.com/app/23...
Join this channel if you want to support me 😻:
/ @lowlevelgamedev9330
Playlist 🥵:
• Minecraft clone
Check out Tesera:
/ @tesera_game
tesera.io
Repo:
github.com/meemknight/ourCraft
Music:
Evan King - Virtually Impossible
/ contextsensitive
contextsensitive.bandcamp.com/
Minecraft soundtrack: C418 - Aria Math
Bring Me The Horizon - Can You Feel My Heart
Minecraft soundtrack: C418 - Minecraft - Розваги
0:01 the video in the middle seems to be made by a really cool dude. Also really interesting video
yes defenetly, thanks for stopping by 💪
coding an entire 3d multiplayer game in c++ without an engine requires insane skill
hey that compile time thingy reminds me of someone who also likes to overcomplicate his life with compile time thingies ;^ )
3:29 creeper ?
aw man
That's actually how the creeper was originally made. Notch accidentally messed up the pig model which gave him the inspiration for the creeper
"It took 1 entire week" dude :D. 1 week is nothing in software development, don't beat yourself up if something takes more time than expected. I had to invest a month in order to get close to a solution for a hard problem I had with a project.
totally agreed but I'm lazy 😭😂💀
@@lowlevelgamedev9330 I mean, which programmer is not lazy 🤷♂️
@@lowlevelgamedev9330I mean, which programmer is not lazy? 🤷♂️
@@knitnatsnokprogramming true true.
Dani,
@@lowlevelgamedev9330 that's me with my current project with a database system I'm doing entirely from scratch, some days I'm lazy some days I'm productive as hell 😂😂
One correction: In minecraft the limb animation is done with sin waves, not triangle waves.
i saw one of your previous videos and forgot to comment. i think the "undo system" for client side prediction and resolution of terrain updates is very clever
i do hope you handle "bulk updates" with it carefully though (IE chain reactions that occur, such as a redstone wire updating other wires around it, or a sugarcane breaking all the ones above it, ect)
6:07 The compiler actually just executes the function and stores the result as a variable, if you check disasembly you can see that there is no function call (if possible)
All that compile-time stuff will make compilation times longer.
It also means that you will be more restricted to programming the game in C++ rather than using a scripting language layer at a later point.
The memory management concern can be solved by using shared_ptr's, which are implemented in STD.
The compile-time solution will also make it more difficult to plug-in alternate implementations of an interface class for certain behaviors, because that will require multiple definitions of the "outer" class to support other types, or have the component classes be all-inclusive instead of using different types.
So for example, if you wanted to make one pig smarter than normal pigs, you could have a component for "AI" which provides all the abstract pathfinding logic. The smarter pig would have the "SmartPigAI" component which inherits from "PigAI".
If you store the 2 "PigAI" components as standalone instances with shared_ptr's on the "Pig" class, you can swap out the instances at runtime to get different behaviors, as compared to removing the original pig entirely and replacing it with a "SmartPig" class instance.
I'm too lazy to answer in detail in text to all of this so I will say that it compiles in like 2 secconds rn (I use glm that is already more heavily templated than what I will ever do) and adding a scripting language means that you need to make a binding for it, adding all sorts of problems, with no benefit except compile times, that already aren't a problem so
@@lowlevelgamedev9330 It's your game engine, so you are the boss.
But inheritance is a design pattern that gets annoyingly complicated pretty quickly, which is why a lot of modern developers try to avoid it.
Could you make a video on OOP vs DOD and how you usually write code regarding this?
7:53 why not? Minecraft does that. You can limit pathfinding operations count per frame.
it would simply be more efficient to take all entities in a radius of the player, then calculate the fastest way to a player ONCE per x frames rather than do that every single time, maybe even limit that to hostile entities only, maybe the youtuber should also give a mob type to the entities, hostile, neutral, passive etc sort of like minecraft :)
you could also interpolate those path findings so they look more linear rather than just giving it the new path (re-calculate) so then - a zombie following you to a block you were previously at then getting the update that you are actually on 5 x blocks away right when he's about to get to your old location, this way it looks more smooth and it'd be way more optimized than what you suggested, but then you have also other problems like mobs having different verticalities and so on, could always limit that as well in the y difference player vs mob, obviously not as easy when you actually go to implement it.
i think minecraft did that pathfinding operation per frame solution because they're single-threaded, and on top of that they never thought about interpolating pathfindings so it'd look less weird if they dit pathfinding less often, so they just run it consistently every now and then per each entity but not all at once (because again we're single-threaded), simply doing it every 1/2 of total fps, should result in a very smooth experience regardless of what fps you have, and it'll always scale linearly with your pc's performance.
oh interesting, did't know that but why yes since I found a better way to do it 💪
@@lowlevelgamedev9330 isopaque and istransparent is also not ideal, do bit masking instead, istransparent takes too much to execute, isopaque will also become more annoying down the road when you have more stuff to care about.
@@depralexcrimson unless they have different goals :) then his solution simply doesn't work.
this addition alone made your game the best minecraft clone for me, yes even better than minetest
well I wouldn't say that yet but maybe in the future 💪
Will you do proper pathfinding for zombies (A*) because thats what modern Minecraft does. Old versions just made zombies walk in the direction of the player.
yes 💪💪
Yo if you make a survival mode I have an idea:
Retexture the bugged pig model so that it's a rock golem. It lies dormant until you alert it (how is up to you), and it'll wake up and attack you, doing a massive amount of damage and only becoming dormant again if you die or get far away. It also has a chance to turn a nearby rock into a golem.
I was actually thinking of adding golems but ther's a lot of work unti than
nice
Hey. 🧙🏾♂️
You are my idol. I want to build games like you.
start doing it then, lad.
you will never do anything if you do not start.
gg to whoever found steam key before me
LE COUCHON!!!
Pathfinding is not that hard. I think you could somehow use A* or smth like that and somehow make it work 3D
yes, it actually will be even easier than a* probably
A* works the same way in 2d, 3d or even 4d. Doesn't require any special work. For zombies every solid block that has 2 air block above should be considered walkable. It's easy to get valid neighbours and find path.
@@vatyunga Yeah, you would just need to add some more conditions for where you could walk to. But that shouldn’t be too hard.
how to download?
you need to compile the project, the github link is in the description, and you also have instructions there
you need to compile the project, the github link is in the description, and you also have instructions there
ok nvm you don't have instructions there but clone the repo, right click in the folder and select open with visual studio
Can u pls teach us vulkan if possible. Pls plsplsplspls
I found something better... and it is called compile time polymorphism
Lets go
Hmmm nice game
Try to remake it in directx8/direct3d
directx 8 ⁉ god damn at that point port the whole engine to windows 95 💀
Why??
I can not listen to this gay!