TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    Generating Random Default Colors When Default Color List is Exhausted

    Scheduled Pinned Locked Moved Map Making
    done
    1 Posts 1 Posters 352 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • LaFayetteL Offline
      LaFayette Admin
      last edited by LaFayette

      I've a PR up for this already, but wanted to open a thread for discussion.

      https://github.com/triplea-game/triplea/pull/7637

      To describe what the engine does today, default players are defined today in map.properties. If a game has a player that does not have a color defined in map.propertiers, then that player gets a default color. There were about 8 default colors. When all default colors are used up, the game would crash on launch with a java.util.NoSuchElementException.

      The update in PR#7637 essentially avoids this crash and instead when all of the default colors are used up, the engine will start generating random colors. Any given player name will always generate the same random color, so the colors will be consistent for any map even if randomly generated.

      1 Reply Last reply Reply Quote 1

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • 1 / 1
      • First post
        Last post
      Powered by NodeBB Forums