Updating content without shutting down servers

This is more of a “is it possible?” type post rather than a cry for help, but in short: I have a game with a high average session length, meaning that my servers don’t shut down very often. Some servers in my game often last for multiple days before shutting down. This means that when I publish a minor update like adding one cosmetic item, it can sometimes take days for it to be live in all servers, and I don’t want to shut down all the servers just to add one small item.

I was thinking about ways of potentially importing new assets into the game live using InsertService:GetLatestAssetVersionAsync() and InsertService:LoadAssetVersion(). In theory, this is a good idea, as it would fetch the latest asset version and compare it with the last asset version it noted, and if there was a difference, it’d import the new asset version.

When solely importing classes like models and animations, this actually works! However, in my codebase, all cosmetic items have some associated “metadata” which tells other scripts in the game information about them. The information contains things like the item’s display name, icon, price, etc. This information is in a ModuleScript which we update every time I add a new item. Scripts that want to display this information will simply ignore any cosmetics that it can’t find information for.

The problem is that this ModuleScript is required by scripts once at runtime, after which point obviously can not be updated with the new metadata about cosmetics I add. This is the problem I’m wondering if it’s even possible to solve. Perhaps there is a better way of storing the information that would allow for more dynamic updates?

I’m interested to hear if anyone has tried to do something similar in the past and if they were able to come up with a solution. Ideally, I don’t want to set up external solutions like an external database to store this type of information, but if it’s the only way to make it possible then I’m interested in hearing about such implementations.

Thanks in advance :slightly_smiling_face:

1 Like

If you’re very proactive, you can avoid the need to live-import content altogether by adding the content in advance but locking it behind some date or a flag saved to a DataStore entry; then, once all servers have recycled naturally, you can update the flag (or just once enough time has passed if it’s time-locked) and perform what is effectively a live update. I would argue that this is the best approach since it’s very flexible in terms of what content you plan to release, but it can also be annoying to maintain because it requires forking a lot of logic.

Your next best bet with accomplishing this with individual assets would be to bundle the metadata with models themselves and then import it into your primary content ModuleScript once processed. If the metadata is simple, then your best bet would probably be attributes on the top-level model or something. This is the ideal solution if your system can already handle fetching the assets without too much fuss.

You can bundle in a ModuleScript and require it if necessary. I hesitate with making that recommendation because even if you are the author (initially, anyway), you’re still designing your game to expect and execute remote code. This will be less of an issue once Script Capabilities are released, but it presents a pretty big security concern at the moment.

Ultimately, though, I would discourage trying to implement these systems if the intent is to facilitate drip-feeding content to players. You’d likely get more out of your content if you bundle several small updates into a larger one, as players will be more excited being presented with multiple things at once than they would with a single thing. The time-locked/DataStore method is great for things like events, though, if you do want to do synchronized updates without needing to shut down servers.

1 Like