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

    To answer in boring, vague marketing terms: "weeks, not months" :P It is mostly cleanup at this point, but new bugs keep popping up while I'm testing, so it is hard to predict exactly when I get it bug free and with all features working perfectly. A deadline I've hanging over me for my PhD has also slowed me down a bit.
    Thank you for the update! Looking forward to this! Good luck on your PhD man!

    Comment


      Hi @Monokkel
      I'm going to bug you about something else when it comes to multiplayer and replication.

      How have you dealt with spawning instanced static mesh objects on the tiles (i.e. the blue and red squares) when a player is moving or targeting? Do you do this purely on client side, so the other player can't see their opponent's move/target squares, or do you do it globally so it's visible for all? I'm trying to do it purely client side, but I'm also using the "ActivateGridManager" function (particularly the collapsed graph at the end of that function) to set the values of the ISMs, for example, TileInMoveRangeMC. However, on the client side on the playercontroller (through my GridManagerRef variable) the TileInMoveRangeMC is just a null pointer. GridManagerRef itself is not null, I am successfully accessing the grid manager from the client side in player controller. I set TileInMoveRangeMC to "Replicates", and I set the variables "bAlwaysRelevant" and "bReplicates" in GridManagerRef to true, but no luck. I even tried wrapping the collapsed graph (the one that sets values to TileInMoveRangeMC) in a RPC event, and I tried setting it to "Net Multicast" and "Run on owning Client", but neither worked.

      I read somewhere (I don't remember where) that ISMs are not supported for replication. But that was just a random comment by a non-staff member. Otherwise I can't find anyone else having my issue with replicating ISMs. How do you handle this?

      Thanks.

      Comment


        Originally posted by Tarrtarus View Post

        Thank you for the update! Looking forward to this! Good luck on your PhD man!
        Thanks! Deadline is tomorrow, so I should have more time shortly.

        Originally posted by Bridgeburners View Post
        Hi @Monokkel
        I'm going to bug you about something else when it comes to multiplayer and replication.

        How have you dealt with spawning instanced static mesh objects on the tiles (i.e. the blue and red squares) when a player is moving or targeting? Do you do this purely on client side, so the other player can't see their opponent's move/target squares, or do you do it globally so it's visible for all? I'm trying to do it purely client side, but I'm also using the "ActivateGridManager" function (particularly the collapsed graph at the end of that function) to set the values of the ISMs, for example, TileInMoveRangeMC. However, on the client side on the playercontroller (through my GridManagerRef variable) the TileInMoveRangeMC is just a null pointer. GridManagerRef itself is not null, I am successfully accessing the grid manager from the client side in player controller. I set TileInMoveRangeMC to "Replicates", and I set the variables "bAlwaysRelevant" and "bReplicates" in GridManagerRef to true, but no luck. I even tried wrapping the collapsed graph (the one that sets values to TileInMoveRangeMC) in a RPC event, and I tried setting it to "Net Multicast" and "Run on owning Client", but neither worked.

        I read somewhere (I don't remember where) that ISMs are not supported for replication. But that was just a random comment by a non-staff member. Otherwise I can't find anyone else having my issue with replicating ISMs. How do you handle this?

        Thanks.
        I'm spawning the ISMs client side, so I can assure you it is possible. Displaying tiles in sight and move range is handled in replicated ability blueprints in my WIP build. I pass input from the player controller to these blueprints which handle finding and displaying targets etc., mostly by calling functions from the grid manager. I can understand that you've had some trouble with this, because it is a bit tricky replication wise. Unless you have set things up differently, grid sized arrays like the Vector Field Array are not replicated (it would be a lot of data to send through), which means that if you try to run any function for spawning tiles on a client you'll run into trouble, since the locations of all tiles are stored on the server. Therefore you have to get the appropriate locations on the server first and pass them to the client for display.

        To give an example where you want to display tiles in move range around a unit when the unit is clicked:

        Click input event in the player controller -> run event on the server that runs the Pathfinding function -> convert the array elements of IndexedCanMoveToArray to an array of locations locations by using ConvertIndexToLocation -> pass location array to a custom event running on the client, spawning an ISM on each location.

        That is how I'm doing it currently, and it works great. Hope that helps!
        Advanced Turn Based Tile Toolkit (Marketplace - Support)

        Dungeon Crawler Toolkit (Marketplace - Support)

        Discord

        Comment


          I have a couple of questions for when you have some time. First, the current unit marker mesh doesn't show on the current unit anymore, it only shows on index 0. I'm fairly certain I didn't modify anything surrounding it. So far I've only changed stuff in the Receive Damage part of the Unit blueprint. I've looked through all references to this mesh with no luck. Any idea how I can go about fixing/troubleshooting this?

          Second question isn't exclusive to your toolkit. I copied the health stuff in the Receive Damage event to make second health bar that functions as "armor". I have it all working fine, but I don't know how to make it look the way I want it to. Do you know how can I make the HealthBillboard and the ArmorBillboard appear as a single material or stay aligned with each other? For example, if I put the armor bar above the health bar on the Z axis and I look up at the character from the ground, the health bar overlaps the armor bar.

          I have an alternative route for the second question, which involves a 3D Widget. That works fine in the sense that the bars are aligned, but I can't figure out how to get them to face towards the grid camera. If you have insight to that, that would be greatly appreciated also.

          Thanks a lot for everything you do.

          Click image for larger version  Name:	problems.PNG Views:	1 Size:	113.5 KB ID:	1366475
          Last edited by Zandothar; 10-09-2017, 12:58 AM.

          Comment


            @Zandothar: Hey an welcome You first question is something that has been reported before. It is a pretty weird bug that I have no idea how to properly fix in the current build. Thankfully it is not an issue in the coming update, and it is also easy to prevent it from having an actual in-game impact in the current build. Here is what I answered last time this was asked:

            Well, this bug is quite baffling. I'm able to replicate it following your steps and when I continue investigating it gets even stranger. The location of the Current Pawn marker is set in the Event Tick of ATBTT_PlayerController, here:


            it seems that making any change to ATBTT_GameMode causes the Use Index input boolean to be set to true, causing the frame to jump to index 0. Restarting ATBTT, as you noticed, fixes this issue, and Use Index is again set to false. This is extremely weird, and I'm quite sure has to be caused by the engine code and not ATBTT.

            Thankfully this bug does no longer appear in my internal build, so it will be fixed by the next update. However, since I have no idea what is causing this I cannot give you the steps to fix it in the live version. It's good that restarting the engine fixes it, though, so it will not cause any actual issues for your game. Very strange stuff, though.
            As for your health bar question, I don't think what you are trying to do is solvable by using two separate billboards, as they will overlap in strange ways. One way to do what you intend is to either make a more complex material for the health bar, so that is able to display both or, as you suggested, to use a 3D widget.

            I'd probably go for the second solution, as it is easier and more flexible. The reason I've done it this way is so I do not need to have all units constantly running tick events, for performance reasons. However, this is very unlikely to have an actual performance impact for most games.

            To rotate your bars appropriately to face the camera you'll need to enable tick events in the unit blueprint and rotate the health bar to face the camera every tick. I've actually done so in one of the units in the toolkit already. Have a look at Unit_VR in Maps/VR. Here is the relevant bit of code:

            Advanced Turn Based Tile Toolkit (Marketplace - Support)

            Dungeon Crawler Toolkit (Marketplace - Support)

            Discord

            Comment


              Monokkel when are you release multiplayer version? I'm waiting already 6 months

              Comment


                Originally posted by Monokkel View Post


                I'm spawning the ISMs client side, so I can assure you it is possible. Displaying tiles in sight and move range is handled in replicated ability blueprints in my WIP build. I pass input from the player controller to these blueprints which handle finding and displaying targets etc., mostly by calling functions from the grid manager. I can understand that you've had some trouble with this, because it is a bit tricky replication wise. Unless you have set things up differently, grid sized arrays like the Vector Field Array are not replicated (it would be a lot of data to send through), which means that if you try to run any function for spawning tiles on a client you'll run into trouble, since the locations of all tiles are stored on the server. Therefore you have to get the appropriate locations on the server first and pass them to the client for display.

                To give an example where you want to display tiles in move range around a unit when the unit is clicked:

                Click input event in the player controller -> run event on the server that runs the Pathfinding function -> convert the array elements of IndexedCanMoveToArray to an array of locations locations by using ConvertIndexToLocation -> pass location array to a custom event running on the client, spawning an ISM on each location.

                That is how I'm doing it currently, and it works great. Hope that helps!
                Thanks for the response.

                To your suggestion, that's basically what I'm doing. (Not exactly, but the main idea is the same.) I make a small array of only the locations (as FTransform objects) which are calculated server side, and that small array gets passed to the client successfully. So telling the client where to spawn the ISMs is no problem for me. However I haven't been able to assign values to the ISMs on the client side (i.e. tell the client that these objects are big blue squares), so when it comes time to actually place them where I need them on the client side, TileInMoveRangeMC is just an empty object. Is it correct for me to say that (at least in your currently released build) this process is done in the collapsed graph at the end of the "Activate Grid Manager" function? If so, should I have that graph run client side? Because I tried that but it doesn't seem to work for me.

                Comment


                  Originally posted by Monokkel View Post

                  Hi there! The "Show Crosshairs" functionality is intentionally set up so that it does not find all tiles in range and then filter out the target units. Instead it just look at the tiles containing units, which requires a lot fewer calculations in almost all cases. This is the reason you have not been able to find any bool or function to switch off such a filter.
                  ......
                  Yeah this worked, thanks! Also had to add LocalCurrentUnit->!bHasUnitActedThisTurn before removing crosshairs and tiles in sight range because it was removing all attack tiles after moving.

                  https://puu.sh/xUDJ6/890358d46e.png
                  Marketplace Asset - Economy Kit; Marketplace Asset - Notification Kit; Marketplace Asset - Achievepedia; Marketplace Asset - Player Stats Kit; Marketplace Asset - Photomode;
                  Marketplace Asset - Interaction Kit; Marketplace Asset - Turret Kit; Marketplace Asset - Character Stats Kit; Marketplace Asset - Smooth Camera Kit; Plugin - Toggl Plugin;
                  Hire us here; Panda Studios, Game development company.; Official Unreal Engine Game Jam Sponsor

                  Comment


                    Originally posted by DeniksDD View Post
                    Monokkel when are you release multiplayer version? I'm waiting already 6 months
                    Sorry about the amount of time it has taken. I've explained the delay in several posts before, but the short version is that I am, as I've acknowledged before, really bad at assessing how long it takes to add new features. In this case, I've done a major refactoring of most parts of the toolkit, and the interdependence of all features has made it a bit of a nightmare in terms of ensuring compatibility and preventing bugs. This, in combination with a long summer vacation and several deadlines at work has made it take more time than planned. Though when you see all the changes that have been made in this update compared to any previous one, I hope you'll come to understand why it has been so time consuming. The good news is that I'm close to the target now. It should onlt be a matter of weeks until I'm done.

                    Originally posted by Bridgeburners View Post

                    Thanks for the response.

                    To your suggestion, that's basically what I'm doing. (Not exactly, but the main idea is the same.) I make a small array of only the locations (as FTransform objects) which are calculated server side, and that small array gets passed to the client successfully. So telling the client where to spawn the ISMs is no problem for me. However I haven't been able to assign values to the ISMs on the client side (i.e. tell the client that these objects are big blue squares), so when it comes time to actually place them where I need them on the client side, TileInMoveRangeMC is just an empty object. Is it correct for me to say that (at least in your currently released build) this process is done in the collapsed graph at the end of the "Activate Grid Manager" function? If so, should I have that graph run client side? Because I tried that but it doesn't seem to work for me.
                    Oh, sorry. I should have understood this from your previous post. What I've done is to connect the Add Mesh Components collapsed node in BP_GridManager to an unreplicated event, and I call this event from the player controller, causing the meshes to be tied to the client owning the player controller.

                    Originally posted by Panda Studios View Post

                    Yeah this worked, thanks! Also had to add LocalCurrentUnit->!bHasUnitActedThisTurn before removing crosshairs and tiles in sight range because it was removing all attack tiles after moving.

                    https://puu.sh/xUDJ6/890358d46e.png
                    Glad it worked!
                    Advanced Turn Based Tile Toolkit (Marketplace - Support)

                    Dungeon Crawler Toolkit (Marketplace - Support)

                    Discord

                    Comment


                      Originally posted by Monokkel View Post
                      @Zandothar: Hey an welcome You first question...
                      Thanks a ton for your help. I should have figured the answers were already there, so I'm sorry I didn't thoroughly search for them before asking.

                      Comment


                        Originally posted by Monokkel View Post

                        Oh, sorry. I should have understood this from your previous post. What I've done is to connect the Add Mesh Components collapsed node in BP_GridManager to an unreplicated event, and I call this event from the player controller, causing the meshes to be tied to the client owning the player controller.
                        Thanks, that's so simple! I'm such an idiot, I forgot that this event runs only once, at the beginning. So calling it that way couldn't possibly do it for all clients. It's one really simple dumb thing I overlooked that caused such a hassle for me.

                        Comment


                          Originally posted by Zandothar View Post

                          Thanks a ton for your help. I should have figured the answers were already there, so I'm sorry I didn't thoroughly search for them before asking.
                          Don't sweat it. This thread is what, 109 pages? :P If I ever find the time I really should make a FAQ

                          Originally posted by Bridgeburners View Post

                          Thanks, that's so simple! I'm such an idiot, I forgot that this event runs only once, at the beginning. So calling it that way couldn't possibly do it for all clients. It's one really simple dumb thing I overlooked that caused such a hassle for me.
                          Well, if you are an idiot then so am I. Took me a long time to figure out that one myself. Many of these networking things only seem simple in retrospect, I feel.
                          Advanced Turn Based Tile Toolkit (Marketplace - Support)

                          Dungeon Crawler Toolkit (Marketplace - Support)

                          Discord

                          Comment


                            Hey, after looking through the blueprints for a while I just can't figure out the solution to the problem myself.

                            Currently the pathfinding algorithm counts moving across a tile diagonally as the same distance as moving across a tile from one end to the other (I assume they both use 1 unit of range). The result is that the movement range looks like a big square, when it should look more circular in the real world. Is there any way to set the movement cost of moving diagonally to be higher than that of moving straight over a square (obviously the diagonal should cost sqrt(2) range) so that the movement range looks more natrual?

                            Comment


                              @QueSeraDilla: Hi there. The easiest way to achieve this effect is to increase the movement cost of everything by a factor of 10. That way, straight movement can cost 10 while diagonal costs 14. To do this, go to the GenerateGameplayGrids function in BP_GridManager and change the values as follows:



                              This will result in the following pathfinding (after increasing the move, max move and search range variables of the unit ten times):



                              I hope that is the result you're after
                              Advanced Turn Based Tile Toolkit (Marketplace - Support)

                              Dungeon Crawler Toolkit (Marketplace - Support)

                              Discord

                              Comment


                                Monokkel Yes, that's perfect! Thanks for that.

                                EDIT: I found the appropriate function. Awesome stuff, thanks! Looking forward to the multiplayer update.
                                Last edited by Mr_Teeth; 10-11-2017, 10:24 PM.

                                Comment

                                Working...
                                X