Posted by Data in Cortex Command - July 17th, 2006

Came up with a way to make things even easier on anyone who needs to edit the data files… This is the new format

MOSParticle
 InstanceName = Fire Ball 3
 Mass = 5 # kg
 Position = Vector
  X = 0
  Y = 0
 Velocity = Vector
  X = 0
  Y = 0
 Scale = 1.0
 RestThreshold = 500 # in ms
 Lifetime = 250 # ms, 0 means unlimited  
 SharpnessFactor = 0.1
 HitsMOs = 1
 GetsHitByMOs = 0
 SpriteFile = ContentFile
  FilePath = Base.rte/Effects/Effects.dat#Fireball03
 Frames = 11
 SpriteOffset = Vector
  X = -9
  Y = -9
 HorizontallyFlipped = 0
 Rotation = 0 # radians
 AngularVelocity = 60 # radians / s
 EntryWoundEmitter = None
 ExitWoundEmitter = None
 Atom = Atom
 Offset = Vector
  X = 0
  Y = 0
 Material = Material
  %Air
 AtomColor = Color
  R = 0
  G = 0
  B = 0
 TrailMaxLength = 0
 InitialFramerate = 0 # fps. If 0, will be animated over the lifetime

Which can be written as:

MOSParticle
 InstanceName = Fire Ball 3
 Mass = 5 # kg
 RestThreshold = 500 # in ms
 Lifetime = 250 # ms, 0 means unlimited  
 SharpnessFactor = 0.1
 HitsMOs = 1
 GetsHitByMOs = 0
 SpriteFile = ContentFile
  FilePath = Base.rte/Effects/Effects.dat#Fireball03
 Frames = 11
 SpriteOffset = Vector
  X = -9
  Y = -9
 AngularVelocity = 60 # radians / s
 Atom = Atom
  Material = Material
   %Air
  TrailMaxLength = 0

to get the same effect, relying on default MOSParticle class’ default initialization values.

Basically, the difference from the last post is that I got rid of the special Parent properties required before to define the values of parent properties. Keeping track of the class hierarchy while reading is just a chore the program and not the human should be doing.

You can follow any responses to this entry through the RSS 2.0 feed.
Both comments and pings are currently closed.


2 Responses to “Simplified data files”

  1. gnat - # July 17th, 2006 at 11:52 am

    Hehe, nice.

    Not to mention you’ve pretty much halved the script loading/parsing time 🙂 (in this example at least)

    The only disadvantage I can see from this is that you’d have to keep some documentation around of all the variables the modder can access.

  2. Data Realms - Dev Log » Blog Archive » Data Modules! - # July 26th, 2006 at 5:19 pm

    […] On the file system, a module simply looks like a folder in the game’s directory, named “MyMod.rte” or something. It contains at least one .ini (index.ini) and whatever other resources like bitmaps and binary data files used by that module. For organizational purposes, the index ini can ‘include’ (IncludeFile = MyMod.rte/Weapons.ini) other ini files within the same module, like a ‘Scenes.ini’ or ’Actors.ini’. All these ini files use the new data formatting system throughout (see earlier post). […]