Forum rules - please read before posting.
Tech questions during the weekend? Drop in on the community Discord channel!

Project Organization

edited August 2014 in Technical Q&A
Hey all - 

I'm in the process of rethinking how I should organize my project and wanted to run it by you all to see what you thought in terms of organization/optimization and how AC would best behave.

In a hypothetical situation, say there is a game that is broken up into multiple "days" (I say hypothetical but I mean actual...because that's what I'm doing).  Each day has a host of locations that the player can explore.  There are outdoor areas that they can walk around in, they can discover a house, open the door, transition to a house "interior" environment, explore that, leave, continuing exploring outside, etc...Now that house might have different events that might take place on different days, or it might change look, etc...

I currently have every exterior and interior broken out into separate scenes and I'm just calling Change Scene on a trigger enter when it's necessary (or on a specific event), but have different versions of each of those scenes for the day in which it takes place.  Ie:

-> Scene: Day 1 - Town Exterior
-> Scene: Day 1 - General Store
-> Scene: Day 1 - Saloon
-> Scene: Day 2 - Town Exterior
-> Scene: Day 2 - General Store
-> Scene: Day 2 - Saloon

To me that makes more sense from an organizational standpoint, but I did have someone suggest that I make each day its own large scene that would contain *all* locations and characters relevant to that day...this seems like it would be very unwieldy, but I'm open to looking into it.  So it would be more akin to this:

-> Scene: Day 1 - All necessary locations/characters
-> Scene: Day 2 - All necessary locations/characters
-> Scene: Day 3 - All necessary locations/characters

It certainly cuts down the number of scenes in the project, but I'm nervous that it would just become a massive beast that would be difficult to track down issues and to optimize later down the road.

Any thoughts?


  • edited August 2014
    You haven't considered a simpler scene structure which is this:

    -> Scene: Town Exterior - All necessary days including contingent events
    -> Scene: General Store - All necessary days including contingent events
    -> Scene: Saloon - All necessary days including contingent events

    Seeing as you reuse your scenes it would seem better to simply repeat the same exact scene for each day but have it change according a day variable. You don't need to use such a day variable to alter what the player's action must have necessarily changed: use 'remember' scripts for that which you will need to do anyway if you want to remember between locations even on the same day.You should even be able to alter colours to change time of day if needed.

    That said, duplicating scenes which re-use the same sprite objects doesn't seem to increase data size much (I am using the 2D game type and unsure about 3D but assume its 'similar). It still seems better to have identical locations be re-used. Especially if you are going to have many more than a mere handful of days. Even a "small" 1mb data increase from having a duplicate every location scene file-per-day will add bulk if you have many days.

    Each of your scene files may now get more complicated as they have to intrinsically cater for the entire range of days of the story. However, It would seem a better approach unless you are going to dramatically alter what is in each location by the day.
  • Excellent idea!  Thanks so much, Xidore, I'll give it a shot!
  • Hey all - 

    I'm just now starting this process...I have been spending the last few months building out locations and that sort of thing, and decided to put the global variable work on the back burner until now...and here I am looking at the documentation and my project and feeling vaguely like a moron, because I'm not quite sure how to start this particular it involves a few other components and I'm not sure what to attack first.

    I haven't done much in the way of variables yet.  I have a few local variables that are basic true/false booleans that just checks to make sure a player has done something.  If they have done the proper task, then the scene continues.  If they haven't, then something else takes place (they usually get killed).  In terms of global variables, I'm needing a little more guidance .  As Xidore suggested above, I want to setup a "Day" variable to check which day the player is in (there are 7 days in my game), and I'm starting to feel a little overwhelmed.  Right now I have a global variable setup using an integer and just going from 1-7 (or 0-6).  I get that certain interactions can check what variable I'm in, so stuff like dialogue and that sort of thing, I understand...I'm having a bigger issue of having certain objects be available/visible based off of what day I'm in...For example, I want there to be a location that the player walks by pretty frequently to have a crowd gathered around in a certain day.  Do I attach the "Remember Visibility" component on those objects and set a variable to it that way?  Likewise, there might be quest items that show up in certain days and I'm just not sure how to get started on some of that stuff.

    Another big global variable that I need to setup is having the system remember where the player is coming from and going to when on the OverWorld Map scene.  I'm not too sure how to set that one up.  Basically, if you're walking around in the OverWorld scene and walk to the front door to the General Store, I need the system to keep the day in mind when you enter the General Store Interior scene, but then when you exit the General Store Interior and back into the OverWorld scene; it needs to remember the player start location that's outside of the General Store itself...Do I use markers for that kind of stuff and then have another Remember component on those things?  Multiple PlayerStarts?

    Sorry, I'm feeling a bit dumb about some of this stuff in terms of just getting started.  I feel like I need a "Global Variables for Dummies" book.  :)

    Thanks for any info!
  • Just noticed this thread:

    Looks like this could help me out with the OverWorld location I just need to figure out the Day variable!  :D
  • Multiple PlayerStarts are definitely needed if you can enter a scene from multiple locations - each PlayerStart would correspond to a different "previous scene".

    You can also use the Scene: Check previous Action to determine which scene was last visited - may be useful!
  • Thanks Chris!  Quick progress report: Got all of the PlayerStarts in and working, so that's all good.  Going to start work on the Global Day Variable next.  I'm planning on using an integer since there are 7 days, so we'll see what sort of madness I get into.  Any pointers that I should look into as I begin this crazy journey?
  • I would recommend considering the PopUp type, rather than an Integer.  It behaves like an Integer (unless you plan on doing sums with it), but each value corresponds to a label, making it much easier to keep track of when using the Variable: Check Action.
  • I shall do it!  Thanks, Chris!
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.
Do NOT follow this link or you will be banned from the site!