x

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 ?

I move my units from "MyControllerClass" to move selected ones and I belive I will be ablue to use this in all Levels. Am I right ?

Product Version: UE 4.19 Preview
Tags:
more ▼

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

avatar image

gomi
6 1 2

avatar image phisigma 2 days ago

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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

phisigma
15 2 1 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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