Closed MichaelPaulukonis closed 11 years ago
Thanks for the report. I did get that error once, but haven't seen it again (yet).
I recently fixed a bug where, previously, the same animate Actor could be recorded as being in multiple locations at the same time (because when a new chapter was started, their location wasn't initialized properly.) This could be related.
The nature of the program makes it difficult (or, at least, interesting) to test in an automated way. Maybe one way would just be to generate, say, 50 stories, and check that there's no error. A more sophisticated version might look for things in the output that you would expect to happen at least once in the 50 runs (like one character holding another at gunpoint.)
I'm also thinking, it might be worth it to make the script always generate debug-type output alongside the formatted output. So if it crashes, you have both, and can try to audit it.
I'm also trying to put in more assertions, which should at least catch problems earlier.
Pretty sure now that this happens because the code assumes that there are only two characters. To agree on what to do with the body, each character tracks the opinion that "the other character" has voiced about what to do about it. When there are >2 characters, "the other character" is sometimes the wrong one. I'll look at making the code more general, but... I don't plan to make it check that all n characters agree on what to do... I guess I'll make it Alice- and Bob-specific.
Actually, unfortunately, it may be more complicated than that.
I'm going to replace these "memories" and "decisions" and "knowledge of others' decisions" and "goals", all with "beliefs", because they are all arguably types of beliefs, or at least close enough. That will probably make the code a little easier to follow. In the process, hopefully it will fix this bug.
btw, since you said you installed Python just to run this, out of curiosity, what programming languages are you more familiar with? There is no really good reason it's written in Python; that just happens to be my current language of habit and it's fairly fast for me to throw things together, in it.
c# and javascript.
This is fun!
I haven't used C# terribly much, but what I have seen of it, it's not too bad. A lot like Java.
Javascript, otoh... well, if this were rewritten in Javascript, it could be put on a web page, and that'd be pretty cool. But ever since people got the bright idea to use Javascript outside the web browser, there's been this whole new toolchain with the node.js and the npm and the grunt and, yeah, ok, it works, but there are bits about it that seem to rub me the wrong way.
Anyway. I have refactored the code to make the internals of characters more consistent; it's all "beliefs" now, and they can have beliefs about other characters's beliefs. And I've run the_swallows++.py
200 times in a loop, and there have been no errors, so I think I fixed this bug in the process.
It does raise an interesting question about what it means for groups of characters to agree on something, but that's more of an issue for a particular story-writer to deal with in their particular story-world.
I'll let you close this issue if you're satisfied with that.
This is fun :)
I'll accept it as closed!
My day-job uses the Microsoft stack, hence C# (and ASP.NET). It also involves JavaScript, which I find more fun, and do more of on my own. I did build a C# text-mangler last year, but got bogged down in some of the conceptualization. I would prefer the thing to be online, so hope to translate bits of it to javascript... but... distractions.
I started playing with node.js this year, in hopes of avoiding Perl for my dev tools -- if I can keep everything in Javascript, then I don't switch contexts, and skills learned for the toolchain apply to this or future projects.
It's that sort of attitude that keeps me refactoring and twiddling with other people's code instead of writing more new stuff, I guess....
I'll grant that using node.js on the backend is probably nicer than using Perl, these days :)
Closing this issue...
Sometimes, running unmodified (or modified)
the swallows++.py
an error will be thrown having to do with aHorror
object.These error are intermittent. I ran the output 11 times successfully before encountering this error:
I was not able to get the error to occur when running with
debug=True
although maybe I could have run it more times; I ran it about 30 times and gave up; after commentingdebug
back out... I got the error in about 8 runs.