Upgrade System in Unity - Stats Part 2

  Рет қаралды 12,373

One Wheel Studio

One Wheel Studio

Күн бұрын

Пікірлер: 16
@OneWheelStudio
@OneWheelStudio Жыл бұрын
✅Nova UI (Paid): assetstore.unity.com/packages/tools/gui/nova-226304?aid=1100lHSw ✅Nova UI (Free): assetstore.unity.com/packages/tools/gui/nova-free-trial-231156?aid=1100lHSw 📝Blog Post: onewheelstudio.com/blog/2022/12/13/upgrade-system-stats-part-2 ✅Odin Inspector: assetstore.unity.com/packages/tools/utilities/odin-inspector-and-serializer-89041?aid=1100lHSw 📽Stats Video: kzbin.info/www/bejne/eGOtpKyjfd-arKc 📽Code Monkey SO Video: kzbin.info/www/bejne/a5KQq6eZasyWfNk
@TheKr0ckeR
@TheKr0ckeR Жыл бұрын
Always wondered your way with using editor tools! Great video as always
@EEEdoman
@EEEdoman Жыл бұрын
Fantastic video! Was looking forward to this. I also find it funny you also came to the same conclusion of using events to notify of upgrades for classes that may care about it, like I did.
@OneWheelStudio
@OneWheelStudio Жыл бұрын
I love events. Maybe too much. 😊 I really like them in this case and in general as they can let you add functionality without messy coupling. Glad you liked the video! 🙏
@paulwoerks
@paulwoerks Жыл бұрын
Idea for the saving problem with scriptableobjects: just create a base scriptableObject called ResetSO that at OnEnable clones itself into an instance. Then use the instance to make changes. This way you always adjust changes to a clone and treat the scriptable object to start with as a preset
@Moonz97
@Moonz97 Жыл бұрын
Great video as always. I would like to point out a (possibly) unintended side-effect. At 4:58, the code for applying upgrades is iterating through the list; this means the order of upgrades matter. If you start with 10 base damage, then get a +5 damage upgrade, followed by +100% damage upgrade, you'll end up with 30 damage. However, if you received the +100% damage upgrade before the +5 damage upgrade, it will be 25 damage. How would you handle this? Perform two foreach loops, first accumulating the non-percent upgrades, and then in the second foreach loop, compute the multiplier? Also, the dictionary is limited to one type, float in this case. Would storing ints, such as Level or CoinsCount, cause any issues?
@OneWheelStudio
@OneWheelStudio Жыл бұрын
My intent was to have the order of upgrades matter. If you are going to mix things like +5 damage and +10% damage I think something like this is inevitable. I think the solution might be to simply not mix and match types. So if you have +5 damage you don't also have +10% damage. As for the dictionary, yes the value is limited to one type. You could make it a more general type like an object, but that seems a bit silly in this case. I wouldn't expect an issue with storing ints in a dictionary of floats. I would assume that the ints get converted to floats, but if you really need to ensure that particular values are ints you could always round them to ints when you need to use the value.
@johnleorid
@johnleorid Жыл бұрын
I would just sort the list every time an upgrade is added. Multiplications at the end, so the player always has the most gain, no matter when he buys which upgrade. Feels most fair to me.
@AzoBoi
@AzoBoi Жыл бұрын
very good video from ows again
@mrvastayan
@mrvastayan Жыл бұрын
Nice work :D yet another great video.
@myk3l9675
@myk3l9675 Жыл бұрын
Awesome video!
@janikcodes
@janikcodes Жыл бұрын
If I understood it correctly it seems like you are modified ScriptableObjects at runtime, which I'm personally not a fan of as I see them as static and non dynamic data containers which shouldnt be changed often at runtime. But other than that the system is pretty great and you can of course rebuild it with having the ScriptableObjects as non-changeable in mind.
@ArnoVai
@ArnoVai Жыл бұрын
Plenty of folks out there using scriptable objects for runtime use cases. There are two famous Scriptable Object talks that cover it on Unity channel and there are a few frameworks for implementing some of those ideas like Unity Atoms.
@Bapzrz
@Bapzrz Жыл бұрын
damage ++; also a good upgrade system
@rwj_dk
@rwj_dk Жыл бұрын
Especially if it is called in the Update() method 😉
@bluzenkk
@bluzenkk Жыл бұрын
would love to see more use case of odin inspector ... I've bought it for years but ...i only know how to use the simple stuff....and simple stuff aren't worth the effort to instlal the package....
Stats in Unity - How I do it!
8:49
One Wheel Studio
Рет қаралды 43 М.
EASY Stats and Modifiers in Unity | Broker Chain Pattern
16:05
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Be CAREFUL with Scriptable Objects!
8:27
Code Monkey
Рет қаралды 86 М.
Unity Coroutines - Neat and tidy ways to know when they're done!
9:32
One Wheel Studio
Рет қаралды 7 М.
How to make a Save & Load System in Unity
26:56
Shaped by Rain Studios
Рет қаралды 207 М.
How To Make UIs without frustration | Unity Beginner Tutorial
16:58
This is GameDev
Рет қаралды 37 М.
(Better) Object Pooling - I Didn't Like My Old Solution
8:49
One Wheel Studio
Рет қаралды 15 М.
The Attributes that [SaveTime] - Unity3D - GameDev
18:52
Jason Weimann (GameDev)
Рет қаралды 32 М.
10 Things You NEED to Be Doing in Unity
11:40
Tarodev
Рет қаралды 137 М.
Character Stats in Unity #1 - Base Implementation
10:34
Kryzarel
Рет қаралды 101 М.
How to Program in Unity: Observer Pattern Explained
15:57
iHeartGameDev
Рет қаралды 117 М.