[Progress - 9th March] Spaceship Templates

  • 7 Replies
  • 2137 Views
*

Mark

  • Wired Games
  • Administrator
  • Commander
  • *****
  • 284
    • View Profile
[Progress - 9th March] Spaceship Templates
« on: March 09, 2016, 05:59:02 PM »
Hi all,

I finished the pause system on Sunday, it allows the Captain to pause the game's simulation while still allowing all of the ship's systems to be interacted with.

I have intended to work on the armour system after that, adding the armour condition display to the Engineering UI, but decided to put it on hold while I implement Spaceship Templates.

The spaceships in UNION are modular, but up until now configuring those modules has been hardcoded into the game. That meant you had to modify the source if you wanted to change or add a spaceship, which is important for modding the game. I decided that before I made more changes to the spaceship system I would move spaceship definitions into external editable "Spaceship Template" files.

I has initially thought I would use the XML format for these templates, but XML is so a verbose and difficult to read, so instead I have opted for the JSON format.

To give you an idea of what these Spaceship Templates will look like, here is a snippet of the work-in-progress file:
Code: [Select]
/* UNION Spaceship Template v0.2a */
{
"ClassType": "Frigate",
"ClassTitle": "Kite",
"HullIntegrity": 6540,
"Parts": {
"Reactors": [{
"PowerWheelRotation": 0.0,
"MaxPowerOutput": 9
}, {
"PowerWheelRotation": 60.0,
"MaxPowerOutput": 9
}, {
"PowerWheelRotation": 155.0,
"MaxPowerOutput": 9
}, {
"PowerWheelRotation": 205.0,
"MaxPowerOutput": 9
}, {
"PowerWheelRotation": 300.0,
"MaxPowerOutput": 9
}],
"Systems": [{
"EquipmentType": "Turret",
"Name": "Forward Turret",
"PowerWheelRotation": 0.0,
"Class": 3,
"LocalPosition": {
"X": 0.0,
"Y": -1.185,
"Z": 0
},
"LocalRotation": {
"X": 0.0,
"Y": 0.0,
"Z": 180.000015
},
"HullSectionIndex": 0,
TurretMinXRotation = 270.0f,
TurretMaxXRotation = 0.0f,
TurretMinYRotation = 215.0f,
TurretMaxYRotation = 145.0f
}, {
"EquipmentType": "Sensors",
"Name": "Sensors",
"PowerWheelRotation": 22.5,
"Class": 3,
"LocalPosition": {
"X": 1.05,
"Y": 0.365,
"Z": 1.35
},
"LocalRotation": {
"X": 0.0,
"Y": 0.0,
"Z": 315.000031
},
"HullSectionIndex": 0
}, {
"EquipmentType": "TorpedoLauncher",
"Name": "Rear Torpedo Tubes",
"PowerWheelRotation": 47.0,
"Class": 3,
"LocalPosition": {
"X": 0.0,
"Y": 1.16,
"Z": -2.635
},
"LocalRotation": {
"X": 0.0,
"Y": 180.000015,
"Z": 0.0
},
"HullSectionIndex": 0
}],
"ReactorConnections": [{
"ReactorIndex": 0,
"SystemIndex": 8,
"DefaultPower": 2,
"MaxPower": 9
}, {
"ReactorIndex": 0,
"SystemIndex": 9,
"DefaultPower": 2,
"MaxPower": 9
}, {
"ReactorIndex": 0,
"SystemIndex": 0,
"DefaultPower": 2,
"MaxPower": 9
}]
}
}

Everything, from the systems on the ship to the models and textures, will be configured in these Spaceship Templates.

Thanks for reading!

Mark
« Last Edit: March 09, 2016, 06:48:05 PM by Mark »

*

Blaze

  • Moderator
  • Lt. Commander
  • *****
  • 137
    • View Profile
Re: [Progress - 9th March] Spaceship Templates
« Reply #1 on: March 09, 2016, 07:22:03 PM »
Another great idea!

It would be great if you could document it a bit, though. Let us all know what the possible keys and values for those keys are, what's their impact, etc. Let me explain by asking more questions...

What would happen if we put "weird" values for some of these? For example, setting "PowerWheelRotation": 12.6."MaxPowerOutput": 999999
What would the game do? Crash? What's the max number for each value?
What are Classes in the Systems? Is it better to have a higher or a lower class? How far do the classes span? 0 to 10? -10 to 10?
I'm not a JSON expert, but why are TurretMinXRotation and the 3 following keys not in quotation marks?
How many equipment types can a ship have? Is there a minimum amount? Can we delete the Systems node completely? Can we have two Systems nodes?
How many characters do you allow for the value of "Name"? What about characters? Are they stored and showed ingame as UNICODE?
What happens if we remove or add an axis from "LocalPosition" and "LocalRotation" node?

