Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the Language System #459

Merged
merged 19 commits into from
Jul 5, 2024

Conversation

Mnemotechnician
Copy link
Contributor

@Mnemotechnician Mnemotechnician commented Jun 14, 2024

Description

The language PR was merged early and OH GOD I ALREADY REGRET IT

This PR is intended to provide the missing refactors and address the issues that were missed due to the early merge.


TODO

  • Introduced a polymorphic obfuscation property to the LanguagePrototype - now it supports more than just 2 hardcoded methods, and each method can be configured per-language. Currently there are 3 obfuscation methods: replacement (same as replacement accent), obuscation by syllables and obfuscation by phrases.
  • Refactored the existing obfuscation methods to not be a big hardcoded mess.
  • Updated the existing languages accordingly: animalistic languages are now less of an unreadable mess and include less syllables. Certain languages like binary and snake seriously benefit from that.
  • Refactored the existing commands in response to the never-addressed review (it got lost among hundreds of others)
  • Refactored the commands to be more user-friendly (you can now use the number of the language in saylang and languageselect which can allow using keybinds to switch between languages)
  • Moved a lot of obfuscation-related stuff from server to shared. The actual obfuscation process, however, is still done on the server. That may or may not be subject to change, too.
  • Refactored the entire process of resolution of entities' languages. Instead of raising an event every time it's required to learn what languages an entity knows, the lists of ALL languages available to the entity (including via translators) is stored in LanguageSpeakerComponent and only updated when necessary (e.g. when a translator gets toggled). The list of languages the entity knows on its own is now stored in LanguageKnowledgeComponent.
  • Made handheld translators automatically change your current language when activated.
  • Rewrote the translator implanter system, now using the real implants and implanters
  • Rebalance science stuff (translators are incredibly expensive for what they're worth)
  • Uhhh stuff

Media

N/A for now


Changelog

🆑

  • tweak: Translator implants are now proper implants that can be removed.
  • tweak: Animalistic languages should now look less messy.
  • fix: Hopefully fixed language menu desync and other issues.

@github-actions github-actions bot added Changes: C# Changes any cs files Changes: Localization Changes any ftl files Changes: UI Changes any XAML files Changes: YML Changes any yml files labels Jun 14, 2024
@DangerRevolution DangerRevolution added Priority: 2-High Needs to be resolved as soon as possible Size: 2-Large For large issues/PRs Type: Rework Large changes to a system, like a mix between the Balancing, Codebase, and Respace labels labels Jun 14, 2024
- Made it so that LanguageSpeakerComponent stores the actual data about entities' languages, while LanguageKnowledgeComponent stores intrinsic knowledge
- Rewrote a lot of shitcode
@Pspritechologist
Copy link
Member

Love to see this being done, I was actually just coming now to check on what needs to be fixed with Languages :)

I agree that it was merged prematurely, for some of the pending fixes please take a look at the unresolved review comments on the last pr.
There's some great looking stuff already in here 👍

@Pspritechologist
Copy link
Member

Introduced a polymorphic obfuscation property to the LanguagePrototype

I was about to do this myself! :P Looks great.

Moved a lot of obfuscation-related stuff from server to shared. The actual obfuscation process, however, is still done on the server. That may or may not be subject to change, too.

Prediction = Good but we really don't want obfuscation happening on Shared. The client should only ever become aware of the message post modifications, otherwise the un-modified data is simply available to them. We need to be aware of vectors for cheating, and exposing unnecessary data to the client is one of the biggest.

…fuscationMethod's dependency on LanguagePrototype
@Mnemotechnician
Copy link
Contributor Author

Prediction = Good but we really don't want obfuscation happening on Shared. The client should only ever become aware of the message post modifications, otherwise the un-modified data is simply available to them. We need to be aware of vectors for cheating, and exposing unnecessary data to the client is one of the biggest.

