I will control large amount of units and which is the better way to do it ?
Hello, I am working on a strategy game. I will place many units and types. That can be building, movable unit, flying unit and all of those will have different abilities. I will move movable ones if they are selected.
Now, how should I do. Just call a blueprint "PlayerUnits" and declare "UnitName" property. Later, if placed units property example equals to "Big Tank" set all the properties specifically.
Here "PlayerUnits" which is a single blueprint will manage all player units. I may put buildings here to or I just add a new BP called "Buildings".
Is that a good idea to manage strategy game units from a single blueprint based on a specific property like Name, Class, Unit Type or tag ?
Can any expert reccomend me a way ? Which one is the correct way ?
No, that’s a very bad idea.
Object-orientated design is a well-known and proven concept. It is very tortuous to reimplement features that are already given by polymorphism by creating such properties. Think about all the overhead: Every unit needs a speed, fire rate, moving animation and so on, even buildings! And whenever you do anything with a unit, you’d have to check much properties (is this movable, can it fly, …).
With a base class
answered Feb 16 '18 at 02:54 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here