That's about enough... :D

*

Mark

  • Wired Games
  • Administrator
  • Commander
  • *****
  • 284
    • View Profile
Re: [Progress - 9th March] Spaceship Templates
« Reply #2 on: March 09, 2016, 08:01:53 PM »
Thanks!

We will have detailed documentation for release, but I am more than happy to share more info now. :)

What would happen if we put "weird" values for some of these? For example, setting "PowerWheelRotation": 12.6."MaxPowerOutput": 999999
The system would be positioned at 12.6 degrees on the Power Wheel (0 degrees would put the system at the very top of the power wheel, 45 would be top right, 180 would put it at the bottom etc.), and reactor's max power output would be 50 (the maximum allowed value).

What would the game do? Crash? What's the max number for each value?
Entering values outside of the minimum/maximum/allowed values will invalidate the template and an error containing the issues would be shown when the game is launched (it would not crash, but that ship could not be used). If you join a server which uses the ship, you will be prevented from connecting to it (an error will tell you that this is the issue).
The minimum/maximum/allowed value depends on the setting. We will have a wiki with a detailed modding section which describes the settings, and their min/max/allowed values.

What are Classes in the Systems? Is it better to have a higher or a lower class? How far do the classes span? 0 to 10? -10 to 10?
The class of a System dictates the maximum equipment class that it can support. A Class dictates an equipment's power requirement and performance range. The number of classes is not yet set in stone, but there will likely be 4 or 5 classes.

I'm not a JSON expert, but why are TurretMinXRotation and the 3 following keys not in quotation marks?
These are decimal numbers. In JSON numbers are written without quotation marks.

How many equipment types can a ship have? Is there a minimum amount? Can we delete the Systems node completely? Can we have two Systems nodes?
Equipment types are: Turret, Sensor, Shield, Torpedo, Engine and Cruise Engine.
Spaceships can have between 1 and 16 Systems, you can add and remove them at will.
There can be 1 to 10 Reactors, and up to 50 ReactorConnections.

How many characters do you allow for the value of "Name"? What about characters? Are they stored and showed ingame as UNICODE?
The Name value will be limited to 30 characters, as they have to fit into the UI. All text is in stored and displayed as UTF-8, we will be adding a localisation system at a later stage but all language characters are supported in the game.

What happens if we remove or add an axis from "LocalPosition" and "LocalRotation" node?
This would be an invalid value, causing the template to be invalidated.


« Last Edit: March 09, 2016, 08:11:35 PM by Mark »

*

Mark

  • Wired Games
  • Administrator
  • Commander
  • *****
  • 284
    • View Profile
Re: [Progress - 9th March] Spaceship Templates
« Reply #3 on: March 09, 2016, 08:35:19 PM »
We will be using these Spaceship Templates for all of our ships, so everything which defines a spaceship in UNION will be editable in these files.

*

Blaze

  • Moderator
  • Lt. Commander
  • *****
  • 137
    • View Profile
Re: [Progress - 9th March] Spaceship Templates
« Reply #4 on: March 09, 2016, 08:39:29 PM »
Thanks for the quick and elaborate answer!

Will there be one file per ship, or one file with many ships?

I'm not a JSON expert, but why are TurretMinXRotation and the 3 following keys not in quotation marks?
These are decimal numbers. In JSON numbers are written without quotation marks.
I meant the labels themselves, not the numbers.

*

Mark

  • Wired Games
  • Administrator
  • Commander
  • *****
  • 284
    • View Profile
Re: [Progress - 9th March] Spaceship Templates
« Reply #5 on: March 09, 2016, 08:43:56 PM »
Ahh sorry, that was an error on my part. I am literally in the process of adding those keys to the templates (for turret firing arcs).

There will be one file per ship.

Ships are grouped into mods, and each mod will then be enabled/disabled in the game.

Basically our own missions and campaign will be a mod, which can be enabled/disabled. :)

*

Blaze

  • Moderator
  • Lt. Commander
  • *****
  • 137
    • View Profile
Re: [Progress - 9th March] Spaceship Templates
« Reply #6 on: March 09, 2016, 08:45:12 PM »
One file per ship is good. Makes it much more manageable.

And mod enabling sounds very cool.

*

Mark

  • Wired Games
  • Administrator
  • Commander
  • *****
  • 284
    • View Profile
Re: [Progress - 9th March] Spaceship Templates
« Reply #7 on: March 09, 2016, 08:46:19 PM »
Yeah it's best to have people store their content as mods, and distribute them that way.

That way when you create missions, you include the ships and content the mission requires.

Mods can also require other mods, so if a mod uses content from the standard UNION mod, it can require this mod and use content (like the standard ships) within it.
« Last Edit: March 09, 2016, 08:51:59 PM by Mark »