Forum rules - please read before posting.

How do you handle multiple states/ versions of a single scene?

I'm working on a 2D game, and the player can visit the same location multiple times in the game. Some times that location is seen during the evening, other times during the morning, rainy days etc.

The art is done by hand/ without using lights, so for a rainy scene I give all my sprites a grey tint, for evenings a reddish tint and so on.

Also, the NPCs in that location say different dialogues on the second visit as compared to the first time the player goes to that location. Some NPCs are also absent in the later visits, and some quests also depend on which day it is.

Fortunately for me, the game is linear, which means there's a finite and pre determined number of times the player can go to that location, and I decide the state of the scene for each visit. It'll always be rainy on the second day, the quest will always occur on the third day etc (for a combined total of 6 possible days)

This means that I've copy pasted the scene and made changes each time to create 6 different versions of that scene for each day. This works fine, but I'm worried that if I need to make any big changes to the scene later on, I'll have to replicate those changes for each copy. This may or may not be a big time sink, but maybe there's a more efficient way to go about it?

The other way I can think of is to put the contents of all 6 days within one scene, and use AC to make sprites visible/ invisible according to variables, and have all Action lists for different days within this one scene. But this might make the scene huge, and could also turn out to be very confusing to handle.

How do you guys deal with this kind of stuff? Any tips or obvious methods that I'm missing? :)

Comments

  • It looks to me like you have already thought of the two options I know of. Either make them separate scenes or change your scene around in the On Start action list. Personally, I do the second one, just have one scene. It can indeed become a bit complicated, but it helps to separate out the changes for each day into separate cutscenes that you run depending on a variable, rather than having all the logic in one On Start cutscene.
  • Unless changes are drastic, I'd too recommend using the OnStart/OnLoad cutscenes to configure your scene according to the game's progress.  Presumably which day it is affects other scenes, so it's best to set this in a Global Variable.

    It could be an integer (i.e. to indicate "Day 1", "Day 2" etc), but if you also have morning/evening states, then you could make a PopUp variable instead for greater control ("Day 1 morning", "Day 2 afternoon" etc).

    You could then use that to affect other variables.  For instance, a boolean "Is raining" variable could be used to control the raining effect.  An ActionList asset could be used to determine if the current "Day state" PopUp results in the "Is raining" boolean is set to True or False, and you could then run this list every time you update the PopUp value.

    Making various sprites invisible/visible (or teleporting in and out of view) is one way to make visual changes, but if you're dealing with changing the same thing (e.g. the background sprite), you can also use animation to control the appearance of a single object.  Unity's Animator system can be used to create animations that control the appearance of a single sprite, and then AC's "Object: Animate" Action can be used to playback the animations accordingly.
  • @hightreason I guess I should give that method a shot then, I could maybe start out with smaller scenes with a few variables and see how it feels before taking it over to the bigger ones. Thanks!

    @chrisicebox Interesting, those are a lot of useful tips for implementing this! I'll experiment with it and see how it works out, since both of you have recommended this method :) Thanks again
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.