Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

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

    Originally posted by Curiosichi View Post
    Might I suggest:

    Right now pawns are placed on the grid in the editor ahead of game time, with their skills chosen from a public editor variable drop down list. Simple, static, and handy, right?

    Soon as I got deeper into working on my game did I realize that these skills and player stats need to persist to the next battle, and the static placement and selection of stats doesn't work for that, so characters needed to load from a data file.

    Perhaps you might consider loading the characters/pawns and all their stats, placement locations, and skills from an start up struct file, and placing them dynamically on the grid at game (grid manager init) start.

    Thoughts?
    Thanks for the suggestion! For games that includes character advancement of persistent characters between levels, some sort of solution similar to what you have mentioned will need to be implemented. I would want to add something like that in addition to and not as a replacement to the current solution. ATBTT's built-in drag and drop placement is very easy to work with and is suitable for many sorts of TBS games, so I'll always want to keep that as the default. The Spawn Unit function is included to easily add units dynamically during gameplay, but it will always create a default unit of the class selected, so it is not sufficient for persistent units with changing abilities and attributes. The best solution for persistent units is something I believe is pretty genre dependent, so if I add this in the future I think I would want to do so in a game example. For my next game example I would like to make something similar to a tabletop rpg like D&D, and for this I'd want to add some sort of database solution for tracking character advancement. I won't be adding this in the next update, but somewhere further down the line.
    The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

    Comment


      Few more ideas for ya:

      So I had to add a Boolean on Spawn Unit() of Grid Manager, as right now it adds unit to the initiative by default. Adding the boolean allows you to avoid adding it by default.

      Click image for larger version

Name:	Spawn Unit.png
Views:	1
Size:	161.9 KB
ID:	1130581

      Also, I added a "Load All Player Units" function call to Grid Manager, and call it from Game Manager right before the "Sort Pawns In Initiative Order()". The "Load all Players()" loads characters or creates based on a save slot, and Spawn Unit()s each unit.

      Click image for larger version

Name:	load characters.png
Views:	1
Size:	198.4 KB
ID:	1130582

      Click image for larger version

Name:	Init Character.png
Views:	1
Size:	305.5 KB
ID:	1130584

      Init Character () is a helper class I made to make setting all variables much much easier. It also sets up the unit references at the start.

      Click image for larger version

Name:	game mode.png
Views:	1
Size:	194.8 KB
ID:	1130583

      And now, my game board has no player units places in the editor; they are all loaded dynamically. The Sort Pawn In Initiative Order() call right after Load All Player Units() then adds all the editor Pawns AND the dynamically created one to the Initiative order at this time. If the character had data in the save slot to load, than all the inputs are mapped to the Init Character() instead of the defaults or manually set variables (not shown in photo).

      The next goal is to kinda figure out a better way to place them. By Index could work I figured out, but I need a helper class of some sort to figure out what index a particular square is IN EDITOR.

      You got any ideas for that? Setting by location kinda works, that is just super lame as I have to create an object in editor to drag around and then copy the coordinates that way. Maybe there is a way to create an editor object that displays Index is possible?

      Bonus question!

      How are you saving Arrays of Arrays? Array of Pawns with an Array of Skills. If you are implementing multiplayer you are using gamestate I assume and that you require the use of that right? My guess is moving to an set of Boolean values for knowing a skill or not. Any other ideas?
      Last edited by Curiosichi; 07-03-2017, 09:49 PM.

      Comment


        Thanks for answering my questions earlier, just bought the toolkit. I'm trying to play around with using the grid in a map that is already compiled and I'm using the Simple Office demo level for this. I'm using a grid that is larger than the intended playing area and was planning on walling off the outside of the map with the invisible wall pieces. I'm finding that the pawns can't move when inside the level even though I don't have the invisible walls setup yet.

        https://media.giphy.com/media/xUOrw4...SYaQ/giphy.gif

        Is there a way to get the grid to ignore the collision of anything that isn't the intended invisible wall pieces or am I just doing something completely wrong collision wise here? Also I do believe collision is active for all of the meshes in place but turning them off seems to change nothing.

        How do I get the pawns to move inside the level?
        Last edited by OperatorCrux; 07-04-2017, 10:38 AM.

        Comment


          [MENTION=422736]Curiosichi[/MENTION]: Thanks for your suggestions and showing me your own solution

          Spawning the units early on before Sort Units in Initiative makes sense. Your functions for adding the units seems a bit cumbersome, however. If you have to specify all attributes and the location of each unit manually I don't really see the benefit compared to placing the actors directly in the viewport. At the very least I would create a sub-function that you could loop through using a custom struct array containing all relevant variables. That way it would extend to any number of units. Other than that it is hard to provide input when I'm uncertain of the goal you wish to achieve.

          If I did something like XCOM, for instance, I would probably store each character in a custom struct array in the game instance, or possibly use a data table. The attributes would in this case be created by a combination of base stats, random variation and player input. If you tell me your goal I can provide better suggestions for a good way of solving it.

          As for figuring out which index a particular square is, you can check Precalculate Gameplay Grids and then check Show Tile Indexes. Note that if you make any changes to the map that would affect pathfinding after this point you need to re-check Precalculate Gameplay Grids.

          As for arrays of arrays, the easiest way is to make a custom struct that contains an array and then make an array of these structs.

          [MENTION=802561]OperatorCrux[/MENTION]: To be honest I have no idea what is going on here... When the path is displayed pathfinding seems to work fine for the tiles inside the walls, so the grid setup is not affected. I think the only explanation is that the trace under the mouse pointer is being blocked somehow, but you say that removing collision from all the other meshes did not work, so that is odd. I would try one more time to be sure. Check through the scene outliner and make sure that collision is disabled for all meshes and volumes in the scene. You don't really need to disable all collision, just the one for PathTrace, but as a quick test just disable collision for them. Come ask me again if you're positive all collision is disabled (except for the Grid Manager, of course) and I'll think hard to find out what might be causing this.
          The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

          Comment


            Cumbersome in this use case, but it isn't actually ever used.

            My game creates all the character data before we get into game mode / grid manager, so when loading player units, it loads from the save file. In the picture I linked above, that is the false side of a branch checking for that save data. And in early development, I just load a few characters as if they were placed on the grid.

            Click image for larger version

