Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Config format
02-28-2011, 03:09 PM,
#1
Config format
To make car configs a bit more readable I've implemented some alternatives to the current ini derived format. All three are available, can be read and written interchangeably. The parsers are minimal, won't check input for correctness.

Code:
# ini (current)
key1 = value1

[key2.key3]
key4 = value4

[key2]
key5 = value5

; inf
key1 value1
key2
{
    key3
    {
        key4 value4
    }
    key5 value5
}

<!-- xml  -->
<key1>value1</key1>
<key2>
    <key3>
        <key4>value4</key4>
    </key3>
    <key5>value5</key5>
</key2>

Any opinions, suggestions?
Reply
02-28-2011, 03:27 PM,
#2
 
i've never been fond of viewing/editing xml in a text editor. nesting could be useful, but i'm not really sure how we'd use it yet.

favorite comment style has always been the c++ //

are there general purpose xml gui editors that are cross platform and make clean-ish code? if so, what about ini or inf style editors?

in a gui inf editor the nesting could be obscured on startup and expandable by clicking the little +. this would do allot for making data entry slicker, but again, i don't really know if such a program exists.
Reply
02-28-2011, 03:53 PM,
#3
 
Quote:nesting could be useful
This has been one of the motivating points.
Code:
[wheel.fl.coilover]
spring-constant = 49131.9
bounce = 2600
rebound = 7900

[wheel.fl.brake]
texture = rotor_shiny_slotted_drilled.png
friction = 0.6
max-pressure = 4.0e6

[wheel.fl.tire]
texture = touring.png
size = 215,45,17
type = tire-touring

[wheel.fl.double-wishbone]
upper-chassis-rear = -0.42, 1.0, -0.31
upper-chassis-front = -0.42, 1.24, -0.29
upper-hub = -0.69, 1.14, -0.3

[wheel.fl]
texture = oem_wheel.png, oem_wheel-misc1.png
mesh = oem_wheel.joe
position = -0.736, 1.14, -0.47
vs
Code:
wheel
{
    front-left
    {
        texture    oem_wheel.png, oem_wheel-misc1.png
        mesh        oem_wheel.joe
        position    -0.736, 1.14, -0.47
        tire
        {
            texture touring.png
            size    215, 45, 17
            type     touring
        }
        brake
        {
            texture        rotor_shiny_slotted_drilled.png
            friction        0.6
            max-pressure    4.0e6
        }
        coilover
        {
            spring-constant 49131.9
            bounce         2600
            rebound         7900
        }
        double-wishbone
        {
            upper-chassis-rear    -0.42, 1.0, -0.31
            upper-chassis-front    -0.42, 1.24, -0.29
            upper-hub            -0.69, 1.14, -0.3
        }
    }
    front-right
    {
        ...
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)