Code Monkey home page Code Monkey logo

Comments (7)

 avatar commented on September 25, 2024

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.

from the-swallows.

 avatar commented on September 25, 2024

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.

from the-swallows.

 avatar commented on September 25, 2024

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.

from the-swallows.

MichaelPaulukonis avatar MichaelPaulukonis commented on September 25, 2024

c# and javascript.

This is fun!

from the-swallows.

 avatar commented on September 25, 2024

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 :)

from the-swallows.

MichaelPaulukonis avatar MichaelPaulukonis commented on September 25, 2024

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....

from the-swallows.

 avatar commented on September 25, 2024

I'll grant that using node.js on the backend is probably nicer than using Perl, these days :)

Closing this issue...

from the-swallows.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.