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

    Dyeing/Colorizing Unit Images

    Scheduled Pinned Locked Moved Feature Requests & Ideas
    68 Posts 10 Posters 31.7k Views 9 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.
    • redrumR Offline
      redrum Admin
      last edited by

      Properties Description

      # Unit color settings (apply effects similar to colorize functions of image editing tools)
      #units.color.<player> applies the given color's hue and saturation to the player's units
      #units.color.Russians=00BBBB
      #units.color.brightness.<player> allows the brightness (-100 to 100) to be adjusted when above unit color is set 
      #units.color.brightness.Russians=25
      #units.color.flip.<player> flips the player's units horizontally
      #units.color.flip.Russians=true
      #units.color.ignore provides a comma delimited list of units that aren't impacted by the above units.color properties
      #units.color.ignore=factory,fighter
      

      POS2 PR: https://github.com/triplea-maps/the_pact_of_steel/pull/33

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

      C 1 Reply Last reply Reply Quote 1
      • C Offline
        Cernel Moderators Lobby Moderators @redrum
        last edited by Cernel

        @redrum Strange that you have to set the other thing to be able to use the brightness option.

        Even without any intentions of having anything flipping the units vertically, I believe the name should specify that the flipping is horizontal. Also probably not color. So like: units.transform.flip.horizontal.

        LaFayetteL 1 Reply Last reply Reply Quote 2
        • LaFayetteL Offline
          LaFayette Admin @Cernel
          last edited by

          @Cernel said in Dyeing/Colorizing Unit Images:

          Even without any intentions of having anything flipping the units vertically, I believe the name should specify that the flipping is horizontal. Also probably not color. So like: units.transform.flip.horizontal.

          I strongly agree with you Cernel on color adjustment and image rotation not necessarily being related. These properties once defined are probably going to stick around for a very long time.

          I'd also agree brightness and color would also be ideally decoupled, for now it's difficult on the backend. If there is a reason to need the feature, it could be a nice enhancement to see added later.

          With regards to coupling, I've also been wondering if the 'ignore' of coloring and image flipping should be decoupled. Is it always the case that any unit where we want to ignore coloring, we will also always want to ignore image flipping? In other words, should a map maker be allowed to say "flip this image, but do not color it".

          The cost of enabling that is likely duplication, ie:

          units.color.ignore=factory,fighter
          units.color.flip.ignore=factory,fighter
          

          But the above would allow for something like the following where, for example, 'fighters' are colored but not rotated:

          units.color.ignore=factory
          units.color.flip.ignore=factory,fighter
          

          For property names, I'd recommend keeping them singular and prefixing with "unit.image", as a suggestion:

          unit.image.color.<Player>=FF00FF
          unit.image.brightness.<Player>=100
          unit.image.rotation.flip.horizontal={true|false}
          

          Or:

          unit.image.color.<Player>=FF00FF
          unit.image.brightness.<Player>=100
          unit.image.rotation.flip={horizontal|none}
          
          C 2 Replies Last reply Reply Quote 2
          • C Offline
            Cernel Moderators Lobby Moderators @LaFayette
            last edited by

            @LaFayette Ah, right. It's important that the ignore thing will not effect the flipping; the two matters are really not related, and I can see you should not be normally wanting of not flipping the units you don't want to colourize. That's probably an even bigger reason than my purely self-consistent considerations.

            1 Reply Last reply Reply Quote 0
            • C Offline
              Cernel Moderators Lobby Moderators @LaFayette
              last edited by

              @LaFayette said in Dyeing/Colorizing Unit Images:

              With regards to coupling, I've also been wondering if the 'ignore' of coloring and image flipping should be decoupled. Is it always the case that any unit where we want to ignore coloring, we will also always want to ignore image flipping? In other words, should a map maker be allowed to say "flip this image, but do not color it".

              The cost of enabling that is likely duplication, ie:

              units.color.ignore=factory,fighter
              units.color.flip.ignore=factory,fighter
              

              But the above would allow for something like the following where, for example, 'fighters' are colored but not rotated:

              units.color.ignore=factory
              units.color.flip.ignore=factory,fighter
              

              I believe that ignoring units for colourization should not effect flipping.
              I would not have an option for ignoring units for flipping.

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

                I've renamed the properties to use "units.transform" instead of "units.color" prefix:

                units.transform.color.Germans=FF0000
                units.transform.flip.Germans=true
                units.transform.color.Russians=00BBBB
                units.transform.brightness.Russians=25
                units.transform.color.British=00FF00
                units.transform.ignore=factory,fighter
                

                @Cernel The ignore needs to apply to flip as well as generally the units you ignore will either be things like factory which appear exactly the same for all nations (not flipped like the rest) or will be damaged BB or AA radar which you'll already manually colorize/flip if you want them to be ignored (wouldn't want to flip them back). I don't think there is really a use in TripleA to be flipping images and not coloring them which is why they share a single ignore unit list. Remember this isn't meant to be an image editing program just give users and map makers the common functions that they would need if creating a shared unit set.

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

                C 3 Replies Last reply Reply Quote 1
                • C Offline
                  Cernel Moderators Lobby Moderators @redrum
                  last edited by

                  @redrum Personally, if I would make an Axis vs Allies game, with Axis all facing a side and Allies all facing another side, and I would have something like a capturable emplacement or bunker (a combat infrastructure), I would have that unit too being one the flipped version of the other alliance, like all other units, while, as long as they don't move and always belong to the territory owner, I would leave them generically colourized the same way for everyone. For consistency, I would go the same way with factories, even if they would be non combat infrastructures, but I see that currently in assets the factories are all always the same, no matter where the other units appear to be facing. However, I believe having no colourization is not related to being a non combat units (as if you have mobile factories that can go in allied territories, you need to tell them apart), but to always belonging to the territory owner where the units is, which means being an infrastructure, and currently infrastructures can be combat units too, while this was not the case when Classic and Revised were made.

                  redrumR 1 Reply Last reply Reply Quote 0
                  • C Offline
                    Cernel Moderators Lobby Moderators @redrum
                    last edited by Cernel

                    @redrum said in Dyeing/Colorizing Unit Images:

                    @Cernel The ignore needs to apply to flip as well as generally the units you ignore will either be things like factory which appear exactly the same for all nations (not flipped like the rest) or will be damaged BB or AA radar which you'll already manually colorize/flip if you want them to be ignored (wouldn't want to flip them back).

                    I really would go the same way with such things. If I'm colourizing a unit, I would colourize the same way also his damaged or tech versions (that is why I would not colourize units that have any sub-versions of the same being not monocolour, even if the basic unit is). Besides, elements that are beyond this scheme should rather really be icons that the program overlays.

                    On this matter, it should be decided if calling "battleship" will call "battleship_hit" and "battleship_r" too, as well as if calling "aaGun" will call "aaGun_r", "rockets" and "rockets_r" too, as well as if calling "fighter" will call "fighter_lr" and "fighter_jp" and "fighter_lr_jp" too etc.. I think all those cases if you are calling the basic unit, all the related damaged or tech variants should be called too. So, for example, if I exclude "bomber", then "bomber_lr", "bomber_hb" and "bomber_lr_hb" should be excluded the same way, as well.

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

                      @Cernel Well looking at just about every existing map... it appears no one else agrees with flipping factories and similar units. I think the part you are missing is that the units that generally aren't colored/flipped are 0 movement capturable units which generally represent some sort of building/fortification/etc that it makes more sense for them to never "move" or change orientation as they are just being captured.

                      Even look at TWW (probably the best map from a graphical standpoint) which has a bunch of these types of units (barracks, factory, rails, airbases, etc) and you'll see they all are uncolored and face the same direction for all nations.

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

                      C 2 Replies Last reply Reply Quote 0
                      • C Offline
                        Cernel Moderators Lobby Moderators @redrum
                        last edited by

                        @redrum Maybe I'm used to 270BC that when you capture a city it immediately becomes a completely different city.:grinning_squinting_face:

                        1 Reply Last reply Reply Quote 0
                        • C Offline
                          Cernel Moderators Lobby Moderators @redrum
                          last edited by

                          @redrum Quick question: currently, if "factory" is excluded, are "factory_hit", "factory_it" and "factory_it_hit" excluded too?

                          redrumR 1 Reply Last reply Reply Quote 0
                          • C Offline
                            Cernel Moderators Lobby Moderators @redrum
                            last edited by Cernel

                            @redrum said in Dyeing/Colorizing Unit Images:

                            I've renamed the properties to use "units.transform" instead of "units.color" prefix:

                            units.transform.color.Germans=FF0000
                            units.transform.flip.Germans=true
                            units.transform.color.Russians=00BBBB
                            units.transform.brightness.Russians=25
                            units.transform.color.British=00FF00
                            units.transform.ignore=factory,fighter
                            

                            @Cernel The ignore needs to apply to flip as well as generally the units you ignore will either be things like factory which appear exactly the same for all nations (not flipped like the rest) or will be damaged BB or AA radar which you'll already manually colorize/flip if you want them to be ignored (wouldn't want to flip them back). I don't think there is really a use in TripleA to be flipping images and not coloring them which is why they share a single ignore unit list. Remember this isn't meant to be an image editing program just give users and map makers the common functions that they would need if creating a shared unit set.

                            In GIMP "transform" means those things like rotating etc., not changing colours, but of course this is just a nomenclature. For coherency with "flip", I suppose the other one should be called "colorize" instead of "color", but, then, it would be not coherent with "brightness", instead (tho this is the same in GIMP too). Maybe it should be rather called "hs", or something hinting that it is changing only the hue and saturation, not sure.

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

                              @Cernel Yes, currently it checks the actual unit name against the ignore list not the specific image. So will ignore transforming for all the unit's various images (_hit, _lr, _it, etc). I figured that probably makes more sense but I'm open if folks feel they would want ignore to list each specific image for a unit.

                              Well, "color" fits better with "brightness" and "color" is used in other areas of the map.properties. "flip" is probably the one that's a bit questionable but I think that was the most straightforward name I could think of.

                              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 1
                              • LaFayetteL Offline
                                LaFayette Admin
                                last edited by

                                Flip & coloring should be completely independent IMO. We can add a 'flip' ignore later I suppose, so not critical. If it comes to that, I just hope that map makers will request the feature before they add more unit images to work around it.

                                I've pondered a bit if unit.transform.mirror.image=true would be any better, but does not necessarily seem so. I think the only thing missing or unclear about 'flip' is that it's a horizontal flip. There can be multiple types of flip, color, orientation, and for orientation multiple kinds.

                                Using the value 'horizontal' could potentially add clarity, eg:

                                units.transform.flip.Germans=horizontal
                                

                                The fact that there is no vertical is fine, it's an unsupported configuration that we could add in if needed. That would be a good route to leave open, if we did start allowing a vertical flip, for whatever reason, we wouldn't need an additional property (which would make the property naming even trickier).

                                redrumR 1 Reply Last reply Reply Quote 2
                                • redrumR Offline
                                  redrum Admin @LaFayette
                                  last edited by

                                  @LaFayette I thought about including something about horizontal so that later on vertical flipping could be added more easily. I just couldn't come up with any case where I would want to flip unit images vertically. If someone can think of something then I'm fine adjusting the property.

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

                                  LaFayetteL 1 Reply Last reply Reply Quote 0
                                  • LaFayetteL Offline
                                    LaFayette Admin @redrum
                                    last edited by

                                    @redrum I don't think there will be a case for it TBH, so it'd mostly just be for clarity IMO

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

                                      PR is now merged. Feel free to give it a try in the pre-release and provide feedback!

                                      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
                                      • wc_sumptonW Offline
                                        wc_sumpton
                                        last edited by

                                        @redrum
                                        Trying this out on 'Invasion_USA'. If I understand how the search of the image works it should be 'nation folder to units folder to images included with TripleA'

                                        Under the units folder I have only the 'Americans' folder the other nations share the other units. The 'Americans' also share the 'infantry' unit so no 'infantry.prg' in the 'Americans' folder.

                                        When I run the game the 'Invaders' do share the same units, but the 'Americans' infantry seems to be coming from the TripleA resources.

                                        If you have time could you check the search order, everything else works great.
                                        :thumbs_up_medium-light_skin_tone: :thumbs_up_medium-light_skin_tone:

                                        Cheers...

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

                                          @wc_sumpton That's correct. It should be first the folders in the map zip (nation, then shared) then the folders in TripleA engine assets (nation, then shared). If you share the map zip then I can take a look.

                                          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 1
                                          • ubernautU Offline
                                            ubernaut Lobby Moderators
                                            last edited by

                                            not sure why but for some reason i thought triplea was already doing this. 😛

                                            "You should never have told me horses sleep standing up, it gave me a mental block." - Mister Ed

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