Game mechanic. Need help with realisation.

Guys, hello!

The concept is that there are two races - the player and another race

According to the idea, the player understands only the language of his race and can understand what the other race says, by reading books that will be in the world and manual input words by the player in the notebook

When talking to another race, if the encrypted words are written in the notebook, the subtitles should pull up the words that entered by the player

Who has seen similar mechanics and implementation of how to do this, well, or just tips, how and through what can be implemented

I’m using 4.27.2, so it’s would be great if you don’t give me tips for newer versions

You’d have to keep track of some list of words or sets of words,

The more individual lines the code will have to run through, the harder it will be to optimize so i’d probably do the books as subject understanding

Ex
Animals
Greetings
Vegetables

Something like that, if your going for just dialogs that’s easy enough with a map of Names to Booleans

It essentially becomes localization tho if you get into chat messages between players in which case you’d have to do word for word and make your own languages

I don’t think i fully understand what your going for here to be honest
Sounds like string parsing
so you’d have to make a function that takes in the input string and splits it up somehow,
Maybe a set list of Alien words on the one side and input boxes on the other side, if the player has entered any text then check if the translation is correct using a data table and structure

Maybe this will give you some ideas, that codes far from perfect but it’ll get the job done in most cases

1 Like

output

Hi @JordanJameski,

I’ll add my answer as a supplement to @Nightwolf’s answer.

Here’s the core of how this solution’s translation works:

Some details about this solution:

  1. This takes a recursive approach, which helps split up your words by both spaces and punctuation.
  2. The bigger your list of words, the more useful Maps and Sets data structures will be to lookup words. With an array you’ll be asking the computer to search through each word one at a time, which isn’t a problem if you have a small word count. Once you get a huge word count, Maps and Sets will be much more performant.
  3. This solution also allows you to wrap each word in a set of tags. When you use it with a RichText block, you can mix-and-match fonts and styles - super handy for a translation mechanic.

In terms of similar mechanics, my favorite game to do this well has been Chants of Sennaar. Some of the things they consider when making their 5 languages:

(Spoilers here)

  • Earlier, easier languages are more pictographic, where there’s a logical consistency you can puzzle together. For example, the player learns the symbol for “human” and “plant”, and later when you see them combined together, you can figure out it’s referring to “gardener.”
  • Later languages are more abstract, with no clear connection between the glyphs and their meanings.
  • Languages handle pluralization differently
  • Languages handle questions differently - sometimes putting the question signifier at the beginning of the sentence, or the beginning and end.
  • Some languages are written left-to-right, some are right-to-left.
  • Some languages use subject verb preposition, some use preposition subject verb.
  • Some languages just have more nuance built in. One language might only be able to communicate “artist”, while another would distinguish between an actor, musician, and visual artist.

Hope this helps!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.