Name:	units.png
Views:	1
Size:	437.2 KB
ID:	1130635

            So since I have to save each stat individually, I iterate over the arrays of the save file data and create the characters. Granted yes, the stats will likely be generated by the items the character has equipped, this is more just a proof of concept.

            I create Starter Tile objects that are placed in the grid manager, and use their locations to map starting locations for the loaded character units. I select, from the top of the saved character list, one by one to place on those tiles. For example, if I have 2 starting grid locations, I pull the top two character's save data and load them onto the map on those two tiles. In the same way, If I had N starting tiles, I select first N characters to place on those tiles. A simple Is Valid() check on the retrieved character data array avoids any problems trying to fill a character start tile with an invalid character.

            Do note, that Skills are still not saving since I have not remedied the array of arrays issue, but i'll look more into the structs. Or maybe i'll do a list of Boolean values for "know skill" for each skill in the game, and if they know the skill add it to their list of skills here.

            My desired result:

            game start
            Save character data if it doesn't exist
            Load desired battle map / game manager
            Load character data/skills/items
            place units on grid
            do the battle
            Battle end
            Save experience gains / new items acquired for all player units
            repeat


            I also need to keep in mind if I make/want multiplayer (which I will probably wait for your implementation) I will have to change both the save data with game state. I haven't researched it much yet.
            Last edited by Curiosichi; 07-05-2017, 04:30 PM.

            Comment


              [MENTION=422736]Curiosichi[/MENTION]: Ok, that seems a lot more reasonable. I'd really recommend you to look into structs, though. Not only can you easily make nested arrays, but you can also simplify your above function substantially by using an array of structs containing all unit attributes instead of having a separate attribute for each one. The game state is kind of like an extension of the game mode for variables that need to be replicated, such as a list of players etc. Useful in multiplayer, to be sure, but I don't think it is warranted for the spawning of units at the start of the game.
              The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

              Comment


                Originally posted by Monokkel View Post
                [MENTION=802561]OperatorCrux[/MENTION]: To be honest I have no idea what is going on here... When the path is displayed pathfinding seems to work fine for the tiles inside the walls, so the grid setup is not affected. I think the only explanation is that the trace under the mouse pointer is being blocked somehow, but you say that removing collision from all the other meshes did not work, so that is odd. I would try one more time to be sure. Check through the scene outliner and make sure that collision is disabled for all meshes and volumes in the scene. You don't really need to disable all collision, just the one for PathTrace, but as a quick test just disable collision for them. Come ask me again if you're positive all collision is disabled (except for the Grid Manager, of course) and I'll think hard to find out what might be causing this.
                Alright so I solved the problem! I had disabled collision for everything except the ceiling. So it turns out that the ceiling tiles were having some weird collision error because the collision box went lower than the mesh itself. Disabled the ceiling collision and it works perfectly now.

                Comment


                  Originally posted by OperatorCrux View Post
                  Alright so I solved the problem! I had disabled collision for everything except the ceiling. So it turns out that the ceiling tiles were having some weird collision error because the collision box went lower than the mesh itself. Disabled the ceiling collision and it works perfectly now.
                  Ok, good. That was the only possible cause I could think of, so I'm glad taking a second pass did the trick.
                  The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                  Comment


                    Originally posted by Curiosichi View Post
                    Or maybe i'll do a list of Boolean values for "know skill" for each skill in the game, and if they know the skill add it to their list of skills here.
                    Hey, this is the thing I'm thinking about now. Before you spawn the skill actor you need to know if your pawn has learned it or not. Obviously you can't do that based only on "learned" boolean or something like that in skill class. The most crude but the simplest way is to create a few booleans (one for each skill) in pawn class and this is fine enough if you have relatively small number of skills. But if you have (let's take Final Fantasy Tactics as an example) over a hundred of those skills? And if all booleans will be in the same function it will literally look like Tower of Babel. I'm sure there are more elegant ways but I'm still looking for them.
                    Last edited by ClaimedInfinity; 07-08-2017, 12:47 PM.

                    Comment


                      Well my thinking is if not Boolean, the current setup has each pawn spawning an actor and holding a reference, so whether its a Boolean or a skill reference, one way or anther there is going to be a huge list of skills. Unless I can think of a bit flag and corresponding map on a single variable, but I haven't had to think in binary and how that might work in Unreal yet.

                      Don't think it gets any smaller then a bit flag, but its still the same principle, maybe just less memory though.

                      Comment


                        Originally posted by ClaimedInfinity View Post
                        Hey, this is the thing I'm thinking about now. Before you spawn the skill actor you need to know if your pawn has learned it or not. Obviously you can't do that based only on "learned" boolean or something like that in skill class. The most crude but the simplest way is to create a few booleans (one for each skill) in pawn class and this is fine enough if you have relatively small number of skills. But if you have (let's take Final Fantasy Tactics as an example) over a hundred of those skills? And if all booleans will be in the same function it will literally look like Tower of Babel. I'm sure there are more elegant ways but I'm still looking for them.
                        Originally posted by Curiosichi View Post
                        Well my thinking is if not Boolean, the current setup has each pawn spawning an actor and holding a reference, so whether its a Boolean or a skill reference, one way or anther there is going to be a huge list of skills. Unless I can think of a bit flag and corresponding map on a single variable, but I haven't had to think in binary and how that might work in Unreal yet.

                        Don't think it gets any smaller then a bit flag, but its still the same principle, maybe just less memory though.
                        I'd probably go for a Set of skill class references. I highly doubt this would become a memory issue. There would have to be an extremely large number of skills per unit + stored units for that to be the case.
                        The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                        Comment


                          How are multi tile units coming ?

                          Comment


                            Originally posted by Selentic View Post
                            How are multi tile units coming ?
                            Haven't made any more progress on that progress specifically. As mentioned I've planned to split the next update into two so I can get it out faster. First I'll finish the update with everything but multi-tile units (networked multiplayer, major refactoring, transform-independent grids), as adding multi-tile units before this would just complicate making these changes later. I'm making great progress at that front, though, so in that sense I'm getting closer The next update is mostly feature-complete at this point, but there is still a long process remaining of testing, bug-fixing, structuring, commenting etc. Summer holidays is also going to slow down my progress the next few weeks, but I'm putting a lot of my free time towards getting it done in a timely fashion.
                            The Advanced Turn Based Tile Toolkit (Marketplace page - Feedback thread)

                            Comment


                              Originally posted by Monokkel View Post
                              Haven't made any more progress on that progress specifically. As mentioned I've planned to split the next update into two so I can get it out faster. First I'll finish the update with everything but multi-tile units (networked multiplayer, major refactoring, transform-independent grids), as adding multi-tile units before this would just complicate making these changes later. I'm making great progress at that front, though, so in that sense I'm getting closer The next update is mostly feature-complete at this point, but there is still a long process remaining of testing, bug-fixing, structuring, commenting etc. Summer holidays is also going to slow down my progress the next few weeks, but I'm putting a lot of my free time towards getting it done in a timely fashion.
                              Neato. Really looking forward to it.

                              Comment


                                Hey,

                                Currently attempting to get the units to spawn dynamically, however the pack doesn't seem to like that as I get dozens of accessed none errors if there are no units on the grid when it starts(most likely the custom unit spawns is getting called after the other begin plays already initiated), however there never is a certainty of which items will spawn as it's generated from another level(how and why is not relevant).

                                Are there events I need to delay until after I spawned the units myself? If so, could you point me to which ones I need to callback after spawning the units? PC/Pawn/GM/Etc? I can callback all of them but to avoid breaking anything I find it safer to just ask.

                                Currently just calling back the gamemode and it seems to work.
                                Last edited by CelestialCel; 07-10-2017, 07:07 AM.
                                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

                                Working...
                                X