Download

How big is an asset reference in memory/over network?

Post must be atleast 20 characters

It’s a bit like saying ‘how much does a bag of flour weigh?’

It really depends on what you’re sending.

Can you be a bit more specific?

Im saying, how much does a reference to an actor weigh in blueprint, a simple variable set as actor reference, how much would that cost to store/send over network?

The actual reference is just a pointer, so it’s trivial, it occupies no space.

But I don’t think you can send that over a network, because the reference to the same actor for another player will not be the same ( I think ).

If you’re talking about multiplayer, I’m afraid that’s not my area…

Wrong. A pointer is 8 bytes (for 64bit).

C++ code to get the size of a pointer.

// Size of a c++ pointer in bytes
#include <iostream>
int main() { int *pointer; std::cout << sizeof(pointer) << std::endl; return 0; }

If that was the case, how would you store the pointer?
The important thing to note is that the pointer is not the size of what it’s pointing to; it’s only the size of the memory address (8 bytes for 64bit). However, this is strictly for c++; in blueprints, it could be more.

For pointers, this is correct. But references in blueprints point to game objects, not memory addresses, so this *may* be handled already. References may store the ID of the object (i.e. the name of the object) rather than the memory address. Just test to find out.

When I say ‘no space’, obviously I don’t mean it literally…

Thx