Thursday, May 19, 2016

The Lost Tribes Extensions

In my play test last Friday it was suggested that before I start working on ships in orbit, I should work on my Missions infrastructure.  Basically, how are missions going to work.  I knew that I wanted missions to be an independent thing from the game itself, so that other players could create their own missions.

Physics infrastructure is something that I knew I needed to do, so extensions have been adapted to handle how a ship is validated and operates within the game.  This plays into a recent decision that ships and space stations will not be things placed in boxes.  Instead a ship is basically an interconnected complex with components performing certain functions.  I'm still deciding on the method for ship validation.

It's Going to be XML

I have decided on XML as the extension language for these reasons:
  1. XML is easier to read than JSON especially when the data gets very hierarchical.
  2. XML has a schema definition mechanism that JSON doesn't, this will make the parsing of the specification easier.
  3. The tools for transforming XSD to C# classes already exist.
  4. The XML files get loaded once at game start, so while XML will use up for more bytes, it's an expense only born at the start of the game.

The Book

It was always my intention to use The Lost Tribes to tell interactive stories based around a core engine.  So each extension is really a book containing one or more chapters, where a chapter is a mission.  The idea of a chapter allows you to have text associated with the chapter, individual objectives and have a bunch of descriptive text around these two ideas.

The organization of the book is as follows.  Starts with "Book (Name with descriptive text)":
  • Uses - Identifies other TLTBooks that contain Material and Building information.
  • Game - Identifies the game seed/generation options
  • Dependency - Identifies books that have to be completed at the difficulty being played to open this book.
  • Difficulty - Identifies difficulties this game supports.  Generally Easy, Medium, Hard.
  • Start - Identifies the starting planet for this player.  Can be "Random" which finds a star system with a planet in the hospitable zone of the star.
  • Required - Identifies raw material that must be present on the player's first planet.
  • Stockpile - Identifies the material that will exist on the player's first planet.
  • Raw - Identifies new raw materials that are available in this book.
  • Material - Identifies manufactured materials the player can make in this book.
  • Building - Identifies new buildings/facilities/components the player can construct and how much time is required by the construction bots to make the building.
    • Input - identifies the material required by the building.
    • Output - identifies the material produced by the building, assuming the minimum units for all the inputs are met.
    • Construction - Identifies the building materials required to make a building.
    • Physics - Identifies how the ship acts/reacts within the physical environment.  Each physic part identifies:
      • Type - Which space domain the ship is present, eg. Normal, Nebula, Hyperspace, QuantumSpace, etc.
      • State - State of the ship within that domain.
      • Action - Desired action of the ship while in the state.
      • Code - LUA code describing how the component reacts when the action is initiated.  If the code requests a state change, then all other physics components must also result in the same state change in order for the state change to occur.
  • Chapter - Identifies one or more chapters for the book.
    • Objective - identifies one or more objectives for the chapter, with one or more of the following rules.  Note this will be amended as the game progresses:
      • Stockpile - The stockpile facility must be added.
      • Complex - A raw complex of a given material must be located.  No buildings need to be present.
      • Building - A building must be added, removed or if it's a "transport in", configured with at least one transport.
      • System - Must discover a solar system.
      • Planet - Must discover a planet.
      • Station - Must create a space station over a planet.