Skip to content

parseGender improvements #121

@Toma400

Description

@Toma400

I'm really rusty on my old code (and IoA seems to be permanently in such state) but I'm wondering if the code made to parse text and replace its default M format couldn't be coded better? My concern is mostly accuracy and performance:

  • does current system runs everytime gender is even hypothetically the case? If so, this is heavy on performance and it should be decided on string level (so, not in code, but .toml/.json files). This could even hypothetically work better since not all languages need the conversion in the same contexts, so every string could have this decided for itself (more work for writers/reviewers, but yields significant resource savings)
    • the check could be for example ! symbol (or any other) preceding whole string
    • default should be no parseGender, because it saves us cost of removing the symbol
    • the other issue I could see is that there are texts that would benefit from both converting gender and not - I'd assume this kind of texts could have separate mark and then additional syntax later to signify which word should be translated and which not
  • current system is looping over dictionary, which makes it incredibly demanding as the dictionary grows
  • dictionary itself is difficult concept, because it does only simple replacements and requires a lot of work to maintain the list, as well for people writing narrative to use it as a tool
    • would it be possible to have some more performant solution that already has big data storage reflecting languages?
    • what if simple replacement does work incorrectly? wouldn't RegEx or something along those lines work better?
    • how easy it is to check for specific occurence for writers? would simple ctrl + f yield enough of possibilities, so you could safely check if the translation is there?

Just some concerns I had over few days and which should be adressed for this feature to be actually good and not something really hitting game's performance (as if it wasn't terrible already)


I went over the code and I'd say current code check may still have performance advantages over solely parsing first letter from text, or at least the cost difference is minimal (worth checking whether text[0] == "" is performant because it checks precise element, or not, because it parses whole string? just me spitballing).

Metadata

Metadata

Assignees

No one assigned

    Labels

    code improvementCall for some improvement of code

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions