Re: Decision Graphs (or whatever they're called)

Phill Djonov <[email protected]> Tue, 15 Jun 2010 17:42:00 -0600
Newsgroups gmane.games.devel.sweng
Message-ID <[email protected]>
On Tue, Jun 15, 2010 at 12:27 PM, Jon Watte <[email protected]> wrote:
> Do you have a feeling for the overall production cost of the system? Perhaps
> you spent less time on your implementation and maintenance than the cost of
> buying it for your current project? Do you have a GUI editor that the
> designers can use? Or perhaps the opportunity cost of the implementation
> actually was higher than the cost of the middleware?

Oh, my current implementation is an outright joke (thus my shock it
worked well enough to ship). The logic I've been dealing with is, in
essence, a giant mass of "on event E: if X0, Y0, Z0 do A0, if X0, Y0,
Z1...Z5 do A1...". You could write it as a table, but given the amount
of duplication it's *much* more compact as a DAG. The main thing was
that the damn thing kept changing, and there were piles of "in level 4
I want the same logic, except subsection S should be different
thusly", which scared me since I've seen game code that does the same
thing in other titles turn into a hideous unmaintainable mess as the
design is iterated.

In code, the whole thing consists of a few thousand lines of Lua table
definitions and a function that traverses the graph they form based on
a list of keys (so handling events consists of building that list of
keys, pulling a leaf from the graph, and acting on the leaf data).
I've just been maintaining it by hand. Given how little of it there is
in this project, that was probably a fairly cost-effective way to do
it. Still, it's worth looking at more of this stuff for the future, so
thanks, I probably wouldn't have thought of AI middleware or the like
to deal with what I've been imagining as glorified-but-dumb
multi-level switch-case statements.

Hrm. I guess, given that the ultimate goal would be a tool/language
that the designers can use directly - almost in place of, or as a
figure in, a design document - the trick is finding a sane line
between "here's structured switch-case" and "here's Lua".

Phill
_______________________________________________
Sweng-Gamedev mailing list
[email protected]
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com