Obelix Posted March 15 Report Share Posted March 15 (edited) On 15/03/2024 at 5:49 PM, Gurken Khan said: It would be nice if duplicates were avoided; maybe some old code interferes that adds "II" to a duplicate? [EDIT: above quote is from this post from the thread Alpha 27 Pre-release/Release Candidate Build Testing of which this thread here has been split off] You brought me to the idea to search for 'AINames' (I use GitHub Search for that) and I found lines 85-100 of ps/trunk/binaries/data/mods/public/gamesettings/attributes/PlayerName.js. Quote: // Pick one of the available botnames for the chosen civ // Determine botnames let chosenName = pickRandom(this.settings.civData[civ].AINames); if (!this.settings.isNetworked) chosenName = translate(chosenName); // Count how many players use the chosenName let usedName = this.values.filter(oName => oName && oName.indexOf(chosenName) !== -1).length; this.values[i] = usedName ? sprintf(this.RomanLabel, { "playerName": chosenName, "romanNumber": this.RomanNumbers[usedName + 1] }) : chosenName; I don't understand JavaScript much. Thank you very much to everyone helping comprehend what [usedName + 1] means. Edited March 18 by Obelix giving context to offsplitted origin 1 Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted March 15 Report Share Posted March 15 (edited) 34 minutes ago, Obelix said: what [usedName + 1] means 47 minutes ago, Gurken Khan said: that adds "II" to a duplicate Maybe that's the culprit, should pick another name from the list? Edit: there can be eight players and there are nine names in the list; IMHO this slapping on of a higher number to chosenName needs to go. Edited March 15 by Gurken Khan 2 Quote Link to comment Share on other sites More sharing options...
Vantha Posted March 16 Report Share Posted March 16 (edited) @Gurken Khan @Obelix I was not able to replicate the bug:  However, forcing the game to choose a new name for each AI player (and avoid all the hassle with the Roman numerals) could be done by simply adding this: Quote let chosenName = pickRandom(this.settings.civData[civ].AINames.filter(el => !this.values.indexOf(el) !== -1));  Edited March 16 by Vantha 3 Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted March 16 Report Share Posted March 16 43 minutes ago, Vantha said: I was not able to replicate the bug: At least that's counting up correctly; still lame. I can't judge your code, but I hope that in the next version the game will pick one of the other names in the list and doesn't feature imaginary Themistocles II-VII. Where does "Themistocles" come from anyway, it's not in https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/data/civs/athen.json ? Spoiler "AINames": [ 59 "Cimon", 60 "Aristides", 61 "Xenophon", 62 "Hippias", 63 "Cleisthenes", 64 "Thucydides", 65 "Alcibiades", 66 "Miltiades", 67 "Cleon", 68 "Cleophon", 69 "Thrasybulus", 70 "Demosthenes" 71 ], Â Quote Link to comment Share on other sites More sharing options...
hyperion Posted March 16 Report Share Posted March 16 1 hour ago, Vantha said: I was not able to replicate the bug: If the name itself was "Themistocles II" ... Anyway not a bug a as you can't reasonably require sufficient names for any case. Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted March 16 Report Share Posted March 16 4 hours ago, hyperion said: Anyway not a bug a as you can't reasonably require sufficient names for any case. Apart from the Gauls, Iberians and Mauryan every civ has eight or more names in the list; so if we came up with six more names we would have sufficient names for every case. Quote Link to comment Share on other sites More sharing options...
Vantha Posted March 16 Report Share Posted March 16 (edited) Regarding the AI Names, in my local files each civ actually has at least 8 AINames (only the Iberians for some reason have a double entry of Viriato, so there'd be a single one missing for the Iberians). I suggest to remove the system of counting names that are chosen multiple times with Roman numbers. Especially if it's this simple to change. Currently, in a 4v4 of AIs with everyone playing Persians, on average 2 to 3 players will get a 'problematic' name because many of the their names include a Roman numeral themselves and an additional one is added if a name is picked multiple times. Edited March 16 by Vantha 1 Quote Link to comment Share on other sites More sharing options...
Gurken Khan Posted March 16 Report Share Posted March 16 23 minutes ago, Vantha said: in my local files each civ actually has at least 8 AINames Interesting. I went through the lists at https://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/data/civs/....json just before posting. Quote Link to comment Share on other sites More sharing options...
hyperion Posted March 17 Report Share Posted March 17 23 hours ago, Vantha said: I suggest to remove the system of counting names that are chosen multiple times with Roman numbers. Especially if it's this simple to change. The code needs to generate an endless list of names, could be bot1, bot2 and so on. The improved names here are only for role-playing purpose. If you don't provide an endless list you might break mods or add another thing that breaks should you increase max players. Tweaking the generator is an option but discussing this I consider off-topic (like most in this thread) so I stop here. 1 Quote Link to comment Share on other sites More sharing options...
Vantha Posted March 17 Report Share Posted March 17 1 hour ago, hyperion said: The code needs to generate an endless list of names, could be bot1, bot2 and so on. The improved names here are only for role-playing purpose. If you don't provide an endless list you might break mods or add another thing that breaks should you increase max players. Tweaking the generator is an option but discussing this I consider off-topic (like most in this thread) so I stop here. Should I open a designated thread? 1 Quote Link to comment Share on other sites More sharing options...
hyperion Posted March 17 Report Share Posted March 17 48 minutes ago, Vantha said: Should I open a designated thread? You can also ask a moderator to split this thread or even submit a patch to phab if you think you have better implementation. 1 Quote Link to comment Share on other sites More sharing options...
Vantha Posted March 18 Report Share Posted March 18 @Norse_HaroldCan you split the messages about the AI Names into a seperate thread? 1 Quote Link to comment Share on other sites More sharing options...
Norse_Harold Posted March 18 Report Share Posted March 18 4 hours ago, Vantha said: @Norse_HaroldCan you split the messages about the AI Names into a seperate thread? Done. 1 2 Quote Link to comment Share on other sites More sharing options...
alre Posted March 18 Report Share Posted March 18 On 16/03/2024 at 1:00 PM, Vantha said: @Gurken Khan @Obelix I was not able to replicate the bug:  However, forcing the game to choose a new name for each AI player (and avoid all the hassle with the Roman numerals) could be done by simply adding this: submit the patch or make a mod. if the change creates a requirement for civs to have at least 8 ruler names, that's a new requirement codewise and it should be made clear. 1 1 Quote Link to comment Share on other sites More sharing options...
Vantha Posted March 20 Report Share Posted March 20 (edited) On 18/03/2024 at 8:27 PM, alre said: if the change creates a requirement for civs to have at least 8 ruler names, that's a new requirement codewise and it should be made clear. Where should it be made clear? Maybe it'd be best to fill in missing names in the same patch? I found that the hero names got removed from the AI names list in rP27683 which I guess makes sense. I see two options: We either need to find one new name for the Mauryas and the Britons and four for the Iberians, or we revert this change and only require a last one for the Iberians. If noone has any suggestions, I can research for the missing names myself, I shouldn't be too hard, and propose them here. Edited March 20 by Vantha 1 Quote Link to comment Share on other sites More sharing options...
hyperion Posted March 20 Report Share Posted March 20 Adding more names is an option, removing names ending in a roman number is an option. Not generation an endless list I consider a regression (the engine already supports more than 8 players), tho changing how the list is generated might make a lot of sense. What do you have in mind for how it should work, replace roman numbers with a suffix like (2)? Quote Link to comment Share on other sites More sharing options...
Vantha Posted March 20 Report Share Posted March 20 I'm in favor of adding new names because for some civs we won't find enough names otherwise. Yeah, my idea is to modify the way the list created, to first pick each name only once, and when every name has already been chosen pick a random name instead plus suffix showing the count (like (2) ) to avoid two bots with the same name. And as long as each civ has at least 8 different names to choose from, these suffixes won't appear in ordinary 8 player games anyway. 2 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted March 20 Report Share Posted March 20 Seems very easy to come up with more names greater than 8. 1 Quote Link to comment Share on other sites More sharing options...
Grautvornix Posted March 20 Report Share Posted March 20 Ok, but how many should be hardcoded? (I'll vote for 12 so that probability of repttition in an 8-party match is largely reduced). I also believe that more than 12 parties of the same civ would not be a very frequent setup. Additionally, the selection algorithm itself may need modification so that it not just picks a random list entry every time (and counting up the roman numerals if that name was already taken) but only use the remaining set of each civ for random selection. With an increase set and a better randomization this issue should be an extremely rare observation. Noob opinion 1 Quote Link to comment Share on other sites More sharing options...
Vantha Posted March 21 Report Share Posted March 21 13 hours ago, Grautvornix said: Additionally, the selection algorithm itself may need modification so that it not just picks a random list entry every time (and counting up the roman numerals if that name was already taken) but only use the remaining set of each civ for random selection. Yup, that's the idea. It creates the minimum requirement of 8 different names for each civ. But, of course, adding even more names remains possible. We can add as many suitable names as we can come up with for each civ, to maximize variety. Quote Link to comment Share on other sites More sharing options...
Grautvornix Posted March 21 Report Share Posted March 21 Just another thought: do we need actually famous names only? I think the answer might be obvious :Â "no, as long as the name is typical for the respective civ." 2 Quote Link to comment Share on other sites More sharing options...
Stan` Posted March 21 Report Share Posted March 21 I think the fact we used famous names was to give an incentive for people to learn about them Just like Pyhric victory in Medieval 2 Total War made me wonder about Pyhrus 2 Quote Link to comment Share on other sites More sharing options...
Grautvornix Posted March 21 Report Share Posted March 21 I do agree that historical leaders are preferred. Just in case we cannot come up with enough famous names we should not restrict ourselves and instead add additional "normal" names of that civ/period. Quote Link to comment Share on other sites More sharing options...
hyperion Posted March 21 Report Share Posted March 21 1 hour ago, Grautvornix said: I do agree that historical leaders are preferred. Just in case we cannot come up with enough famous names we should not restrict ourselves and instead add additional "normal" names of that civ/period. We don't strictly need 8 names, I mean I can play against 3 or maybe 4 before I get badly beaten. So in most games a single name per civ would be already enough. Using made up names would undermine the point made by @Stan` which I quite like. So requiring 8 names doesn't sound that great. Quote Link to comment Share on other sites More sharing options...
alre Posted March 21 Report Share Posted March 21 is this a problem? one can look up any name, not just the ones belonging to a ruler. anyone having had an attested name is potentially interesting to a curious player. I wonder if there are any civs for which we couldn't come up with 8 names that we know they were given to just anyone minimally interesting. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.