Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    Hey Monokkel,

    I also took a look at x-com style movement display a few weeks ago but the tangents made my head hurt. So instead i decided an outline post process would be the easier option, like this.
    http://www.tomlooman.com/the-many-us...h-in-unreal-4/

    But if you have it working with splines it will be interesting to see how it works.

    Comment


      Originally posted by elec2ron View Post
      Hey Monokkel,

      I also took a look at x-com style movement display a few weeks ago but the tangents made my head hurt. So instead i decided an outline post process would be the easier option, like this.
      http://www.tomlooman.com/the-many-us...h-in-unreal-4/

      But if you have it working with splines it will be interesting to see how it works.
      Thanks for the input, elec2ron. I've also looked into using render custom depth to make an outline. However, the issue then becomes to shape the mesh that the post processing will create an outline of. The underlying meshes would still have to conform appropriately to the terrain if the outline is to look good. Have you thought of a way to do this or to get around the issue?
      Advanced Turn Based Tile Toolkit (Marketplace - Support)

      Dungeon Crawler Toolkit (Marketplace - Support)

      Discord

      Comment


        Yes i am creating procedural meshes for the display tiles now, i trace points to get the correct positions for the mesh verts so it can conform to any environment. We found this to be the best solution for us as while the tile decals looked great on landscape they ended up looking quite nasty on lots of our mesh floor tiles.

        Comment


          Originally posted by elec2ron View Post
          Yes i am creating procedural meshes for the display tiles now, i trace points to get the correct positions for the mesh verts so it can conform to any environment. We found this to be the best solution for us as while the tile decals looked great on landscape they ended up looking quite nasty on lots of our mesh floor tiles.
          Yeah that makes sense. I was planning to look into procedural meshes at some point for this purpose. Are you using multi-level grids, or just single-level grids with height maps? I imagine the former would be a lot more challenging.
          Advanced Turn Based Tile Toolkit (Marketplace - Support)

          Dungeon Crawler Toolkit (Marketplace - Support)

          Discord

          Comment


            For multi-level grids i use the Height Between Levels var for the trace start height, then to make sure i do a multi trace and use the hit closest to the relevant tile index. Also have a new trace channel just for walk-able floors so nothing else gets in the way.

            Comment


              Originally posted by elec2ron View Post
              For multi-level grids i use the Height Between Levels var for the trace start height, then to make sure i do a multi trace and use the hit closest to the relevant tile index. Also have a new trace channel just for walk-able floors so nothing else gets in the way.
              I think I misunderstood you slightly. This might stem from my lack of experience when it comes to using procedural meshes. Are you using a single, large procedural mesh for all the tile markers or are you using one individually for each tile? If you're doing it individually then I can see how you can run traces on each corner of the tiles and have them line up with the neighboring tile. But if you're doing something where you merge all the meshes together into one large procedural mesh then I imagine finding the correct adjacent meshes would be challenging; particularly for multi-level grids. Would you mind sharing a screenshot so I can understand it better?
              Advanced Turn Based Tile Toolkit (Marketplace - Support)

              Dungeon Crawler Toolkit (Marketplace - Support)

              Discord

              Comment



                Here is a simplified example.
                I create a single procedural mesh component then add a mesh section for each tile. First you create the verts from the tile x/y and the z from the trace. Then you create the triangles and uv's from the vert array indexes.

                This is an example of 4 verts but i have found that 9 is enough to conform to terrain nicely.

                It would be more complicated to create all the tiles from one mesh section but it would result in less draw calls so is perhaps worth it. To simplify it i would add 4 new verts to the array each loop as there is no real need to have each tile welded to the adjacent ones.
                Click image for larger version

Name:	procmesh.jpg
Views:	39
Size:	189.3 KB
ID:	1505236

                Comment


                  elec2ron : Thanks a lot for the explanation! Using procedural meshes for something like this is something I've had in the back of my mind for a long time, but as I assumed it was going to be a lot of work to implement I've kept it low on the list. Thanks to your input I might try my hand at this a lot sooner. Not this update, but maybe the one after.
                  Advanced Turn Based Tile Toolkit (Marketplace - Support)

                  Dungeon Crawler Toolkit (Marketplace - Support)

                  Discord

                  Comment


                    Trying to use this grid code in multiple projects, one of them being a tower defense so that in game I can only place on the grid. I see that BP_unit automatically snaps to grid while in view port editing and obviously in game. Does anyone know where the code for this is so i can replace BP_Unit with my Tower parent?

                    Comment


                      Originally posted by JohnnyLawG View Post
                      Trying to use this grid code in multiple projects, one of them being a tower defense so that in game I can only place on the grid. I see that BP_unit automatically snaps to grid while in view port editing and obviously in game. Does anyone know where the code for this is so i can replace BP_Unit with my Tower parent?
                      You can find similar code for grid snapping in the construction scripts of BP_GridActor and BP_Unit. I recommend looking at BP_GridActor unless you are using the character class for your towers. The relevant blueprints are near the end of the construction script's execution chain. There is no way I know of to get grid snapping working for the scene root of the actor so I found a workaround. I add another scene component that I call GridAnchor to which I attach everythin I want to snap to the grid. Then I place the GridAnchor at the center of the closest tile when moving the actor in the construction script. If I later want to get both of these scene components aligned and have the actor itself be at the center of the tile I place the actor at the location of the GridAnchor and then set the grid actor's location to the location of the scene root.
                      Advanced Turn Based Tile Toolkit (Marketplace - Support)

                      Dungeon Crawler Toolkit (Marketplace - Support)

                      Discord

                      Comment


                        Hi There I'm having a small trouble getting units to spawn and act correctly on the Grid. I’m trying to integrate the Dungeon Architect with the toolkit. I’ve been able to sync the grid manager and dungeon generator but when I try to spawn the units they are unable to move.

                        I'm able to spawn randomly on the grid using the Advanced game mode and the following level blueprint. As you can see the unit spawns and snaps to the grid, but the HUD and logic don't seem to start. I'm using the Dungeon Architect to pick a random tile which should sync up with the Grid Manager.

                        Attached Files

                        Comment


                          Originally posted by markps View Post
                          Hi There I'm having a small trouble getting units to spawn and act correctly on the Grid. I’m trying to integrate the Dungeon Architect with the toolkit. I’ve been able to sync the grid manager and dungeon generator but when I try to spawn the units they are unable to move.

                          I'm able to spawn randomly on the grid using the Advanced game mode and the following level blueprint. As you can see the unit spawns and snaps to the grid, but the HUD and logic don't seem to start. I'm using the Dungeon Architect to pick a random tile which should sync up with the Grid Manager.
                          Love how my placeholder meshes look in Dungeon Architect I'm guessing you do not have any units placed beforehand when the game starts? If so the game does not start automatically and you have to call the StartMatch event in BP_TurnManager manually after spawning units. See if that works.
                          Advanced Turn Based Tile Toolkit (Marketplace - Support)

                          Dungeon Crawler Toolkit (Marketplace - Support)

                          Discord

                          Comment


                            The assets work surprisingly well! You're correct I'm spawning them from the level blueprint at runtime.I've access the BP_Turnmanager using -> Cast to Turn Manager class -> get all actors of class -> Start match.

                            However the unit can only move to certain tiles, others are blocked off. I'm using Multi height grids. I did have to offset the gridmanager by X 100, Y100. Could this be the issue?
                            Attached Files
                            Last edited by markps; 07-25-2018, 08:27 AM. Reason: Fixed issue

                            Comment


                              Originally posted by markps View Post
                              The assets work surprisingly well! You're correct I'm spawning them from the level blueprint at runtime. It may be a beginner question but do I have to place the BP_TurnManager in my level, or how do I access the one that spawns when the level starts?
                              Glad to hear it is a good fit I had assumed they would work together well as they are both grid based and my toolkit is set up to make automatic walkability maps intelligently.

                              The turn manager is spawned by the game state at the beginning of the game, which holds a reference to it. I've implemented an interface in the game state so you can access the turn manager, action manager and grid manager from it without casting. Get a reference to the generic game state (Get Game State). Then make a call to the BPI_Singletons interface and Get Turn Manager.

                              You can also do it the lazy, slightly less performant way and GetAllActorsOfClass(TurnManager) and then get index 0 from the output array.
                              Advanced Turn Based Tile Toolkit (Marketplace - Support)

                              Dungeon Crawler Toolkit (Marketplace - Support)

                              Discord

                              Comment


                                I've played around with this a bit more, I'm able to move correctly around the grid if I randomly generate the map before I run the game. However if I generate the map at runtime the Grid manager will revert to whatever dungeon architect had spawned previously, is there something I need to call to get the Grid Manager to update to the new geometry?

                                (I'll promise to stop spamming this thread soon )

                                Comment

                                Working...
                                X