Skill Trees and Cascading Logic in C++ | Code from Scratch

  Рет қаралды 1,393

Code, Tech, and Tutorials

Code, Tech, and Tutorials

Жыл бұрын

Coding up a skill tree is often a matter of checking requirements and prompting the correct options. In this video, I'll show an examples of how to do this.
repo: github.com/codetechandtutoria...
5 discord invites. this expires in 1 day or after 5 uses, whichever comes first
/ discord
there is a $100 challenge in this video intended to motivate some people to code and use github more. good luck.

Пікірлер: 16
@CodeTechandTutorials
@CodeTechandTutorials Жыл бұрын
We have a winner on pushing the rest of the skill tree (and adding extras) Nice Job and congrats to ArtsicleOfficial on Github!
@RichardLucas
@RichardLucas Жыл бұрын
Thanks for all of the videos that you make. Your library is really impressive and helpful as well.
@CodeTechandTutorials
@CodeTechandTutorials Жыл бұрын
Glad you like them!
@gaming53wishmaster71
@gaming53wishmaster71 Жыл бұрын
thanks so much you made me realize c++ is not that hard so i take it switch would be a good way to make a blacksmith or if and if else switch seams cleaner tho not sure if that's the right one to use again thanks so much i may yet still make the impossible possible lol but first i must stick to a small box and learn then keep getting a bigger box as to not get to ahead of the race before it has yet to even start
@joelincz8314
@joelincz8314 Жыл бұрын
As I understand it in C++ there isn't much difference between structs and classes is there a best practice when to use what or is it just personal preference? (I have been coding in C# for work and only last 2 years started learning C++ and C for private use).
@0ia
@0ia Жыл бұрын
In C++, structs are like classes except every member is public by default. I believe there is no other difference; stack overflow will tell you more, and it told me there is no difference. struct Test { int x; } is the same as class Test { public: int x; } Their memory layout is the same as structs. Every time i think of something that might be different between the two, a google search reveals they can do the same things. Have private members, extend other things, etc. I think the only reason structs exist is for backwards-compatibility, to be honest. I guess just pick one and enjoy. Their only difference is structs are by default public, and classes are by default private.
@irfanjames6551
@irfanjames6551 Жыл бұрын
It would be great if you take the source code of Unreal Engine And discuss the new "Lumen" and "Nanite" systems.
@raymitchell9736
@raymitchell9736 Жыл бұрын
Of course I watch more that 5 minutes and read the message, but what I thought was a way to build a tree rather than program each tier like that... I know there's a way to create a binary tree in a linear array... anyway, It was fun watching you code in C++
@CodeTechandTutorials
@CodeTechandTutorials Жыл бұрын
Awesome! You're one of the rare ones! Thank you!
@0ia
@0ia Жыл бұрын
It's nice to have a node-based system where each node has one or multiple parents as requirements. Those are not too difficult to do, though a quick advice is that it's helpful to separate the node-graph-based code from the skill-tree code.
@raymitchell9736
@raymitchell9736 Жыл бұрын
@@0ia Yep, that's the way to do it, I wasn't sure which way he was going because of the Booleans?? I knew that would be tedious to maintain, so I thought that idea would be rewritten, surprised it wasn't and I thought he would use the decorator pattern to add the skills to the player, it was begging for that (obviously) and I thought that eventually the data structure as a node, a typical solution to a node with a Left and Right node, then you can walk the tree, the user interface code simplifies and you could look at the subtree 1 level below are your choices level up choices, then you write the code once and you have it for all skill trees at all the levels going down as far as you like.
@CodeTechandTutorials
@CodeTechandTutorials Жыл бұрын
Makes sense! At the time I was torn between trying to keep it simple enough for new C++ users to understand it and starting to add various design patterns to it. I like the node based approach idea in the long run.
@0ia
@0ia Жыл бұрын
@@CodeTechandTutorials Yea! It seems a hard balance, between intimidating beginners versus just getting something that will make sense to them.
@TheCopperGrasshopper
@TheCopperGrasshopper Жыл бұрын
bro you need 'mind mapping' software lol @ using notepad
The Strategy Design Pattern - Ep 22 - C++ Coding
16:54
Code, Tech, and Tutorials
Рет қаралды 3,3 М.
Other Great C++ (related) Coding Channels I Tend To Watch
15:14
Code, Tech, and Tutorials
Рет қаралды 3,5 М.
Получилось у Вики?😂 #хабибка
00:14
ХАБИБ
Рет қаралды 7 МЛН
Must-have gadget for every toilet! 🤩 #gadget
00:27
GiGaZoom
Рет қаралды 12 МЛН
МАМА И STANDOFF 2 😳 !FAKE GUN! #shorts
00:34
INNA SERG
Рет қаралды 4,5 МЛН
Explaining the RULE OF THREE (C++ Class Standards)
14:27
Code, Tech, and Tutorials
Рет қаралды 2,7 М.
20 Programming Projects That Will Make You A God At Coding
14:27
The Coding Sloth
Рет қаралды 621 М.
c++ lab | making a cooldown timer | overexplained walkthrough | chrono | how to
23:21
Code, Tech, and Tutorials
Рет қаралды 1,7 М.
Agile & Scrum Don't Work | Allen Holub In The Engineering Room Ep. 9
1:12:35
Continuous Delivery
Рет қаралды 109 М.
Where Does Bad Code Come From?
42:21
Molly Rocket
Рет қаралды 184 М.
The 3 Laws of Writing Readable Code
5:28
Kantan Coding
Рет қаралды 339 М.
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 2,7 МЛН
Simple maintenance. #leddisplay #ledscreen #ledwall #ledmodule #ledinstallation
0:19
LED Screen Factory-EagerLED
Рет қаралды 23 МЛН