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

    Ok, well that is certainly a much bigger map than what I've had in mind when designing the toolkit. I don't think I've ever heard of a 12 square kilometer turn based strategy game before. I mean, you could always split it up into multiple adjacent levels, but since you want to have it seamless and presumably enable turn based combat in the border between two such maps this becomes more tricky.

    Ok, so I don't think I would generate the grid around each unit every time it moves, but you can probably generate a grid up to a certain distance around a unit when combat first starts. Since you probably want combat to happen on a large map this would very likely cause a very noticeable frame dip when it is generated. There are a few possible ways around this. The laziest is to have some sort of banner fly in with a "begin combat" text, generate the map while it is stationary and then fly it out again. Pretty hacky solution, though. Another is to spread grid generation over multiple ticks, possibly in an expanding circle around the active unit. You could either start combat once this had reached a certain size, or you could even have it continue slowly in the background to an even larger size. In any case you are now doing the sort of thing where you would benefit a lot from using C++ instead of blueprint. I would probably recommend rewriting the grid generation algorithm in C++ for this.
    Thank you so much for the feedback, it really helps and your ideas are good! :-) I know that my game needs are out of the normal, but I think it's just a case of non-traditional game idea = non-traditional development problems/challenges ;-)

    Thank you

    Comment


      Loving the pack so far, awesome job. I am working on a chess game, working on pathing onto enemies (and not through enemies/allies) and destroying them when pathed, then I have some more custom pathfinding to implement (have rook and bishop so far). Thinking into the future though, checking for checkmate/check conditions seems like it will be rough. Perhaps you have some ideas? I was thinking maybe every turn you simulate every pieces movement to determine if the king is in check, but I foresee it expanding very nastily.

      Comment


        Originally posted by Darthlatte View Post

        Thank you so much for the feedback, it really helps and your ideas are good! :-) I know that my game needs are out of the normal, but I think it's just a case of non-traditional game idea = non-traditional development problems/challenges ;-)

        Thank you
        No worries and best of luck! Remember to manage your scope, though. Having a too ambitious scope is the number one killer of game projects.

        Originally posted by NewRunDMC View Post
        Loving the pack so far, awesome job. I am working on a chess game, working on pathing onto enemies (and not through enemies/allies) and destroying them when pathed, then I have some more custom pathfinding to implement (have rook and bishop so far). Thinking into the future though, checking for checkmate/check conditions seems like it will be rough. Perhaps you have some ideas? I was thinking maybe every turn you simulate every pieces movement to determine if the king is in check, but I foresee it expanding very nastily.
        I'm glad to hear you're enjoying the kit If you simply want to make chess then I would advice that you scrap the built-in pathfinding entirely, since chess movement is so different from normal TBS movement. GetIndexesInRange is probably a good starting point for several types of chess movement. It returns an array of grid indexes surrounding a tile with a set range. If you loop through this and check each tile for some rules you can probably get pretty far. For instance, for a knight you could get indexes in range with a range of 2 and a minimum range of 1. Then you would discard all tiles where the X and Y distance are the same or zero.

        GetIndexesInRange with such rules should work well for the knight, pawn and king. The remaining pieces have movement that can have its range reduced due to blocking pieces, so it needs to work a bit differently. For these you would want to draw lines through the grid in various directions (diagonals for the bishop, for instance) and stop if it is blocked. Such loops should be fairly easy to set up, though let me know if you need help on this.

        I don't believe checking for check and check mate should be that difficult. Even an inefficient solution should not be too bad, since there are a limited number of pieces and a small grid. The same functions you make for your custom movement can be used to store what tiles are threatened. For pawns, knights and kings these would only have to be updated when these pieces move, though queens, bishops, and rooks would have to update their threatened tile whenever a piece has moved, though this would be a maximum of 10 pieces, so it would not be an issue, unless you want to make a great chess AI that tests multiple moves every millisecond.
        Advanced Turn Based Tile Toolkit (Marketplace - Support)

        Dungeon Crawler Toolkit (Marketplace - Support)

        Discord

        Comment


          Should the MP example be working out of the box or am I missing a step to get it working. I have a fresh 4.21 project. I Start the MP menu with 2 clients. Host on client 1 and join the game with client 2. Host seems to work normally, but client 2 has all units stacked in the corner and they do not seem to be replicated to the host. Client 2 also does not get any turns.

          I just want to see if there is an easy fix for this before I spent too much time digging around.

          Comment


            I was trying to trigger the "Follow Actor" event inside BP_GridCamera, so that it would always follow my pawn during realtime movement, but I must be misunderstanding something regarding the Actor input the function asks for...I'm inputting the default player-controlled pawn, yet the camera isn't moving at all (PrintFs tell me the function is being called correctly though...)

            Since I have no idea how to track when an event is being called upon, I tried manually searching through the TurnManager, Unit and Ability_Move BPs to see if they were calling FollowActor so that I could copy their setup, but I wasn't able to find it there!

            This is how I'm calling the BP_GridCamera from my player pawn (and also activating it as soon as the level starts). Is there something obvious I am missing?
            Click image for larger version  Name:	FollowActor.jpg Views:	2 Size:	105.6 KB ID:	1562675
            Last edited by Justo; 12-15-2018, 06:51 PM.
            Artstation | 3D Artist | Krakow

            Comment


              Originally posted by Xenomatic View Post
              Should the MP example be working out of the box or am I missing a step to get it working. I have a fresh 4.21 project. I Start the MP menu with 2 clients. Host on client 1 and join the game with client 2. Host seems to work normally, but client 2 has all units stacked in the corner and they do not seem to be replicated to the host. Client 2 also does not get any turns.

              I just want to see if there is an easy fix for this before I spent too much time digging around.
              Well, it did work out of the box last I checked, but I have made some minor changes since then. I might potentially have broken something by accident, though it should then hopefully be something minor that is easy to fix, since I have not made any real major changes since last I did a true networked multiplayer test. Just to be sure, this is something that happens when you play multiplayer through built projects, but does not happen when you play-in-editor with Number of Players > 1? Because Player in Editor at least seems to work perfectly on my end. I will try to find the time to test multiplayer properly soon.

              Originally posted by Justo View Post
              I was trying to trigger the "Follow Actor" event inside BP_GridCamera, so that it would always follow my pawn during realtime movement, but I must be misunderstanding something regarding the Actor input the function asks for...I'm inputting the default player-controlled pawn, yet the camera isn't moving at all (PrintFs tell me the function is being called correctly though...)

              Since I have no idea how to track when an event is being called upon, I tried manually searching through the TurnManager, Unit and Ability_Move BPs to see if they were calling FollowActor so that I could copy their setup, but I wasn't able to find it there!

              This is how I'm calling the BP_GridCamera from my player pawn (and also activating it as soon as the level starts). Is there something obvious I am missing?
              Click image for larger version Name:	FollowActor.jpg Views:	2 Size:	105.6 KB ID:	1562675
              I'm a bit confused on what is going on here. On tick you are targeting an array of all BP_GridCamera actors and asking them to follow themselves? Follow Actor is also not something that should be called every tick. It is an event that tells the grid camera what actor to follow, which is then handled by the FollowActorTick function, which is connected to BP_GridCamera's EventTick. It should be enough to call FollowActor once and the grid camera should then follow your character. Make sure that the actor in the actor input is the actor you want to follow and the target is the camera you want to do the following, not an array of all cameras.
              Advanced Turn Based Tile Toolkit (Marketplace - Support)

              Dungeon Crawler Toolkit (Marketplace - Support)

              Discord

              Comment


                Originally posted by Monokkel View Post

                Well, it did work out of the box last I checked, but I have made some minor changes since then. I might potentially have broken something by accident, though it should then hopefully be something minor that is easy to fix, since I have not made any real major changes since last I did a true networked multiplayer test. Just to be sure, this is something that happens when you play multiplayer through built projects, but does not happen when you play-in-editor with Number of Players > 1? Because Player in Editor at least seems to work perfectly on my end. I will try to find the time to test multiplayer properly soon.
                Thank you for taking a look. I have a few screenshots incase they might be helpful for diagnosing my problem.

                Click image for larger version  Name:	1.jpg Views:	1 Size:	37.8 KB ID:	1563080
                These are the options I used to launch. I am playing in editor.
                --

                Click image for larger version