Indeed, that's what I've been keeping in mind while writing the coode, but the current networking approach is just ever so stupid and bug-prone...

@SimpleStation14 SimpleStation14 changed the title Refactor the language system Refactor the Language System Jun 18, 2024
@Mnemotechnician Mnemotechnician marked this pull request as ready for review June 18, 2024 16:01
@Mnemotechnician
Copy link
Contributor Author

This is mostly done now I think. I'll leave the balance part out for now, I don't feel like I can come up with something reasonable myself.

@VMSolidus
Copy link
Member

image

Test fail is legitimate.

@Mnemotechnician
Copy link
Contributor Author

Oopsie.

Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added Status: Merge Conflict FIX YOUR PR AAAGH and removed Status: Merge Conflict FIX YOUR PR AAAGH labels Jun 21, 2024
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the Status: Merge Conflict FIX YOUR PR AAAGH label Jun 23, 2024
Copy link
Member

@FoxxoTrystan FoxxoTrystan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and looks fucking amazing, will base future Language updates from it.

EE Maints, please review.

@FoxxoTrystan FoxxoTrystan mentioned this pull request Jul 3, 2024
Copy link
Member

@VMSolidus VMSolidus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@VMSolidus VMSolidus merged commit 9d5f3b6 into Simple-Station:master Jul 5, 2024
11 checks passed
SimpleStation14 added a commit that referenced this pull request Jul 5, 2024
DangerRevolution pushed a commit that referenced this pull request Jul 9, 2024
<!--
This is a semi-strict format, you can add/remove sections as needed but
the order/format should be kept the same
Remove these comments before submitting
-->

# Description

<!--
Explain this PR in as much detail as applicable

Some example prompts to consider:
How might this affect the game? The codebase?
What might be some alternatives to this?
How/Who does this benefit/hurt [the game/codebase]?
-->

Require #459 

Add 3 optional settings for LanguagePrototypes to play with richtext
tags to they could be reconized as Makings

color - Set a specefic color to the text.
fontId - Set a font to the text by using the Id.
fontSize - Set the size of the text

All 3 are optional if not set message will be handeled like normal.

This should be mostly used to know what language your currently speaking
and assist with markings.
Take note those changes happent only in the TextBox chat, bubblechat is
left unchanged.

---

# TODO

<!--
A list of everything you have to do before this PR is "complete"
You probably won't have to complete everything before merging but it's
good to leave future references
-->

- [x] Add Markings
- [x] Add Fonts

---

<!--
This is default collapsed, readers click to expand it and see all your
media
The PR media section can get very large at times, so this is a good way
to keep it clean
The title is written using HTML tags
The title must be within the <summary> tags or you won't see it
-->

<details><summary><h1>Media</h1></summary>
<p>


![image](https://github.com/Simple-Station/Einstein-Engines/assets/45297731/10c3956b-c964-41af-ba0e-37ad1be8119e)

![image](https://github.com/Simple-Station/Einstein-Engines/assets/45297731/4377bdd8-a52e-4b62-bd70-fa9ba36c8d8b)

</p>
</details>

---

# Changelog

<!--
You can add an author after the `:cl:` to change the name that appears
in the changelog (ex: `:cl: Death`)
Leaving it blank will default to your GitHub display name
This includes all available types for the changelog
-->

:cl: FoxxoTrystan
- add: Languages are now marked in the chat!

---------

Signed-off-by: Mnemotechnican <[email protected]>
Signed-off-by: FoxxoTrystan <[email protected]>
Co-authored-by: fox <[email protected]>
Co-authored-by: Mnemotechnican <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes: C# Changes any cs files Changes: Localization Changes any ftl files Changes: UI Changes any XAML files Changes: YML Changes any yml files Priority: 2-High Needs to be resolved as soon as possible Size: 2-Large For large issues/PRs Status: Needs Review Someone please review this Type: Rework Large changes to a system, like a mix between the Balancing, Codebase, and Respace labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants