yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.51k stars 1.57k forks source link

Game mechanic capitalization? #5963

Closed will-ca closed 1 year ago

will-ca commented 2 years ago

Capitalization of named game mechanics appears to be somewhat inconsistent:

Term Capitalized Total
  • [ ] " Barbarian"
15 26
  • [ ] "Barbarian Camp"
2 5
  • [ ] "Barbarian Encampment"
0 4
  • [ ] "City State"
7 8
  • [ ] "City-State"
28 36
  • [ ] " Culture"
7 29
  • [ ] " Faith"
13 19
  • [ ] " Gold"
29 73
  • [ ] "Golden Age"
9 19
  • [ ] " Great"
29 133
  • [ ] "Great Artist"
1 1
  • [ ] "Great Engineer"
1 1
  • [ ] "Great General"
4 4
  • [ ] "Great Improvement"
3 3
  • [ ] "Great Merchant"
2 2
  • [ ] "Great People"
4 5
  • [ ] "Great Person"
11 15
  • [ ] "Great Prophet"
5 16
  • [ ] "Great Scientist"
1 1
  • [ ] " Happiness"
4 25
  • [ ] " Influence"
18 31
  • [ ] " Pantheon"
6 13
  • [ ] "Peace Treaty"
2 2
  • [ ] " Polic"
11 41
  • [ ] "Social Polic"
6 10
  • [ ] " Production"
12 30
  • [ ] " Railroad"
6 7
  • [ ] " Religion"
15 96
  • [ ] "Enhanced Religion"
0 2
  • [ ] "Research Agreement"
2 5
  • [ ] "Luxury Resource"
3 17
  • [ ] "Strategic Resource"
2 11
  • [ ] " Road"
4 15
  • [ ] " Science"
7 19
  • [ ] "Set Up"
2 9
  • [ ] " Strength"
17 37
  • [ ] " Unhappiness"
2 19
  • [ ] "Cultural Victory"
2 4
  • [ ] "Diplomatic Victory"
2 5
  • [ ] "Domination Victory"
1 2
  • [ ] "Science Victory"
1 2
  • [ ] "Scientific Victory"
0 3
  • [ ] "We Love The King Day"
6 6
  • [ ] "National Wonder"
3 3
  • [ ] "Natural Wonder"
9 9
  • [ ] "World Wonder"
0 1

Numbers are the totals from searching in English.properties. The capitalized form is as shown in the table; The total is found by converting both the search term and text to lower-case. Single-word search strings have a space at the start to avoid counting cases where capitalization is due to the start of the string; Spaces immediately following periods in the search text are also collapsed to aid that goal.

The numbers are only a rough representation as sometimes a term can be lower-case most of the time but Title Case in specific contexts. I did manually check most of them, and tried to include only names that either have their own legitimately inconsistent capitalizations or are comparable to but inconsistent with other names, though.


Python counting script:

```python3 with open("English.properties") as texts, open("Names") as names: searchtext = texts.read().replace('. ', '.') namelines = names.readlines() sortsignificance = {} for name in namelines: for word in name.split(): sortsignificance[word] = sortsignificance.get(word, 0) + 1 namelines = sorted(namelines, key=lambda name: sorted(name.split(), key=lambda word: -sortsignificance[word])) print('\n'.join(line for lines in ( ("|**Term**|**Capitalized**|**Total**|", "|---|---|---|"), (f"|`\"{name}\"`|{searchtext.count(name)}|{searchtext.lower().count(name.lower())}|" for l in namelines for name in [l.rstrip('\n')]) ) for line in lines )) ```

Names:

``` Golden Age Luxury Resource Social Polic Research Agreement Enhanced Religion Natural Wonder National Wonder World Wonder Strategic Resource City State City-State Great Person Great People Great Merchant Great Engineer Great Scientist Great Prophet Great Artist Great General Great Improvement Barbarian Camp Barbarian Encampment Peace Treaty Cultural Victory Science Victory Scientific Victory Domination Victory Diplomatic Victory Set Up We Love The King Day Happiness Unhappiness Road Railroad Religion Pantheon Science Production Gold Faith Culture Barbarian Great Polic Strength Influence ```

Bash command to find consecutive pairs of capitalized words:

$ grep -o -e ' [A-Z][a-z]* [A-Z][a-z]*' English.properties | sort -u
yairm210 commented 2 years ago

All non-game-state and non-mod instances can be replaced with ctrl r - since they appear in the translation files the same way, this doesn't affect gameplay. Any instances where the string is saved in the mod or in the game state, this will require deprecation, and frankly I don't think it's worth it.

yairm210 commented 2 years ago

I do wish you would help deal with some of the problems you raise yourself though This is like the sixth issue you've raised and I'm not sure you've actually dealt with any 🙃

will-ca commented 2 years ago

I do wish you would help deal with some of the problems you raise yourself though This is like the sixth issue you've raised and I'm not sure you've actually dealt with any :upside_down_face:

Ah sorry… Yes, that is an area where I definitely feel I may have been underperforming. TL;DR: I know, it's not you it's me, please feel free to ignore, put on the backburner, close, or just assign to me.

I have a bit of a tendency to get sucked into projects beyond the point that is healthy for myself personally.. Have been trying to limit that, but so far I've accidentally restricted code contributions more than I've restricted issues. In my defence, I have been patching and stabilizing a tile blending script over on the 5Hex repository this week, and I have… literally dozens more notes and checkboxes in my "Unciv" Google Keep label for mostly PRs I've yet to finish and a couple rare crashes I've yet to diagnose, so I've also been overwhelming my own private to-do list…

yairm210 commented 1 year ago

I'm closing this When we find such problems we'll deal with them locally, this issue has raised the awareness it set out to