How to Approach Quest Phases & Event-Specific Instantiation

Hello, community.

I’m working on a 3D mobile RPG project that will include a quest system, and I intend to make the quests relatively robust and easy to edit from a designer perspective. I figured a good way to do this would be to design something relatively similar to the Bethesda idea of quest phases, in that a quest has a certain number of steps from start to finish, each with its own objective.

But when thinking about how to do this I ran into the following problem, when I thought about optimizing for mobile: How do I approach spawning specific items/NPCs for a quest without having everything loaded in memory at all times?

I was reading up on the Resources folder (“Don’t use it.”) and AssetBundles to see about streaming objects into memory as needed, and it made me think of a possible approach: each phase would have a set of objects/NPCs to spawn during its own phase, stored in Unity as prefab. This prefab would be stored in the Resources folder and called up when the player enters the scene applicable to the quest phase (or instantly if the player is already in the correct location), and deallocated upon completion.

I swore I read that AssetBundles can cause some issues with texture atlases, which is what I’m using in this project, so that’s why I’m leaning towards the Resource folder. Is there a better approach than this, or do I not understand AssetBundles correctly? Or more so, am I overthinking this and should just keep the prefabs in the Assets folder?

Any input would be greatly appreciated, and thank you to anyone that replies.

If you create a method that handles loading the needed assets, you can alter/replace the method based on what you find to perform better.
This way, you can get to writing your quests and change just a small part of it later (asset bundle/resources/direct prefab links) if/when you notice an issue.

I hope that makes sense.

You could also consider making a quest phase a scene that is additively loaded. In the scene you could have an object that includes direct references to everything that phase of the quest needs, from quest phase specific npcs and items, to character audio, to even terrain or other location based stuff. When you’re done with that quest phase you’d unload the scene. That way would avoid the use of assetbundles or the resources folder.

1 Like