Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » FreeStars » Component File Sample (long)
icon10.gif  Component File Sample (long) Thu, 10 July 2003 14:00 Go to previous message
overworked is currently offline overworked

 
Lt. Junior Grade

Messages: 403
Registered: November 2002
Location: Pittsburgh, PA

Well, here's a snip of what a component currently looks like. We're using XML as the format. If you having coding/processing questions then you need to talk to Leit.

First, a "simple" part: Our buddy the Fuel Mizer engine

<Component>
<Type>Engine</Type>
<Name>Fuel Mizer</Name>
<EngineType>Ramscoop</EngineType>
<Costs>11 8 0 0 0</Costs>
<Tech>-1 -1 2 -1 -1 -1</Tech>
<Mass>6</Mass>
<FuelUsage>-10 -6 -3 -1 35 120 175 235 360 420</FuelUsage>
<SafeSpeed>9</SafeSpeed>
<MaxSpeed>10</MaxSpeed>
<FreeSpeed>4</FreeSpeed>
<BattleSpeed>6</BattleSpeed>
<Value>
<Type>Engine</Type>
<Number>6</Number>
</Value>
<LRTNeeded>Improved Fuel Efficiency</LRTNeeded>
</Component>

"Costs" are a list - Resources, Mineral1 (iron)... Mineral3 (germ) and then Crew/Population (which is currently zero for everything - but added for potential expansion.]

"Tech" is -1 if not required, otherwise the required level. Standard En, Wp, Pr, Con, El, Bio order. We're not looking at adding new tech fields.

FuelUsage is a list of the base fuel usage at each Warp Speed (1-10). Negative values are fuel gain from scooping.

The "Value" block is a recent addition. It assigns a sub-type and value to the component. In current usage the value is checked for when a starting ship design (i.e. Santa Maria colonizer) might have better tech parts available. If you have IFE and > Prop 2 at start your Santa Maria will not have a Quick Jump 5 Engine but probably a Fuel Mizer instead. The "Value" section allows the code to check if a "more valuable" component is available for that starting ship.

In addition to that I think the Value blocks might eventually prove useful for anyone wanting to automate ship design for either an utility or an AI player script.

Finally, note the "LRTNeeded" clause. This ties the component to a facet of the building race. There are also clauses to handle required PRTs and denying the part to certain LRT and PRT values.

Most things are fully named for ease of understanding.

Processing the file converts most of these into much more abstract variable values. Fairly few capabilities are inter-connected. "Ramscoop" type is differentiated for instance; you could also define "ramscoop" = "FreeSpeed > 1" (which is true for the current game). But, this prevents you from later adding
a "standard" engine with a higher free speed for instance without doing some additional changes to the processing code itself.

A "ship" inherits the abilities of its attached "components" - thus inherited classes are used to build up the full capabilites of a ship that can be easily queried and manipulated accordingly in the code.

I'll pull a ship hull next and put it in a separate message.

- Kurt



Time flies like an arrow.
Fruit flies like a banana.
- Groucho Marx

Report message to a moderator

 
Read Message icon10.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Battles
Next Topic: Graphics
Goto Forum:
  


Current Time: Sat May 11 04:14:31 EDT 2024