Download

Best Solution for storing and calling parameters pre-set for type/amount of enemies and size/amount of actors

Hello UE4 forums.

Still very new to UE4, however I’m looking for the best solution to call certain parameters for NPC’s and objects within the world.

I am using a single level 2.5D scroller. Basically the game is set in an elevator, when the wave of enemies is cleared, the elevator moves down a level, this is just the background scrolling and recycling for the next level.
I intend to have 100 levels in total, so that will be 100 levels with different enemies and objects spawned in for each level.
I am trying to find the best way to store and call these settings for each level.

Thank you for taking the time to read my post.

A Data Table may be enough.

The Row Name being the level name and the associated Struct would hold its data. One can create and/or manage data in a regular spreadsheet, save it in the csv format (json works more than fine, too) and import to the UE. The DT remains linked to the file; if you make any changes, you can reload the DT from its context menu. The engine will even prompt you to do so if changes are detected. The content can also be exported.

You can, of course, create and / or manage the data with the DT’s own interface right in the engine but it may not be as convenient. Depends on the scope and how complex the struct becomes.

It’s unclear if this is a requirement but the Data Tables are static and read only. However, since you’ll be using the Name + Struct combo, you can chuck all content into a Map container. This can then be saved / loaded.

Everynone you are amazing and informative as always, thank you for replying.

So for example, If I place a platform in my level, and set its required size and location, I can move that data into a DataTable within UE, I can then call that DataTable to spawn the items it contains? The settings I’m wanting to store aren’t very complex, it’s essentially size and positions of these objects. Then the enemies will be, how many, what type and where to spawn.
This part of UE4 I haven’t even looked at yet so it’s all very new. I might have to look up some tutorials

As a very crude kickstarter, if this was the data you needed for the level:

This could be the data table:

And you could fetch data like so:

Disclaimer: none of the above makes actual sense, just to demo what I meant / understood from the conversation :wink:

Sounds like a lot of work to do it this way. But hey, if that’s what is needed. Do see below, though.


So for example, If I place a platform in my level, and set its required size and location, I can move that data into a DataTable within UE, I can then call that DataTable to spawn the items it contains?

Yes. But, what would be the point of moving the data across? Since you already have the levels designed, wouldn’t it be easier to just, you know, load them as they are? Or are you trying to introduce some automation to reduce the manual workload? You mentioned recycling - is that the idea? Application size?

In regards to the recycling, check out the video of the game so far

The platforms need to change with each level, as do the enemies.

I’m re-using the background as you can see in the video and incrementing the number decal each time.

Once the level is cleared all platforms will despawn and the player is ported back to the starting position.

I think the datatable method could work though

1 Like