Click here to Skip to main content
12,953,700 members (52,548 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Basically, I am working on a bot where I am trying to make a sort of RPG system which is entirely text-based.

I got all my database planned out well, but I'm stuck at one single problem where I don't know how to make a proper dialogue system on a pure server-side game?

Currently I have made it so that one table contains all messages that needs to be forwarded to the user. It contains its own variable system so I won't need similar messages to replace simple things as "She" and "He" for example.

To dumb it down even more, I want to make the user bound to a chain of events as if a user talks to someone, he needs to answer that person with "Yes" or "No" while being unable to perform other commands in this text-based game such as "Use item" or whatever it might be.

I'm really just grasping for theories here, all to get a solid idea of what type of dialogue system I should use. I have thought of having a field in the user table that contains a value of what the user is currently doing, or perhaps is pointed to a message id in the messages table (messages table also containing fields for the commands he can perform and what they will lead to), but it feels very sketchy. I mean I'd be surprised if you can even understand what I'm trying to say.

Many thanks in advance, Will.
Posted 15-May-11 10:45am
SAKryukov 15-May-11 18:09pm
You're quite right in your doubts about these noted to be understandable. I hope this is just a result of very early thought on your architecture... At the same time, there is nothing fantastic or miraculous about database-backed architecture fitting dialog between the gamers and system (or each other?..) :-)
S Mewara 16-May-11 4:45am
OP replied:
You're right, this is very early and I haven't gone further than to map the database. Ah, so it really was that hard to comprehend. Well I think I'll just make a new table for "conversations" or something and link it to messages in the "messages" table.
Qvazzler 15-May-11 18:19pm
You're right, this is very early and I haven't gone further than to map the database.

Ah, so it really was that hard to comprehend. Well I think I'll just make a new table for "conversations" or something and link it to messages in the "messages" table.
S Mewara 16-May-11 4:45am
If you reply to his comment, he will be notified.
SAKryukov 16-May-11 4:53am
I know, thank you.
S Mewara 16-May-11 5:04am
I told to OP about it. I know you know. :)
SAKryukov 16-May-11 4:56am
Such design problem are not solved in the air like that, at least not for most of us... Play with UML, entity-relationship diagrams, picture your use cases, play with different variants, wait until your vision start crystallizing... as we say, sleep with this problem...
Isn't that reasonable?
Qvazzler 16-May-11 6:42am
Well for some reason I'm having trouble finding entity-relationship diagrams for sql that are actually practical/usable on an amateur level. I think however I never used the term "entity" in my searches.

Yes, I have been picturing things over and over and over, connecting a dot to the other, thinking how the code would process it, and so on. The only thing that puzzles me is the bit about having in-game conversations.

Thank you for all your help, I believe I can go on with my planning now based on the new knowledge you have provided me with.
SAKryukov 16-May-11 6:48am
Wait, wait... you should not search for it. You should understand the first principles and invent it. Well... develop, devise. Intuitively, I feel the problem of the data model is pretty simple. Threading design can be a bit tricky, but not too much.
Qvazzler 16-May-11 17:45pm
This is an excellent example of what I found after your help.

I am very aware of what you are saying, meaning I should not just copy something without understanding the principles behind it. I decided to step back a bit to see if my structure really is effective to start with, and I came to the conclusion of that the picture I found above matches my structure completely, with the one exception that I have not been using a diagram rather I have been using a simple excel sheet containing the tables and variable names.

Stepping forward again to the problem I have mentioned in this thread, I'm pretty sure I have found my solution. Since explaining it doesn't seem to do any justice (I'm not exactly used to speaking in terms of programming and such with others), I'll just conclude this with that I will be creating 2 new tables, one containing the conversations that exist, and another one that contains instances of conversations belonging to users.
ArtificerGM 24-May-11 14:03pm
Sounds to me what you need is a specialized Finite-state machine.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,429
CHill60 3,490
Maciej Los 3,103
ppolymorphe 2,020
Jochen Arndt 1,975

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 15 May 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100