I'm normally pretty ok at naming things in code, but I'm struggling here and would love some new ideas.
I'm building part of a game for the dialog with NPCs. It functions just like Fallout:
- Player initiates dialog with NPC.
- NPC says a few sentences.
- Player gets a list of replies and can pick one.
- Depending what the player picks, either the conversation will end, or the NPC will say some new stuff and start this over.
Here's the names of objects that I have so far that I'm not exactly in love with. I'd love suggestions on any of these.
- Dialog: This is a "container" object. Clicking on an NPC will start the Dialog. This contains many Chats.
- Chat: This is the name I dislike most. A Chat contains the text the NPC will say, and a list of ChatReply objects.
- ChatReply: This contains the text of the reply (what the player is saying back to the NPC), as well as a pointer to either a new Chat, or to end the Dialog.
Any suggestions?
Update: From the replies, I think I like Dialog / Prompt / Reply.
5 Comments
tunetardis@lemmy.ca · 14 pts · 1y
dialogis bad for this? Maybenpc_dialogornpc_dialog_treeif you want to be less ambiguous?prompt,query, ornpc_promptmaybe?reply,response, orplayer_response? Mayberesponsecould be the container that holds areply(the text the player says) and a link to the next prompt?wesker@lemmy.sdf.org · 7 pts · 1y
Dialog, Conversation, Reply
...maybe?
kubica@fedia.io · 7 pts · 1y
It might be over simplistic, but I'd probably try to be as close as I can to "Conversation", formed by one or more "Question" and "Answer".
FourPacketsOfPeanuts@lemmy.world · 6 pts · 1y
Instead of Chat how about 'Utterance' or just 'Speech'?
Also the other characters response shouldn't be a different object should it but a different type? Perhaps you should have CharacterSpeech and NPCSpeech inheriting from Speech? And Dialog holds a collection of these?
originalucifer@moist.catsweat.com · 5 pts · 1y
maybe dialogue [request type -> request -> response]
Lemon@lemmy.zip · 0 pts · 1y