Click here to Skip to main content
11,409,801 members (59,944 online)
Rate this: bad
good
Please Sign up or sign in to vote.
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 11:45am
Comments
SAKryukov at 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?..) :-)
--SA
S Mewara at 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 at 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 at 16-May-11 4:45am
   
If you reply to his comment, he will be notified.
SAKryukov at 16-May-11 4:53am
   
I know, thank you.
--SA
S Mewara at 16-May-11 5:04am
   
I told to OP about it. I know you know. :)
SAKryukov at 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?
--SA
Qvazzler at 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 at 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.
--SA
Qvazzler at 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 at 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
0 Sergey Alexandrovich Kryukov 229
1 OriginalGriff 140
2 Maciej Los 138
3 Sascha Lefévre 120
4 BillWoodruff 60
0 Sergey Alexandrovich Kryukov 8,771
1 OriginalGriff 6,905
2 Maciej Los 3,390
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web01 | 2.8.150414.5 | Last Updated 15 May 2011
Copyright © CodeProject, 1999-2015
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