Multilanguage NPC dialogue in multiplayer RPG


I want to support multiple languages NPC dialogues in my multiplayer game. So for example, if a player selects the English language he should see NPC dialogs in English and if he selects Korean he should see them in Korean.

My dialogs are written in the groovy script and being handled at the server-side. And I will keep dialogue translations in JSON files.

Should I return a translated dialog page to the players directly from the server-side or I should just return a dialogue page id and do the translation at the client-side? for the later, I need to keep a copy of my dialogues JSON translations at the client.

Sometimes I would also need to format the text before displaying it. For example, an NPC dialogue text might look like

Hi <playerName> !

the playerName should be replaced by an actual name.

I am not sure if I should do all this stuff at the server-side or at the client-side.

I am interested to know your opinion :slightly_smiling_face:


Not saying your approach is wrong but why not use property files and read from appropriate file?

Each property file has the same keys, only value is translated.

Would seem like server side would be right but its something I learned from using spring so others may seem to know better way.

1 Like

Yeah, absolutely possible to use properties file instead of JSON.

A dialog has an ID and consists of multiple pages and each page has a page number, text, and multiple options player can select.

Using the properties file I can flatten a dialogue translation like this

dialogs.1.pages.1.text = some text
dialogs.1.pages.1.options.1 = I am first option
dialogs.1.pages.1.options.2 = I am second option

this seems to be a simpler approach over JSON :slightly_smiling_face:

To me, the client ‘dialog’ code should be as dumb as possible. Everything should come from the server.

…but I don’t know what your dialogs look like.

Usually, it’s some prompt text at the top and then a set of options. Then I’d have a generic UI that can display a prompt and some options. Get the prompt and the options from the server and then send back the selected prompt… repeat as necessary.

I had a common library I used for this once upon a time… there will surely be something like it in MOSS eventually.

1 Like

Yes, it is like you said.

Thanks, this answers my question.

1 Like