🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Building a conversation engine into Janthus (http://www.janthus.com/game.jnlp).

Published March 12, 2011
Advertisement
I've started to build a simple conversation engine into Janthus, something I've never actually done before. I'm doing it from scratch, just to get the experience with thinking about the problem; but eventually I see this component of the game being replaced by something driven from Lua scripts, especially if I want 3rd parties to create content for the world.

At the very simplest level, conversations in Janthus will be structure in this way:

1. Player X initiates a conversation with NPC Y.
2. Every sentence transmitted from Player X gets piped through a list of ResponseParsers, which uses regular expressions to determine if its the correct response provider for the given sentence, and the world/player state.
3. A response is either simple, in that it provides text response to the user,
4. Or its complex in that it expects the next sentence from the user to be one thing or another.
5. Conversations will carry state, and the parsers that are available for response may be whittled down depending on the flow of the conversation.

I hope to make this as data-driven as possible, so conversations can be stored in a conveniently editable form such as text file or something (in XML, json, whatever).

Another significant problem to solve is how to express giving things or taking things from an NPC will happen in the context of a conversation...
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement