okay so gamedev. i got "actions" parsing and evaluating, which have a syntax like this:
and i whipped up some really basic random selection, initialized the world state, and set it running.
the results are about as you'd expect:
okay, we get it.
there are a few problems with this most basic setup. one, the action selection code is kind of dumb and will happily select the actor as the person they're acting with; two, there's no way to limit what an action can apply to; three, there's no way for an action to change the actors involved in any way.
i have some ideas for how to solve those problems -- in order: add unique identifiers to the actors, and/or zipperize the actors list, so that it's possible to get a list of "one actor plus all actors who are not that actor"; add a special-case
also i think (since hey this two-week span of dev time is half over already!!) instead of letting the player make a custom character, i'll just let them select one of the autogenerated characters to control, since that's much simpler to do. then, when their character comes up in the action list, they'll have a choice of events to run, rather than having the event automatically picked.
i mean, secretly, the reason i picked this 'nemesis system' concept to go first is that it's a super flexible system that i could use in a lot of different projects, just with different data files (which is also the reason why i've been so fixed on having it use data files vs. have anything hard-coded). you might recall the same basic concept started off life a year or so ago as a dwarf fortress-style procedural mythology generator; with a somewhat different data file (and, you know, all the action stuff coded up) that could be what this does.
("mythology simulator" is in fact another thing on the gamedev concepts list, and it will in fact just be fixing up the code part of this while writing new data files. but i mean, i'm not gonna do that right after this b/c that would be a little too close to cheating)
%ACTION %1 %2 {
text = %1.name and %2.name interact.
}
and i whipped up some really basic random selection, initialized the world state, and set it running.
the results are about as you'd expect:
ACTION {
text: ginoz-diz and lįbagalą interact.
}
ACTION {
text: ginoz-diz and chûckrir cha-grišrôt interact.
}
ACTION {
text: llęfigįfy and caalbek interact.
}
ACTION {
text: ghuzrug and rickgrûck cha-rûzzrûr interact.
}
ACTION {
text: brukk-zonish and lįbagalą interact.
}
ACTION {
text: khamkoh and ghovbig interact.
}
ACTION {
text: breriz-lokk and caalbek interact.
}
ACTION {
text: llęfigįfy and ląllųbwhi interact.
}
ACTION {
text: rilush-nukk and higanęla interact.
}
okay, we get it.
there are a few problems with this most basic setup. one, the action selection code is kind of dumb and will happily select the actor as the person they're acting with; two, there's no way to limit what an action can apply to; three, there's no way for an action to change the actors involved in any way.
i have some ideas for how to solve those problems -- in order: add unique identifiers to the actors, and/or zipperize the actors list, so that it's possible to get a list of "one actor plus all actors who are not that actor"; add a special-case
_predicate
field to actions that takes a boolean operation and is used to filter actions only to applicable actors and targets; and add a special-case _result
field to actions that takes some assignment/mutation operations -- it's just that they generally involve writing new big complex parser chunks, which is the most time-consuming part of this. so, it's doable but not really the EASIEST.also i think (since hey this two-week span of dev time is half over already!!) instead of letting the player make a custom character, i'll just let them select one of the autogenerated characters to control, since that's much simpler to do. then, when their character comes up in the action list, they'll have a choice of events to run, rather than having the event automatically picked.
i mean, secretly, the reason i picked this 'nemesis system' concept to go first is that it's a super flexible system that i could use in a lot of different projects, just with different data files (which is also the reason why i've been so fixed on having it use data files vs. have anything hard-coded). you might recall the same basic concept started off life a year or so ago as a dwarf fortress-style procedural mythology generator; with a somewhat different data file (and, you know, all the action stuff coded up) that could be what this does.
("mythology simulator" is in fact another thing on the gamedev concepts list, and it will in fact just be fixing up the code part of this while writing new data files. but i mean, i'm not gonna do that right after this b/c that would be a little too close to cheating)