#PostBattleUI Suggestions

1 messages · Page 1 of 1 (latest)

vast cipher
#

I am just faking the system rn but I'm not really sure what to do. Should I inherit from player abilities and try to control the array from the post battle UI?

#

I accidentally deleted the original post one second

#

Currently, I have an ability system called player abilities that will use an SO to control what kind of ability is used and modify the UI to match the selected ability with cooldowns, what I want to do now is to make a system that will spawn a UI canvas with two new abilities that the player has the option of swapping the old ones out with

#

In the video shown I only have two equipped abilities, and the goal when the player selects one of the two is that it will fill the third empty slot in the array

#

Once those are full I want to give the player the ability to choose between the three filled slots and swap them out

#

but I'm not really sure how to approach the matter in terms of accessing the SO and changing them out, should I create an AbilityManager that serves as a database and just pull them by index?

vocal garden
#

Pulling them by index is one way of doing it. Another way is to just pass the ability reference from the pop up ui to the drop bar or whatever else needs to have it.

vast cipher
#

You think so? My prof suggested rebuilding the scripts to just use an empty gameobject with a database that pulls the Index as the ID for the ability and use that as the system for accessing all the abilities instead but I also have a little bit of if it's not broken don't fix it mentality for the scope of the game

#

Should I just make a script that allows me to attach the SO to the Button and swap them out then?

#

I wish there was more resources on Game Design Architecture shit is mad confusing sometimes lol

vocal garden
vocal garden
# vast cipher I wish there was more resources on Game Design Architecture shit is mad confusin...

Thing is, it's not really game specific code architecture is something common to all programs, though there are specific things unique to unity. There are plenty of resources on this stuff online. Starting from OOP and SOLID principles and all kinds of programming patterns and models like MVC or MVVM.
Also, while there are a lot of resources and different practices, what is right in the context of your project is ultimately a subjective opinion and a matter of preference. If you just use some smartass patter without comprehending it, it doesn't really help anyone. Good code practices are supposed to make your life easier, not harder.

#

So, to conclude: do explore different techniques and ways of implementation, but ultimately use your own judgment for what's right in the project. That includes accounting for advices from more experienced people like your prof.

#

One important tip though, when given an advice always think and ask, "why". Why do it like that? How is it better than what you already have?

vast cipher
#

I think I'll definitely look more into MVVM principles, in my program our year kind of got fucked by 2 really bad profs on the programming side of things, so I'm just trying to unlearn the bad practices they taught us and relearn how to actually code. Sometimes it's just a little disheartening to hear that even though something is functional, it's not really setup in a good state to be used on a larger scale. Also I really like that last bit on the "why" question. I normally get so wrapped up in the actual functionality that I forget to stop and actually think like a designer

#

I think its partially my fault for picking up such a complex system full of many subsystems and working parts. But I'll try my best to tackle it head on.

#

Do you have any advice for how you would approach this yourself? I like to keep an open mind and try to hear out different approaches to prevent myself from becoming too narrowminded on design problems.

vocal garden
#

I don't know enough about the context to say much, but if talking regardless of context, I'd probably pass around the SO reference. So if I have a button/icon object, it would have the reference to the so, and when I drag it down to a slot, I'd call something like, playerAbilitiesController.SetSlot(slotIndex, abilityReference)

vast cipher
#

That's actually pretty similar to what I have planned, I think if I just combine the new script into a database it should honestly work pretty well. Thank you for your time Dlich, I really appreciate the insight you gave today. When the systems in a functional state I'll throw it in the chat and get some more feedback.