How much disk size and memory size a player character is supposed to use to run in consoles?

Hi everyone,

At first, I know this question can be a little subjective, but I’ll try to give you guys a context to better understand my dilema and with your help, find out the best approach to solve it.

I’m creating a game with metahumans and realistic graphics (a common game nowadays), my starter point was the GASP project and I’m just customizing everything following my concept. I have some Actor Components that’s being added to the SandboxCharacter, and sometimes inside the ActorComponent I need the reference of the SandboxCharacter or access a function from other ActorComponent to follow the logic, for example:

I have an ActorComponent to take care of Input Mapping, it replaces the input mapping if needed/requested and inside the InteractionComponent, if the player pickup a rifle and he was with the Unarmed Input Mapping, automatically it changes to Rifle Input Mapping giving the player controls specific for that, but for this, inside the InteractionComponent I call a function from InputMappingComponent to perform this change. Just an example…

It doesn’t matter if the player or NPC, I use the SandboxCharacter as a base for both, and I read and watched many devs saying to avoid “Cast to” and I’m trying to do it as possible, but it comes with some pain sometimes and I’m affraid of the possibility to increase a lot the complexity of the logic, even though I’m confortable coding, I feel I could simplify this logic A LOT just adding in BeginPlay a Cast to SandboxCharacter (in my case CharacterBase)…

Actually I do a Cast to Character, what’s almost nothing consuming memory and disk, but I don’t have access to my ActorComponents from that.

Other possibility was add an interface to the Character and get the components separately, but it makes my ActorComponent immediately increase the size to 1.1Gb (size of SandboxCharacter in project).

And it doesn’t matter if class reference of object reference…

I tried as well to invert the dependency to the actors, like a rifle, once the overlapping begin (or BeginPlay) just add the ActorComponent to the SandboxCharacter by a function declared in the interface who implements the “Add Component By Class” node, but the ActorComponent and Actor goes to 1.1Gb as well, I’m conditioned to overlapping events or if the actor is spawned in the world to access the functionality, and I continue without access to the ActorComponent as well.

So, my point is: for a typical third-person RPG game with realistic graphics, you can get as reference of gameplay The Witcher 3, how much memory and disk size of a common game budget I might target to be released on PC and consoles of the current generation?

Actually, Sandbox character from GASP alone takes 1.1Gb disk size and 116.5MB memory size, using this a starter point and understanding that the SandboxCharacter will be the base to the player and all NPCs, it can go crazy really fast .


IMPORTANT: I’ll reduce the quantity of animations in the character as well.

But thinking just about the default info we have from GASP, could you guys please give me your thoughts???

It’s a study and portfolio project, and I want to do it right. I know it’s a tiny study project, but I want to do it from a point of view of a AAA game thinking just about optimizing the blueprints as I can.

Thank you.

Hi, generally speaking, everything an object hard references will be loaded into memory as soon as that object gets loaded into memory. A cast creates such a hard reference, as will other things like having a class or object reference (e.g. a variable or a function input or output). So, to break up those reference chains, you should avoid all hard references. Now casting to a base class should not be a problem, if you just have functionality in that class (but no meshes set), since then it has a low memory footprint. Also, to avoid using large amounts of memory where you need references to things that are not always loaded, you can use soft references and async load them as needed.

What I would lookout for, are if things are referenced that take up memory and do not need to be referenced. For example, in your CBP_CharacterBase from the looks of it, it could be mostly empty. There is a skeletal mesh as well as an animation blueprint set. But if the inheriting characters do not all use the same mesh, then there is no need to set it in the base class (but it will lead to the inheriting characters also loading in this base mesh, even though they use a different one). Or LevelBlock_Traversable sounds like something that belongs to the map and not the character. So even if you would create a different map that does not have this LevelBlock_Traversable in it, it would still be loaded since the character is referencing it. Or DA_InventoryItem referenced by the BPC_QuickInven… looks like it references meshes and textures, there you could create a base DA_InventoryItem class that only contains logic and reference that instead (and for the child classes you could use soft references and async load them as needed).

Actually I do a Cast to Character, what’s almost nothing consuming memory and disk, but I don’t have access to my ActorComponents from that.

You could use GetComponentByClass, that way you can access the component and do not create a hard reference to your character class. Would also keep the code more modular :slight_smile:
Similarly, you can also use AddComponentByClass to add a component.