Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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 ?

Product Version: UE 4.19 Preview
more ▼

asked Feb 13 '18 at 04:35 PM in Blueprint Scripting

avatar image

10 1 4

avatar image phisigma Feb 16 '18 at 02:54 PM

Sorry, I could not understand, what you meant with your very last question.

avatar image gomi Feb 20 '18 at 09:24 PM

I meant can I Access it from a different level but I removed that now from question.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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 PlayerUnits, that e. g. has a property Damage (something that probably every unit has), you have a good start point. Derive from it to Building and MovableUnit, and go on.

more ▼

answered Feb 16 '18 at 02:54 PM

avatar image

135 3 6 9

avatar image gomi Feb 20 '18 at 09:34 PM

Hmm, I think I understood it now, I found class settings and I set parent class as "Unit" BP so now Tank BP is a unit so unit is Tanks father now. Which already has some properties like health, HP and speed.

I could even do units-> movableUnits-> ground cars -> tank1. Correct if I am wrong. Still I have some questions can I ask it to you ?

avatar image phisigma Feb 21 '18 at 09:02 AM

Your more sophisticated chain of inheritance is the right way. Of course, you can ask more, but a forum seems to be a better place for that. When your questions are complex and multiple, you could perhaps start a thread in the Blueprint Visual Scripting section of the UE forum and just leave the link here.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question