Name:	2.jpg
Views:	52
Size:	77.2 KB
ID:	1563081

                This is the options chosen for hosting on Client 1. Connection is LAN, Level is example, and Max Players is 2.
                --

                Click image for larger version

Name:	3.jpg
Views:	45
Size:	95.1 KB
ID:	1563082
                On Client 2 I select LAN in the server browser and select Client 1 when it is found.
                --

                Click image for larger version

Name:	4.jpg
Views:	52
Size:	109.1 KB
ID:	1563083
                This is Client 1 after Client 2 enters the session. The units all behave normally.
                --

                Click image for larger version

Name:	5.jpg
Views:	52
Size:	124.0 KB
ID:	1563084

                This is Client 2 after it has entered the session. All enemy units and 1 player unit is stacked in the lower corner. None of the units can be interacted with. Additionally, if you move a unit on Client 1, the stacked unit on Client 2 begins it's run animation.
                --

                Click image for larger version

Name:	6.jpg
Views:	48
Size:	346.3 KB
ID:	1563085
                Lastly here is the error log.
                --

                Let me know if you have any ideas and I will post if I figure out a solution.
                Last edited by Xenomatic; 12-17-2018, 04:44 AM.

                Comment


                  Monokkel You are ABSOLUTELY right, now I got it working! Camera is following the pawn smoothly. I feelz less of an idiot now.
                  Artstation | 3D Artist | Krakow

                  Comment


                    Hello Knut, I absolutely love the toolkit! Thank you for the detailed videos they really help!

                    I'm designing a Tactical Card Game similar to Duelyst / Shardbound. While testing Multiplayer I encountered a weird bug and I was hoping you could help me solve it.

                    When using Faction 1 (Whichever Faction has the highest Initiative and goes first), the player can swap between allied units without any issue. However when using Faction 2 (The Faction that starts with the lower Initiative), the player can only select each allied unit once and is then forced to take an action with the current unit. After one unit has taken an action the other allied units can be selected and swapped without issue. And on turn 2, Faction 2 is forced to use the unit first selected before gaining access to the other allied units. I've tried several approaches but can't seem to find a solution.

                    I also created a fresh project with the toolkit to make sure this wasn't caused by me messing around with your blueprints. I recorded a video of the bug occurring in a fresh project. In the video the only thing I did was set up Multiplayer by changing players to 2 and assigning the enemy units to Default Player 1. Please Help. I'm sure there is an easy fix I am missing.

                    https://youtu.be/fMEePFfxEH8

                    Look forward to hearing back from you.
                    Thanks again.

                    Comment


                      Hey Monokkel,

                      Great toolkit!
                      What do you think about adding such map generator to your toolkit:
                      https://www.artstation.com/artwork/O2k3y
                      It seems to be free and could be really nice feature.
                      Last edited by Alderfly; 12-18-2018, 04:17 AM.

                      Comment


                        nirvana17 I'm no expert, but couldn't you create the map you want, then bring ATBTT to it easily? I would rather have more grid mechanics developed than ported free map creators, no? :B
                        Artstation | 3D Artist | Krakow

                        Comment


                          Originally posted by Xenomatic View Post

                          Thank you for taking a look. I have a few screenshots incase they might be helpful for diagnosing my problem.

                          Let me know if you have any ideas and I will post if I figure out a solution.
                          Thanks a lot for giving me the exact settings. I've tested it an figured out what the issue is.

                          The way the toolkit is currently set up, all players need to have joined a map before turn based combat starts properly The Turn Managers decides whether to wait for players or to start the match by checking if enough players have joined to fill all the separate values set in DefaultOwningPlayer of the units placed on the grid.

                          By default the example map has this set to 0 for all units, meaning that the game starts as soon as one player has joined. If another player then join later some values will be incorrect leading to some weird results.

                          So to get started set DefaultOwningPlayer of any of the units to 1 and try again. Things should be working now.

                          However, this is might not be the way you want things to work for your game. To create custom conditions for checking whether or not to start turn based combat, check BP_TurnManager and the NotifyPlayerReady event. Everything that follows the branch there that checks whether the current number of connected players equals the number of unit owners is the chain of events that starts turn based combat. Modify this condifion as you please.

                          Originally posted by Justo View Post
                          Monokkel You are ABSOLUTELY right, now I got it working! Camera is following the pawn smoothly. I feelz less of an idiot now.
                          Glad to hear that it works now

                          Originally posted by nirvana17 View Post
                          Hey Monokkel,

                          Great toolkit!
                          What do you think about adding such map generator to your toolkit:
                          https://www.artstation.com/artwork/O2k3y
                          It seems to be free and could be really nice feature.
                          Originally posted by Justo View Post
                          nirvana17 I'm no expert, but couldn't you create the map you want, then bring ATBTT to it easily? I would rather have more grid mechanics developed than ported free map creators, no? :B
                          That map creator looks amazing, nirvana17. Thanks a lot for making me aware of it. I might play around with it a bit if I get the time. Though as Justo said, the toolkit is set up in such a way that it can fairly easily be made to work with existing map generators such as this one. Use the automatic heightmap and walkability settings built into the grid manager and set meshes in your procedurally generated world to block PathTrace if they can be walked on and WallTrace if they should block movement and ATBTT should take care of the rest. I could make a map generator and it could be fun, but I feel there are other things I should be focusing on rather than reinventing the wheel when there are so many great random map generators out there already that can be made to work with ATBTT just fine.
                          Advanced Turn Based Tile Toolkit (Marketplace - Support)

                          Dungeon Crawler Toolkit (Marketplace - Support)

                          Discord

                          Comment


                            Hey its been a while!
                            Sorry if this has been asked before but do you have any functionality/ good ways to implement terrain info on tiles?
                            Forest/Desert/Mountains that kinda thing, for a World Map instead of a small combat map.

                            Thanks!

                            Comment


                              Originally posted by LDodds View Post
                              Hey its been a while!
                              Sorry if this has been asked before but do you have any functionality/ good ways to implement terrain info on tiles?
                              Forest/Desert/Mountains that kinda thing, for a World Map instead of a small combat map.

                              Thanks!
                              Hey, LDodds! Long time I would suggest making TMap of enums for that purpose, with Grid Indexes as keys and the enums as values.
                              Advanced Turn Based Tile Toolkit (Marketplace - Support)

                              Dungeon Crawler Toolkit (Marketplace - Support)

                              Discord

                              Comment


                                Would I be putting that in Grid Manager, Tile Parent or separate Grid Actors for each different terrain?

                                Comment

                                Working...
                                X