First I apologize for taking so long to reply. I've been travelling for the last couple of days, but now I've got access to hotel WiFi and should be able to respond more quickly.
Hi cooleyo, that might be something several people might be interested in, so I’ll consider making a tutorial about it. I won’t be able to until I’m back home again, though. Here is my first idea on how to achieve this, though.
I’d first create a new actor type called weapon, which has a weapon mesh and variables for whatever attributes are tied to the weapon (a bool for damage, an integer for range etc.). Then I’d add this actor as a component to Unit_Parent and create various child actors for separate weapons. When the unit pick up a weapon I would change the unit’s weapon component to whatever weapon it is picking up. I’d then change the inputs in the various blueprints that get their input from stats such as range and damage to instead get the input from the variables stored within the unit’s current weapon.
That should cover everything except for animation. Animation is not my strong suit, so there might be many ways to do this. If there is some way to simply swap out the various animations in the animation graphs based on the value of the weapon variable , then this would probably be the best idea. If not, one could make a more complex animation graphs that checks this value at the first branch entered in the graph, and branch off into different sub-graphs dependent on the weapon. I can’t look into this without my home computer, so let me know if you test this out and find a better solution.
By default the current pawn is set in ATBTT_GameMode to whatever unit is currently on index 0 in the Initiative Order Array. When a unit ends its turn a custom event (the name escapes me) is called in ATBTT_GameMode that among other things runs the function “make the first pawn in initiative become the last” (I was a bit biblical in naming this one :P ). This sets the previous pawn at the last index of Initiative Order Array and shuffles the array so that every unit is one index higher (the one that was 1 becomes 0, since 0 is now empty etc.).
For jumping to the AI’s turn, provided you still want the AI and player to have separate distinct turns, I would run this function on a while loop multiple times until the unit at index 0 has a faction variable of AI. I would put this at roughly the same place as the regular function is in the game mode now. I’d create a new variable called “Skip until AI unit found” or something that can be set from whatever place the player has the option to select this input. I’d create a branch on this variable in the game mode, and if true it should go to the while loop and if not use the regular, single “make the first pawn…” function.
Thanks for the input! I agree that turn based games without random probabilities can be really good. The Banner Saga is an excellent example of this. I think games with random probabilities can be just as good, however, but it is something that has to be carefully though about and must mesh with the rest of the gameplay. For instance, I think the randomness in XCOM makes the game better, as many of the game’s most engaging moments happen when you suddenly make that lucky shot that gets you out of a seemingly impossible situation, or a sneaky alien suddenly manages to taker out your only sniper, forcing you to rethink your tactics. I think randomness can too easily be used as a crutch for gameplay that is not properly balanced, though, and think more TBS games should consider not using random number generators for things like accuracy.
However, for my game example I intend to include randomness as the current toolkit does not use randomness at all, and as such I can show users how to set this up. It should be easier for users to remove the random systems from the example than it would be to add their own.
Incidentally setting up flanking and range to impact damage is pretty easy. For range, when inputting damage you could check the value of the range array for the index the target is standing on and reduce the damage depending on this. For flanking you could find units in a certain range of the target and if they are at certain positions (for instance if there are at least two enemy units within this range, where one has a Y or X coordinate higher than the target, while the other has one lower) you could increase damage.
I’ll probably add it in. It should, like I said, be fairly easy to add. The reason I haven’t added anything like this to the default toolkit is that I don’t want it cluttered with lots of if-statements for things that won’t be in many games. For game examples I have no such scruples, though
Originally posted by cooleyo
View Post
I’d first create a new actor type called weapon, which has a weapon mesh and variables for whatever attributes are tied to the weapon (a bool for damage, an integer for range etc.). Then I’d add this actor as a component to Unit_Parent and create various child actors for separate weapons. When the unit pick up a weapon I would change the unit’s weapon component to whatever weapon it is picking up. I’d then change the inputs in the various blueprints that get their input from stats such as range and damage to instead get the input from the variables stored within the unit’s current weapon.
That should cover everything except for animation. Animation is not my strong suit, so there might be many ways to do this. If there is some way to simply swap out the various animations in the animation graphs based on the value of the weapon variable , then this would probably be the best idea. If not, one could make a more complex animation graphs that checks this value at the first branch entered in the graph, and branch off into different sub-graphs dependent on the weapon. I can’t look into this without my home computer, so let me know if you test this out and find a better solution.
Originally posted by Imonin
View Post
For jumping to the AI’s turn, provided you still want the AI and player to have separate distinct turns, I would run this function on a while loop multiple times until the unit at index 0 has a faction variable of AI. I would put this at roughly the same place as the regular function is in the game mode now. I’d create a new variable called “Skip until AI unit found” or something that can be set from whatever place the player has the option to select this input. I’d create a branch on this variable in the game mode, and if true it should go to the while loop and if not use the regular, single “make the first pawn…” function.
Originally posted by Wizard1200
View Post
However, for my game example I intend to include randomness as the current toolkit does not use randomness at all, and as such I can show users how to set this up. It should be easier for users to remove the random systems from the example than it would be to add their own.
Incidentally setting up flanking and range to impact damage is pretty easy. For range, when inputting damage you could check the value of the range array for the index the target is standing on and reduce the damage depending on this. For flanking you could find units in a certain range of the target and if they are at certain positions (for instance if there are at least two enemy units within this range, where one has a Y or X coordinate higher than the target, while the other has one lower) you could increase damage.
Originally posted by Wisdom-HELLy
View Post

Comment