Navigation

    TripleA Logo

    TripleA Forum

    • Register
    • Login
    • Search
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags

    Generating Random Default Colors When Default Color List is Exhausted

    Map Making
    done
    1
    1
    175
    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.
    • LaFayette
      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
      • 1 / 1
      • First post
        Last post
      Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums