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

    Invisible units

    Scheduled Pinned Locked Moved Feature Requests & Ideas
    30 Posts 5 Posters 14.7k Views 5 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
      last edited by Hepps

      Why couldn't we just add an suffix to the name of any particular unit that is invisible or has no "real" image....

      eg. chinesehypotheticalFactory_Null_Image

      Then the engine could simply be directed to place all "_Null_Image" units last on the rendering priority list or not be rendered at all.

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

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

        @hepps Well, in that case you would still have the issue that if you have no overflow lines the invisible unit will be clicked on when you want to click on the territory and if you have overflow lines you see the overlflow with no units (of course this could be addressed by stopping the overlflow before that).

        But having a skin property to set the placement order would be cool also for other reasons; so any mapmaker could define it as he thinks it's best for the map, and safeguard the map from future changes in the default placement order.

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

          @alkexr Not actually suggesting it, but if you make sure the invisible unit is always first in placement (having 0 movement and being first in list of those) and always present in those territories, you could hack what you want by having the first placement spot outside view (like setting it at a X and Y value greater than the map dimensions).

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

            So I'd like to add an option to not need/display unit images for certain units. General thought is just a unit attachment property like "invisible" or "noImage". Not sure what you mean by "in the skin". The other 2 suggestions are very hacky and really don't address the problem for large maps with potentially multiple invisible units: https://forums.triplea-game.org/topic/986/red-sun-over-china-rsoc-official-thread/17

            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 @redrum
              last edited by

              @redrum Ah, I mean I would not flag the unit as to not be displayed (in the territory and the territory tab) in the xml. I would add such an option somewhere in the map folder outside the xml, maybe inside map.properties.

              For example, an entry in map.properties like:

              dont_draw_units=ruralproduction,station

              To be clear, the skin of a map, more correctly called original skin, is everything relevant inside the map folder but the xml in the games folder.
              Since it is a purely display feature, I definitely believe it should belong to the skin, not to the game itself (so, you could also have a mapskin showing ruralproduction with a village and station with a station, for example).

              I personally definitely think that for games having a factory in each territory, representing it with a flag roundel is preferable and less hacky than using an invisible image. No doubt setting units outside view it's a dirty hack, obviously.

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

                @redrum Another possible use of this feature is for making mapskins that don't display units you would not hide by default. For example, one could do a "battle" mapskin for a map (like Civil War) where you have a lot of economic units. That mapskin could have all the non-battle units hidden, and one could switch to that when he doesn't care to see them. In this case a quick key for jumping through the available map skins would help.

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

                  @cernel Ah ok. I see what you mean. Yeah map.properties is probably a better place for it since it really a display only issue.

                  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
                  • redrumR Offline
                    redrum Admin
                    last edited by

                    Here is the PR: https://github.com/triplea-game/triplea/pull/3917. Essentially you can now specify units that won't be drawn on the map, territory panel, or unit help (also won't throw an error if you don't include images for them in the unit folders as long as you aren't using them anywhere else like production/etc).

                    Here is an example of what I added to Red Sun Over China:
                    dont_draw_units=ruralproduction,station

                    Before
                    image

                    After
                    image

                    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 2
                    • C Offline
                      Cernel Moderators @redrum
                      last edited by Cernel

                      @redrum Cool, but, on a second thought, I'm not so sure anymore my suggestion of not having it displayed in the territory tab too was the right way to go. I was thinking in term of the unit to be represented by an invisible image and, in this case, of course better not having it in territory tab. On the other hand, now that the image doesn't display on the board anymore, that is the main item, maybe we should assume that invisible images should not be used (they were always a hack anyways), thus, for example, the "station" unit could be shown by the image @Hepps posted (the image of a station) that would be seen in the territory tab but not on board, this being consistent with the fact that the board is making the presence clear by other graphic means. Also I'm thinking about spotting bugs in that, say, you miss to add a "station" somewhere, and that would be easier to spot if is still displayed in the territory tab. So, I'm not definitive on this, but thinking about it again, especially on the account of games imperfections or for an easy way to be sure of what it is when you play a new game, maybe it would be better not to draw it in the board but still displaying it in the territory tab? Of course, this assumes that mapmakers would use actual images, to display in territory tab. What does @alkexr would think would be best for his map as well between:

                      1. Having the factory unit never displayed on board and territory tab.

                      2. Providing an actual visible image for the factory unit, and having it displayed in territory tab but not on board.

                      ?

                      Anyways, I don't feel strong one way or the other. Just having some doubts on the utility of hiding the image from the territory tab too.

                      I didn't think about the unit help, and yeah that can easily become a mess with many utility units (just look at Age of Tribes), even without considering invisible ones, and I don't have a clear idea about it. I think a good game should just provide a good table in notes for giving the info, but, as we know, it is not rare that most games don't and not few of those that do say different stuff in notes than what it is the game, so the unit help is really a useful feature. I'm oriented to think that unit help should go the same way as territory tab.

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

                        @cernel I think not showing them at all is probably better. Don't want players to get confused on seeing a unit in one place then not seeing it display on the map. At least for ROSC, I definitely feel ruralproduction not displaying anywhere is best and think stations probably better not to show anywhere but could argue that one a bit.

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

                        redrumR HeppsH 2 Replies Last reply Reply Quote 0
                        • redrumR Offline
                          redrum Admin @redrum
                          last edited by

                          PR is merged and this can be tested out by downloading the latest RSOC and using the latest pre-release: https://github.com/triplea-game/triplea/releases/tag/1.9.0.0.11665. Rock on!

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

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

                            @redrum I think that makes sense. If the unit does not interact with the game, meaning it can't be attacked and simply provides a solution to the map maker for functionality, then it really doesn't need to be in the map or tab.

                            The mapmaker should really be describing the impacted behavior in his notes, since often times the unit itself is purely a means to an end and not really intended to be a unit at all.

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

                            1 Reply Last reply Reply Quote 0
                            • General_ZodG Offline
                              General_Zod Moderators @redrum
                              last edited by General_Zod

                              @redrum Your current version is great but I think it would be nice to allow map maker to decide where exactly it needs to be displayed. That being said maybe build in an additional option into this by adding one more letter to the code as follows.

                              dont_draw_units=ruralproduction,station (wont draw anywhere)

                              dont_draw_units_m=ruralproduction,station (wont draw on map only)

                              dont_draw_units_h=ruralproduction,station (wont draw on help page only)

                              dont_draw_units_t=ruralproduction,station (wont draw on territory tab only)

                              dont_draw_units_m_t=ruralproduction,station (wont draw on map and territory tab or any mix in one line of code.)

                              @cernel makes some good points for might wanting to see it in territory tab or help page while still in the mapmaking phases. This may help a mapmaker identify or pinpoint issues early. As the help page goes it also shows the true values for each unit at the point of opening help page (updates itself). This helps if using triggers that manipulate values. Also it will simply by flexible enough to accommodate unmentioned scenarios.

                              Additionally it might be helpful to have a feature that can disable the selection of invisible units on map. So it doesn't even show up in a selection list on any movement phases (cm, ncm). I guess can just give 0 movement too.

                              redrumR C 2 Replies Last reply Reply Quote 0
                              • redrumR Offline
                                redrum Admin @General_Zod
                                last edited by

                                @general_zod Yeah, I'd probably spell it out but that was my thought as well. For now, I think I'll leave my initial feature and see how people want to use it. If a mapmaker has a strong case to want it shown some places and not others then I'm glad to expand this to have more fine grain control.

                                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
                                • C Offline
                                  Cernel Moderators @General_Zod
                                  last edited by Cernel

                                  @general_zod If going finer, I'd rather go this way:

                                  For the Unit Help, having a specific property for it, to fully customize what's in it and its order, on the same model as the "production_tabs.properties". This is probably needed anyways, since the way the Unit Help tabs currently work is very raw, and it doesn't really work well even for very basic games like World At War (or any games having units that may get added by triggers during the course of it).

                                  In this case, you should get an error if at any point during the game you are able to purchase a unit not present in Unit Help.

                                  For the showing / not showing in territory tab (while always not on board), I'm thinking that this probably needs to remain standard, as I doubt that mapmakers may go consistently one way or the other, and would just end up like some sort of random personal preference.

                                  In this case you should get an error if you have in purchase screen a unit meant not to be drawn, as I think that would not make sense.

                                  EDITED as on a second thought better not relate to image presence.

                                  I want also to point out that combat units (you would see in the battle window and in the battlecalculator) may be a good candidate for not being drawn in the territory tab. For example, you can have a game in which in each territory there is always 1 capturable combat unit, providing some additional defence or whatever, that would be better not being drawn (everywhere) in the map. Or you could have a game where everywhere there is a river you have a "river" combat unit, that (as long as it is always there) can be not drawn, if it is already shown by the graphic.

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

                                    Meaning that I think the not drawn user case is not really related to something being production or logistic related, but to the fact of being ubiquitous (the reason why maps with factories everywhere used invisible images for them is because those units where everywhere, thus ridiculously redundant to see, not because they were factories; it would be just the same if you would have capturable units defending at 4 everywhere).

                                    Of course, it needs to be surely there, thus being either a capturable infrastructure or something immediately replaced by triggers. This doesn't change the matter as, for example, you would not have invisible ruralproduction units if they would be destroyed on capture.

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

                                      I would like to update (make a pull request for) Feudal Japan with this new feature, but I've still that "Delete costPU" pending pull request, and I don't know how to do it splitting the two.

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

                                        @cernel You can have multiple PRs open at the same time. As long as they don't end up editing the same lines in the same file then there shouldn't be any issues.

                                        Just make sure you create a separate branch when submitting the new changes.

                                        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 0
                                        • C Offline
                                          Cernel Moderators @redrum
                                          last edited by Cernel

                                          @redrum I've no idea how to do that. What I just do is to compare the target repository with my repository, that is a modified version of that repository I forked.

                                          I guess I could do it by making a second GitHub account where to fork the repository again and modify it in a different way.

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

                                            @cernel Yeah, its gonna be pretty tough to explain how to go about doing that I realize. For this case, I think its gonna be easier if you just post your recommended changes here and I'll update the repo.

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