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

    Add Unit Count and Damage Display Outline

    Scheduled Pinned Locked Moved Feature Requests & Ideas
    35 Posts 7 Posters 14.1k Views 7 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.
    • HeppsH Offline
      Hepps Moderators @Hepps
      last edited by

      @hepps I just designed one number. Saved as a jpeg it is 1.35KB. So if I did separate images for 2-300 it would add 403.5 KB to the engine assets. I'm no techie... but that doesn't sound like a lot.

      "A joyous heart sours with the burden of expectation"
      Hepster

      1 Reply Last reply Reply Quote 0
      • alkexrA Offline
        alkexr
        last edited by

        I would suggest considering separate images for digits instead of numbers. While that complicates calculating display coordinates, it has the great advantage of requiring 10 images instead of infinitely many. Though then you couldn't have Roman numerals for 270 BC, which would be a shame, really.

        "For the world is changing: I feel it in the water, I feel it in the earth, and I smell it in the air."

        HeppsH 1 Reply Last reply Reply Quote 1
        • HeppsH Offline
          Hepps Moderators @alkexr
          last edited by Hepps

          @alkexr I'm easy. I do not profess to know the best way to handle this from a technical standpoint. All I know is that after rendering a near infinite number of trees, hills, mountains and houses.... I can probably design as many numbers as we could possibly need. 😃

          "A joyous heart sours with the burden of expectation"
          Hepster

          prastleP 1 Reply Last reply Reply Quote 0
          • prastleP Offline
            prastle Moderators Admin @Hepps
            last edited by

            @hepps we allllll know YOUR EASY! 🙂 nice ideas

            If we open a quarrel between past and present, we shall find that we have lost the future! Sir Winston Churchill

            HeppsH 1 Reply Last reply Reply Quote 0
            • HeppsH Offline
              Hepps Moderators @prastle
              last edited by

              @prastle You only know that because we've been on a date. If you hadn't been swept off your feet by my rugged good looks and charm... you'd have not idea. 😃

              "A joyous heart sours with the burden of expectation"
              Hepster

              prastleP 1 Reply Last reply Reply Quote 0
              • prastleP Offline
                prastle Moderators Admin @Hepps
                last edited by

                @hepps ROFL!
                yes dear

                If we open a quarrel between past and present, we shall find that we have lost the future! Sir Winston Churchill

                1 Reply Last reply Reply Quote 0
                • redrumR Offline
                  redrum Admin
                  last edited by redrum

                  @Hepps So is the main point having a nice outline for the unit numbers? If so I'd probably want to consider doing it without images first before falling back to that option. But what you propose should be theoretically doable and I'd probably agree with @alkexr to draw each digit so less images are needed.

                  Also the benefit of figuring out how to do it programmatically is we keep the font size options. Though I guess in theory you could do something with image sizing.

                  TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                  HeppsH alkexrA 2 Replies Last reply Reply Quote 2
                  • HeppsH Offline
                    Hepps Moderators @redrum
                    last edited by Hepps

                    @redrum I am open to all kinds of options... fast and loose that's how I like to play it. 😉

                    I guess just working on a couple different maps lately I started to really see how the monochrome pixilated numbers are a huge opportunity for maps. And while antialiasing alone would be an improvement, it by no means solve the issue of maps with a variety of unit and territory colours, shading, reliefs, unit colours.....

                    So while pondering it I thought the best would be a outline. the reason I suggested an image is really a by-product of two things...

                    First I thought an outlined number was not possible to render currently. (as a font)

                    Second I thought if they were images then it allows the creative juices to just flow, since you could do all kinds of wonderful things both with numbers as well as backgrounds.

                    "A joyous heart sours with the burden of expectation"
                    Hepster

                    1 Reply Last reply Reply Quote 0
                    • alkexrA Offline
                      alkexr @redrum
                      last edited by

                      @redrum said in Inception: A dream within a dream (Unit stack numbers display):

                      figuring out how to do it programmatically

                      In C# what I would do is to draw the number (string) to a Bitmap first (don't know java equivalent). Then for each pixel P, you take the maximum of (alpha of pixel Q * strength - Euclidian distance(P, Q) * sharpness) over all pixels Q on the bitmap, this will be the alpha of the outline. Then you overlay the original bitmap over the outline. (Strength and sharpness are parameters.) If you only take the maximum over pixels Q within a radius of (255 * strength - sharpness), then you get the same result in O(n^2) relative to the height/width of the bitmap.

                      "For the world is changing: I feel it in the water, I feel it in the earth, and I smell it in the air."

                      redrumR 1 Reply Last reply Reply Quote 0
                      • FrostionF Offline
                        Frostion Admin
                        last edited by

                        Just outlining the current numbers would be a great improvement! The default white numbers can be hard to see and distinguish on bright territory backgrounds. (Yes, I know that I can change colors... But I don't want to 😊)

                        Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

                        C 1 Reply Last reply Reply Quote 1
                        • redrumR Offline
                          redrum Admin
                          last edited by redrum

                          So here a first go at it:
                          0_1530226684526_6e1188b5-4c10-4686-8555-a1aa95f8e079-image.png

                          And with a large number of units:
                          0_1530226809487_3be9b57f-018a-4179-926f-ddecd0623437-image.png

                          Before:
                          0_1530227830920_ba3f141f-da39-496d-a6ea-6673fe6c15b3-image.png

                          TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                          HeppsH 1 Reply Last reply Reply Quote 4
                          • HeppsH Offline
                            Hepps Moderators @redrum
                            last edited by

                            @redrum How is that possible? How was this able to be done so quickly?

                            "A joyous heart sours with the burden of expectation"
                            Hepster

                            1 Reply Last reply Reply Quote 0
                            • redrumR Offline
                              redrum Admin @alkexr
                              last edited by redrum

                              @alkexr That's a bit more graphics kungfu then I'm doing at the moment. Initially, I'm just outlining the text by first drawing it at the 1 pixel over northwest, southwest, northeast, and southeast positions with the outline color and then drawing the text in the center with the text color. As well as enabling anti-aliasing.

                              TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                              HeppsH 1 Reply Last reply Reply Quote 0
                              • HeppsH Offline
                                Hepps Moderators @redrum
                                last edited by

                                @redrum All good. I just thought this would be a much bigger undertaking...

                                "To the uninitiated everything appears to be made of magic"

                                "A joyous heart sours with the burden of expectation"
                                Hepster

                                redrumR 1 Reply Last reply Reply Quote 0
                                • redrumR Offline
                                  redrum Admin @Hepps
                                  last edited by

                                  @hepps Well, my pretty simple approach took about 5 minutes. Ask and thou shall receive 🙂

                                  Open to trying some other ideas if folks want. Probably gonna at least add an option to set the outline color as well.

                                  TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                                  HeppsH 1 Reply Last reply Reply Quote 1
                                  • HeppsH Offline
                                    Hepps Moderators @redrum
                                    last edited by Hepps

                                    @redrum That was my very next question. 😃

                                    I'm going to use inception more often. It appears to be highly effective as a title. 😉

                                    "A joyous heart sours with the burden of expectation"
                                    Hepster

                                    1 Reply Last reply Reply Quote 0
                                    • redrumR Offline
                                      redrum Admin
                                      last edited by

                                      And did unit and bombing damage as well:
                                      0_1530234019701_47e2665f-4a3f-4f62-b59f-d829e58340c3-image.png

                                      TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                                      1 Reply Last reply Reply Quote 3
                                      • redrumR Offline
                                        redrum Admin
                                        last edited by redrum

                                        And the update font preferences:
                                        0_1530235467266_d9569bb3-c8c1-4955-8dec-65f832f10c3d-image.png

                                        Any thoughts on defaults? Unit color/outline as white/black seems good. But black numbers with white outline are a bit jarring. Maybe do a gray for default outline for hit and bombing damage? Also should the default font size be a bit bigger? 12 seems really small on most screens/maps.

                                        0_1530237214893_2c7d5fb5-f111-4ade-b075-9b56499ffe26-image.png

                                        Current defaults:
                                        private static final int MAP_FONT_SIZE_DEFAULT = 12;
                                        private static final Color TERRITORY_NAME_AND_PU_AND_COMMENT_COLOR_DEFAULT = Color.BLACK;
                                        private static final Color UNIT_COUNT_COLOR_DEFAULT = Color.WHITE;
                                        private static final Color UNIT_COUNT_OUTLINE_DEFAULT = Color.BLACK;
                                        private static final Color UNIT_FACTORY_DAMAGE_COLOR_DEFAULT = Color.BLACK;
                                        private static final Color UNIT_FACTORY_DAMAGE_OUTLINE_DEFAULT = Color.LIGHT_GRAY;
                                        private static final Color UNIT_HIT_DAMAGE_COLOR_DEFAULT = Color.BLACK;
                                        private static final Color UNIT_HIT_DAMAGE_OUTLINE_DEFAULT = Color.LIGHT_GRAY;

                                        TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                                        HeppsH 1 Reply Last reply Reply Quote 0
                                        • redrumR Offline
                                          redrum Admin
                                          last edited by

                                          Last but not least the PR with the changes: https://github.com/triplea-game/triplea/pull/3488

                                          TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                                          1 Reply Last reply Reply Quote 0
                                          • FrostionF Offline
                                            Frostion Admin
                                            last edited by

                                            Personally I think 12 is nice. Especially since the unit pictures themselves are pretty small. If pictures were bigger, then the text should of course also be set to be bigger.

                                            Map maker of: Star Wars: Galactic War + Star Wars: Tatooine War + Caribbean Trade War + Dragon War + Age of Tribes + Star Trek: Dilithium War + Iron War + Iron War: Europe + Warcraft: War Heroes

                                            prastleP 1 Reply Last reply Reply Quote 0

                                            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
                                            • 2
                                            • 2 / 2
                                            • First post
                                              Last post
                                            Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums