Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by Monokkel View Post
    Feel free to post about any things you have added. I love to hear what people use the toolkit for, and it inspires me to add features of my own
    Small update. I've added a first version of fog of war, difficult terrain (that can provide a cover bonus).
    Also, a tile type can now indicate if a unit should go "crouched" when they enter it. This gives a sense of immersion, as the unit actively appears to be hiding among the shrubbery :-)
    It also decreases the walk speed of the unit, so it makes for some very cool sneaking movement when traversing multiple tiles of forest!



    The fog of war implementation is working well enough. But I'm getting small frame drops when I'm setting the fog-of-war vision range to higher values (say, >3 tiles).
    So I'll need to think up something to make that more efficient.

    Comment


      Very cool! You're making great progress. Both cover systems and variable movement speed while crossing different types of terrain are both things I have on my to-do list. As for fog of war I've added this to the example game that comes with the update I've sent to Epic. That is for a 2D sprite based example, but the solution for finding visible tiles around units is quite efficient and should probably be of help to you. What do you use for determining what tiles a unit can see? The Find Tiles In Range function? If so how often are you calling it? You should only be needing to call it whenever a unit first enters a new tile. Lastly I'm very curious as to how you are rendering your fog of war. Fist I assumed you were using gray decals, but when I take a closer look it seems like your rock and tree meshes are transparent. Are you using some sort of post processing or replacing every mesh?

      Edit: With all this stuff being shared I got inspired to show some of my own progress. Heightmaps are working pretty well now and I'm trying to find the best way for the player to be able to see lower floors that are blocked by roofs and similar. My current favorite solution is to make meshes transparent if they are a certain height compared to the length of the camera spring arm. A special type of actor are used for these sorts of floors so that the user can specify what meshes are affected. These actors also automatically detect if they are at the lowest level of a particular tile index, in which case they are never made invisible. If anyone have any input I'll be happy to hear it.

      Last edited by Monokkel; 01-04-2016, 08:51 PM.
      Advanced Turn Based Tile Toolkit (Marketplace - Support)

      Dungeon Crawler Toolkit (Marketplace - Support)

      Discord

      Comment


        Impressive, Knut. Is performance proving to be an issue at all?
        Sounds like changing the visibility by spring arm length is the way to go. Would structures appear opaque from the exterior to other pawns? (through a check if the pawn was beneath the mesh i guess) Is there a way to make it localized eg on the roof (level 2) building A, does not make building B level 3+ transparent? Don't know, just a query

        Highly anticipating these updates. Monokkel, you do great work. Thanks for the update, keeps me focused.
        Last edited by User609571414; 01-05-2016, 01:38 AM.

        Comment


          Originally posted by Monokkel View Post
          What do you use for determining what tiles a unit can see? The Find Tiles In Range function? If so how often are you calling it? You should only be needing to call it whenever a unit first enters a new tile. Lastly I'm very curious as to how you are rendering your fog of war. Fist I assumed you were using gray decals, but when I take a closer look it seems like your rock and tree meshes are transparent. Are you using some sort of post processing or replacing every mesh?
          That is exactly what I'm doing, just call it when entering a new tile.
          I've found out that this isn't the cause of my framedrop though, it's related to my FoW solution for meshes.

          So what I have is a transparent gray plains mesh that overlays the basic terrain. No problems with that.
          But for all my meshes attached to a HISM parent, I have a HISM_FoW variant. The FoW variant uses the same mesh, but with a transparent material assigned to it.
          Whenever I reveal new terrain, I remove transforms from the HISM_FoW and add one to the HISM(_revealed) parent.
          This seems to be giving quite a few hickups, as I'm always looping each HISM to find the correct transforms to remove.
          I wanted to use the getInstancesOverlappingSphere function to find overlapping indexes instead, theoretically quicker, but for some reason this function simply seems to not work at all.

          So yeah, that's my problem :-) I'll tinker with it more this evening after work.
          Nice progress with the invisible roofs btw!

          Comment


            Originally posted by Spartacas View Post
            Impressive, Knut. Is performance proving to be an issue at all?
            If you're thinking about pathfinding using multi-level grids, then there is virtually no impact on performance. The way the edge array works in the newest update all tiles hold the indexes of each tile it is connected to (and only those) instead of naïvely assuming it is connected to all surrounding tiles and then checking each step of the pathfinding if this is true. With this system for edges checking if a tile is connected to an edge on a higher level is just as quick as for adjacent tiles. If you're thinking of the way I create transparent meshes I haven't really tested the performance impact yet. I doubt it will be a problem for most games, but there might be an issue for huge maps with several layers of heightmaps. I'll be looking into this later.

            Originally posted by Spartacas View Post
            Sounds like changing the visibility by spring arm length is the way to go. Would structures appear opaque from the exterior to other pawns? (through a check if the pawn was beneath the mesh i guess) Is there a way to make it localized eg on the roof (level 2) building A, does not make building B level 3+ transparent? Don't know, just a query

            Highly anticipating these updates. Monokkel, you do great work. Thanks for the update, keeps me focused.
            The way it currently works I do not check whether or not the current unit is outside or inside something. It is also global so that all Heightmap Platform actors of the appropriate height are made transparent at once. I will look into alternate ways of doing this, but I might not find a solution that is generic enough to be included in the default toolkit. If I find a good solution that only works for specific types of games I might include it in an exampe map.

            Originally posted by Lodeman View Post
            That is exactly what I'm doing, just call it when entering a new tile.
            I've found out that this isn't the cause of my framedrop though, it's related to my FoW solution for meshes.

            So what I have is a transparent gray plains mesh that overlays the basic terrain. No problems with that.
            But for all my meshes attached to a HISM parent, I have a HISM_FoW variant. The FoW variant uses the same mesh, but with a transparent material assigned to it.
            Whenever I reveal new terrain, I remove transforms from the HISM_FoW and add one to the HISM(_revealed) parent.
            This seems to be giving quite a few hickups, as I'm always looping each HISM to find the correct transforms to remove.
            I wanted to use the getInstancesOverlappingSphere function to find overlapping indexes instead, theoretically quicker, but for some reason this function simply seems to not work at all.

            So yeah, that's my problem :-) I'll tinker with it more this evening after work.
            Nice progress with the invisible roofs btw!
            Yeah, getInstancesOverlappingSphere has given me some headaches as well. It seems like you're having similar problems to when I made my own fog of war system. I think the problem is that a bunch of ISMs or HISMs are basically an array of meshes. If you delete one in the middle of the array then the engine will essentially have to delete and recreate all meshes again, since there can be no "blank" instances in this array. This is speculation on my part, but it does at least seem to be something like this. Because of this you do not want to delete multiple ISMs in one tick, since the engine will essentially have to repopulate the array every time. The solution I found was to move the ISM to a location it cannot be seen instead of deleting it. This way the amount of instances remain the same, so they do not all need to be recreated.
            Advanced Turn Based Tile Toolkit (Marketplace - Support)

            Dungeon Crawler Toolkit (Marketplace - Support)

            Discord

            Comment


              I have to say this HISM_FoW variant for each mesh is just giving wayyy too much headaches. And frankly doen't even look as good as decals placed over each tile.
              Honestly I simply hadn't considered using decals before, but it seems much easier to manage, and a quick test on the 20x20 map didn't seem to give any performance problems if I filled it up completely with decals.
              So yeah, bye bye HISM_FoW. Hello decals!

              Comment


                Great! That is what I assumed you did initially. I would be interested in seeing how it works with decals if you would want to post a screenshot
                Advanced Turn Based Tile Toolkit (Marketplace - Support)

                Dungeon Crawler Toolkit (Marketplace - Support)

                Discord

                Comment


                  Hi Knut,
                  I got around to switching over to decals, for the most part.
                  Looks alot better, and runs silky smooth now :-)



                  Funny how much time you can waste on a bad solution before seeing the light!

                  Comment


                    Looks neat! Glad it worked so well. I might be wrong, but it seems like the leaves on some trees are still a bit green? If this is the case, make sure they are set to receive decals in their rendering settings.

                    So true with the wasting time on a bad solution bit. I've spent so much time changing and reinventing features. It is a part of the learning process, though
                    Advanced Turn Based Tile Toolkit (Marketplace - Support)

                    Dungeon Crawler Toolkit (Marketplace - Support)

                    Discord

                    Comment


                      Hey Guys,
                      I dont think i have ever posted here before but here is a preview of my progress so far. My main focus has been multiplayer and i think i have nailed it.

                      Comment


                        @Westcut: Very cool. I too at some point want to do this, was it alot of work to incorporate? Any specific struggles?

                        @Monokkel: Aye, the leaves appear a tad green. I think this may be due to the material using subsurface lighting, but it's a bit of a guess atm. When I go up close to the leaves, from above, it does have the decal applied correctly.

                        Comment


                          Originally posted by Lodeman View Post
                          @Westcut: Very cool. I too at some point want to do this, was it alot of work to incorporate? Any specific struggles?
                          It was quite challenging hardest part was getting the replication working.

                          Comment


                            Great progress! We're there any specific tutorials or material you followed to get going in the right direction? This is exactly what I was going to work on next for my own project.

                            Comment


                              Does the fog of war affect pathfinding at all? For example if an enemy is around a corner doesn't the array of valid moves still reveal that there is a unit in the way by not allowing you to move through that hex?

                              Comment


                                Originally posted by westcut View Post
                                Hey Guys,
                                I dont think i have ever posted here before but here is a preview of my progress so far. My main focus has been multiplayer and i think i have nailed it.
                                Great to see you showing off your multiplayer implementation in the forum thread, westcut! Looks almost perfect, with just a few things showing up a bit differently on the two clients. The most obvious one is the current pawn marker. I guess its per tick movement is not replicated? You can find the code that moves this marker in the bottom left of the event graph of ATBTT_PlayerController, right after the event tick.

                                Originally posted by CampingCarl View Post
                                Does the fog of war affect pathfinding at all? For example if an enemy is around a corner doesn't the array of valid moves still reveal that there is a unit in the way by not allowing you to move through that hex?
                                In the 2D game example that comes with the 1.5 update there is fog of war that affects pathfinding. In that example I have an array that keeps track of whether or not a tile has been discovered. If it has not then it cannot be moved to. This works well in combination with letting units do partial moves, so that they can move a bit to reveal new tiles, then move again to the revealed tiles in the same turn. I think this is ideal with the sort of pathfinding I use in my example, where the fog of war is completely black.

                                In Lodeman's version it is probably better to do something like in Civ V, where you can generate and show a path to any walkable tile within the fog of war and then stop unit movement the moment something blocking the path is discovered. There are a few ways to do this, but it is a bit more complicated. It would be something like checking the pawns in sight array against the Path Index Array every time new tiles are revealed and stopping movement/rerunning pathfinding if the same index is found in both arrays.
                                Advanced Turn Based Tile Toolkit (Marketplace - Support)

                                Dungeon Crawler Toolkit (Marketplace - Support)

                                Discord

                                Comment

                                Working...
                                X