Pondering a programming idea, need some insight

Hi guys,

Been working on a game for almost 2 weeks now, and I’ve been thinking of a future game mechanic and how I could potentially develop it using Unreal Engine’s tools.

So to give a bit of insight, I’m building a space game that will eventually contain many star systems, and many NPCs doing their own things.

It’s also planned to have real world economics in regards to supply and demand, trading, etc.

I have a big question, how could I potentially store and update all this data without it being taxing for the user?

For market data:
I’ve thought about either SQLite or Data Tables to handle these things. For example, every hour or so, the market timer will tick for every single station to check their prices and upload it to a data table or SQLite table. Then whenever you’re at a station, it’ll check the table for all the stations in your region, and calculate the average. Then determine how low or high the item is. But I feel if there are hundreds of stations, each with at least 30 - 40 items (at the high end), wouldn’t this get taxing to loop through everything every hour?

For maintaining NPC and station data:
I know when a station or NPC is not loaded, their actors/pawns of course won’t be as well. How do I preserve their data without them being present? Would I also use some data table for this as well? Updating their values every x amount of time? Or would it be better to just keep an array of “NPC objects” and update their values that way?

It’s not the most pressing concern at the moment but I’d love some insight on how to achieve this, because the way I’m thinking seems way too taxing, and I’m sure there are easier solutions.

Thank you!!

Hey there @Scarlet012! You’ve got big plans brewing it seems! It’s definitely good to look ahead. I think it’s a good bet to use a database for large datasets that are going to need to be populated, parsed, and repopulated regularly.

Implementation wise, I’ve had the wonderful pleasure to work with MySQL and SQLite, but never with an API in tandem with UE, so I’ll leave this thread that’s still pretty relevant here and let more knowledgeable answers come through.

Hope this helps, and good luck on your adventure!

Thanks so much for this thread, will definitely have a look.

I’ve had the pleasure of working with MySQL (for my job) and PostgreSQL (for many personal projects). I’m just not sure how taxing SQLite may be if I have to consistently access it repeatedly. But it provides insane amounts of control over which data I want to receive.

1 Like

Hey again @Scarlet012! I was thinking about this post and realized that a MySQL integration plugin is actually available for free on the marketplace for the next 4 days, and realized I should have mentioned that when we spoke about it.

I actually grabbed this one. But isn’t MySQL more of an online database? I’m moreso thinking about SQLite because I may need something that is client side.