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.

  1. Dialog: This is a “container” object. Clicking on an NPC will start the Dialog. This contains many Chats.
  2. Chat: This is the name I dislike most. A Chat contains the text the NPC will say, and a list of ChatReply objects.
  3. 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.

  • tunetardis
    link
    fedilink
    English
    arrow-up
    14
    ·
    4 days ago
    1. Honestly, I don’t think dialog is bad for this? Maybe npc_dialog or npc_dialog_tree if you want to be less ambiguous?
    2. Something like prompt, query, or npc_prompt maybe?
    3. reply, response, or player_response? Maybe response could be the container that holds a reply (the text the player says) and a link to the next prompt?