last day (24 days later) » 

Explain to me--what is this?
@CᴏɴᴏʀO'Bʀɪᴇɴ I'm making a game, but I'm centering it around the crafting mechanics.
Which means that the crafting mechanics are going to be exceedingly intricate and "universal."
Boolean bool;
really?
16:16
So describe to me your crafting system.
Most entities in the game are going to be assigned a set of Tags, which describe most of their properties.
Give something [flammable:true] and it can catch on fire, etc.
@PhiNotPi That's the most extensive Readme.md I've ever seen! ;)
Give something [wood] and it is made of wood.
^^ :D
Why not [material:wood]?
@CᴏɴᴏʀO'Bʀɪᴇɴ The material: is implicit.
In any case, I'm interested in seeing where this goes.
And, then eventually, give something [sentient:true] and [voluntaryMovement:true], and it'll start walking around on the screen.
What is the viewing module? 3D? 2D?
something else?
Will you also have, say, [density] attributes, so different kinds of wood will sink or float on water?
@CᴏɴᴏʀO'Bʀɪᴇɴ I'm limiting my graphic to Dwarf-Fortress levels (read: none) until I have a decent amount of "core" content.
@El'endiaStarman yes
16:21
@PhiNotPi Ah, I see.
There's three types of Tags: strings, values, and booleans.
No offense, and maybe this is Java... but heavens that's verbose.
it sounds like tags types are predefined in the game engine
@NathanMerrill As of right now, yes.
in my text file is adding [someOddKey:foo] valid
16:23
@NathanMerrill Actually, I think it will be, but the game will completely ignore its existence.
@CᴏɴᴏʀO'Bʀɪᴇɴ I know. ;-;
There's three types of tags: string, numeric value, and boolean.
@CᴏɴᴏʀO'Bʀɪᴇɴ I'm about to make a commit to my KoTH controller...its much worse
I couldn't sleep last night, so I spend a bunch of hours working on it
[wood] is a string, [density:2.7] is a real-valued, [flammable:true] is boolean.
My very first iteration of this project pretty much stopped there, but then I realized: wouldn't be substantially better if certain fields can be auto-filled based on others?
There's three different types of fields, one for each type of tag: string, real, and bool.
To describe how certain fields are inherited from others, fields are arranged into a tree.
String and Bool fields, since they are "categorical" fields, are allowed to hold a set of "subfields" that can inherit from it.
Real fields can't have any subfields, since everything that depends on the numeric value (like a density of 1.4 meaning that it sinks in water) requires actual specialized computation.
Will this game be essentially a "toy", akin to Line Rider, where there is no real goal that one must work towards, but instead you can just play around?
@El'endiaStarman Open world, probably.
There's really no point to such a convoluted system in a "normal" game.
"Color" is a subfield of "Material", meaning that the color of an object is (generally) determined by its material.
I look forward to when you reach critical mass and it becomes possible to do all kinds of experiments. :P
16:34
This goes into the concept of "defaults." Wood has a default color of brown, for example. It is important that color be a subfield of material, with brown being a color and wood being a material.
So, an item, lacking an explicit tag with a key of "color", looks to see what value is in the "material" slot, and gets the default color of that material.
would color really be "brown"?
Furthermore, there is inheritance of these default values.
Will you have composite objects? For instance, [tree] should have at least [wood] and [leaf], and one or more of [flower], [fruit], [seed] depending on the type of tree.
@NathanMerrill It would be something more specific.
like "dark brown" or "#474924"
just looked up that color: its gross
16:37
@NathanMerrill I could turn color into a numeric field if I wanted.
regardless, it appears that "magic" happens on values as well
@El'endiaStarman Yes, I will have composite objects eventually.
@NathanMerrill Is it, by any chance, a crappy color? :P
StringOptions describe the possible choices for a given StringField. "Wood" is a StringOption of "Material."
These StringOptions are themselves arranged into an inheritance tree.
"Oak" is a suboption of "Wood".
If "Wood" has a default value for flammability (which it does, being [flammable:true]), then Oak inherits that default value unless told to do otherwise.
So, everything tagged [Oak] that omits a [Flammable] tag is automatically flammable.
Something like [Oak][Flammable:false] isn't flammable, though.
item: [Material:Mahogany][Shape:Log]
with inheritance: [Shape:Log][Density:2.7][Volume:1.4][Material:Mahogany][Flammable:true][Color:Reddish-Brown]
16:57
So, my current goal is to find a way to express all of the fields, possible values, and their relationships.
So that stuff does not need to be hard-coded.
So, instead of this:
TagData.putStringField(null, "Material");
TagData.putStringOption("Material", "Wood");
TagData.putStringOption("Wood", "Oak");
TagData.putStringOption("Wood", "Mahogany");
TagData.putStringField("Material", "Color");
TagData.putStringOption("Color", "Brown");
TagData.putStringOption("Brown", "Reddish-Brown");
TagData.putBoolField("Material", "Flammable");
TagData.putRealField("Material", "Density");
TagData.putStringDefault("Wood", new Tag("Brown"));
TagData.putStringDefault("Wood", new Tag("Flammable", true));
I can put this:
Material {
  Wood [
    Brown,
    Density:2.7,
    Flammable:true,
    Oak []
    Mahogany [
      Reddish-Brown
    ]
  ]
  Color {
    Brown [
      Reddish-Brown []
    ]
  }
  Density <>
  Flammable ()
}
Shape {
  Log [
    Volume:1.4,
  ]
  Volume <>
}
@El'endiaStarman I'm sure you're aware of my aversion towards parsers.
Hahaha, indeed. Looking to have someone else do it? :P
Actually, this seems like something that would be fairly easy to write a grammar for, then use a parser generator to do the hard work.
Hmm. Come to think of it, I think Pytek's parser is feature-complete enough to handle that.
The "TagData" data structure is rather complex, and I'm having a hard time figuring out how to describe it.
17:14
@NathanMerrill XD
@PhiNotPi surely there's a better way :p]
why not use JSON or something?
@CᴏɴᴏʀO'Bʀɪᴇɴ I don't think JSON can describe everything in a nice way.
Your parsed result looks like JSON.
His formatting uses all bracket pairings though.
Speaking of which, what's the meaning of <> and ()?
I assumed empty/null
I'm using the bracket types to tell what type of node it is.
17:19
Why can't you have a Node class with a type argument?
(Warning: javascripter speaking)
Density <> means that density is a real number, while Flammable () means that its a boolean.
Ah.
So, like Density <3> and Flammable (true)?
Right now, I'm representing nodes using internal classes that inherit from each other.
@CᴏɴᴏʀO'Bʀɪᴇɴ Well, the Density <> simply denotes that the field exists and takes a real number, and its location in the "tree" indicates that it is a subfield of Material.
It also indicates that [Density:1337] is a valid tag, and [Flammable:true] is a valid tag.
I'm writing code comments right now.
18:06
@CᴏɴᴏʀO'Bʀɪᴇɴ updated
that took a while
@El'endiaStarman now with sports commentary
ook OOK Ook?
At least I understand your code now
19:00
@El'endiaStarman Do you actually think you can help with a parser?
just brute force random java programs until you get the right one
that's how I got jolf :p
19:14
Some other things I should work on:
- multi-part items
- ingredient matching (aka, does a given item fulfill a given requirement as part of a recipe)
- recipes, which have a list of ingredients, catalysts, etc.
- crafting transformations, which describe how the products of a recipe derive their properties from the reactants
- items which can store other items (containers, etc)
- a basic 2D grid that gives items their physical positions
 
3 hours later…
21:57
I've added a print method to TagData to print out the entire data structure.
cat Shape {
  opt Log {
    ~Volume: 1.4;
  }
  real Volume;
}
cat Material {
  opt Wood {
    ~Density: 2.7;
    ~Flammable: true;
    ~Brown;
    opt Mahogany {
      ~Reddish-Brown;
    }
    opt Oak;
  }
  cat Color {
    opt Brown {
      opt Reddish-Brown;
    }
  }
  real Density;
  bool Flammable;
}
It took a long time to get the formatting that nice.
you should really just use JSON IMO. Its a data structure that people already know, and it is easy to add additional options (like the stuff you listed above)

  last day (24 days later) »