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 XMLI have decided on XML as the extension language for these reasons:
- XML is easier to read than JSON especially when the data gets very hierarchical.
- XML has a schema definition mechanism that JSON doesn't, this will make the parsing of the specification easier.
- The tools for transforming XSD to C# classes already exist.
- 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 BookIt 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.