Follow-up Comment #1, bug #24126 (project freeciv):

That's a lot of choices to make. I wonder about instead relaxing the rules.

Non-unique leader names would mean that:
* pick_random_player_name() may return NULL. I think this can lead to AI,
civil war, etc players called "Player No. 3".
** I think create_barbarian_player() can crash in this situation.
* It would be easy for players to pick the same leader name.
** This doesn't seem to be handled particularly well at the moment (player's
nation/leader/etc choice is silently ignored).

I vaguely wonder about a more relaxed rule, such as a rule that at least one
of a nation's leader names must be unique. However, I'm not convinced it's
worth it.
* It would be rather hard to take advantage of this rule in
pick_random_player_name(). It would not only have to find the currently unique
leader name, it would have to try not to paint future calls into a corner;
either duplicate names would never be picked, or (with more computation) only
picked once unique ones had been exhausted.
* This would mean that human players would always have an available choice
though, without having to invent names.

In any case, it's not practical to completely eliminate the chance of
pick_random_player_name() returning NULL. In pathological cases, human players
could exhaust all available leader names for a nation by picking custom names,
leaving the server with none to choose from. (The server doesn't take leader
name availability into account when picking a nation, and probably shouldn't.)
So the server needs to be robust against this case regardless of what we
decide here.
* pick_random_player_name() could try a bit harder to find candidates though.
Currently there may be a candidate which it doesn't pick.

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?24126>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to