Pre-Order the Game!

Desura Digital Distribution

Monday, December 19, 2011

Race Data Started!

I've started work on the new race data file. The old system used a text file with ugly structure, and the rest of the data (ship sizes and styles, as well as starting system/planet stuff) are hard-coded.

The new system uses a xml file that will be flexible in allowing you to specify different stuff for a race. I've created new xml files for each race, and is now in process of phasing out the text files. The xml files have everything, I just need to modify the game's code to use that.

So far I've modified it to load in the race's name, description, and some of its attributes. Here's a screenshot of the Zero People in the race selection using the XML data:



Now, for the starting system(s) for your race, I think I've worked out a good system (pun not intended). The race will have an element named "StartInfo" that contains all the starting information for that race. It have "System" elements, one for each starting system (it's possible to have more than one system, the game will try and make sure that the race's systems are near each other, not scattered randomly across the galaxy). In the "System" element, there is an attribute "override" that is either "True" or "False". If True, then the system's randomly generated planets will be discarded, and it will load in the planets. If False, then it will randomly replace a planet with a planet in the data. If not enough planets in the system, it will add more planets.

In the System element, there are two types of elements: "Planet" and "Ship". Planet have "type" attribute for type of planet, and "owned" dictating whether or not that planet is owned by that race. Ship have "size", "style", and "name" attributes, as well as "Equipment" elements that tells the game what the ship have.

All in all, this should allow users to create custom campaigns (maybe a zombie race that starts on 25 systems and a lot of junk ships, and you start with only one planet and a couple of ships and your mission is to eradicate all the zombies? :) ), or simply just follow the classic 4X game setup (1 planet per race, along with 2 scout ships and a colony ship)

This system will also be similar to how events will be done in the game. More on that later when I actually get to it.

7 comments:

  1. when empire 1 gets a ship from empire 2 will all the ship's data remain the same as when it was owned by empire 2? except maybe color pattern and emblems?

    ReplyDelete
  2. If an empire loans another empire their ships, the ships stay the same color, but you can order them around in the galaxy. However, in battle, their ships will be controlled by them, and can even retreat without your input (if you tried to bring them to an impossible battle, they may retreat, making it impossible to exploit them that way)

    If an empire trades or gifts you ships, those ships will stay the same, but painted with your empire color. They will become fully under your control.

    ReplyDelete
  3. Are there going to be separate xml files for each race? It seems like that could be more work, trying to figure out which xml files are supposed to be looked at when the game is displaying the race selection menu.
    However, I don't know much about this, maybe it not hard at all. A workaround I thought of while typing this is to have all race xml files in a folder called "races" or something.
    However, for scenarios, it still seems like doing one race file for all the races would work better.
    i.e.

    Human data


    race 2 data

    etc.

    And for a scenario, you could have a folder labeled that, and inside could be the different scenario xml files with a single xml per scenario.

    I am sure you could make it work however you wanted, I just thought I'd offer my thoughts to see if they are worth anything and to further my own understanding.

    ReplyDelete
  4. uhm, there were supposed to be tags around my sample xml file. I should probably preview my comments.
    It should look like:

    i.e.
    < humans >
    Human data
    < / humans >
    < race 2 >
    race 2 data
    < / race 2 >

    ReplyDelete
  5. In the Races folder, there is a folder for each race. Each folder contains the three items:
    Race artwork
    Race XML file that I just added
    Race technologies XML file for racial technologies.

    It's less confusing having it this way than one big folder containing multiple .png files and one gigantic xml file. Besides, the game's code already uses this directory structure, and I'm not doing another overhaul of it.

    ReplyDelete
  6. Okay, sounds like that will work nicely. So if a new race is added, it'll just have its own folder in the Races folder and the game will figure things out nicely.

    ReplyDelete
  7. That's exactly how it works. The game grabs the list of folders from inside the Races folder, and loads them. So to add a new race, you just create a new folder and put in the three files I mentioned, and presto! It's added to the game.

    It is the same with galaxy scripts, AI scripts, and some other data components.

    ReplyDelete