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"

NodeMemory things

i wanted to ask about how we using node memory... when we use standard cast?? GetNodeMemory?? GetSpecialNodeMemory?? and i don't know why in some decorator (e.g BTDecorator_Cooldown) we use reinterpret_cast???

Product Version: UE 4.7
more ▼

asked May 29 '15 at 07:57 AM in C++ Programming

avatar image

202 16 24 35

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

1 answer: sort voted first

All runtime variables should be placed in NodeMemory block. None of base classes use it (task, decorator, service), so you don't have to worry about allocations from parent class.

Since it's being stored as continuous block of bytes, it's best to use regular C cast or reinterpret. Of course this is potentially dangerous, but usually allocations are limited to single class which makes it easily manageable.

If your node requires complex data types (containers with dynamic allocations) please consider changing it to instanced one: set bCreateNodeInstance in constructor. Those nodes don't use memory block, but can operate on class properties/variables instead.

Special memory block is special, and sole purpose of its existence is hiding internal engine-level mechanics from users. Please don't use it unless you really have to and keep in mind to use proper struct hierarchy, so memory layout stays the same.

more ▼

answered May 29 '15 at 08:55 AM

avatar image

IceWraith STAFF
426 13 7 20

(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