Hello! I had question about using 2D sprites with the ‘Advanced’ portion of the turn based tool kit.
You see, I’m trying to create a game like Final Fantasy Tactics, and I wanted to emulate the art style while retaining the 3D gameplay (complete with extra abilities and such)
I have seen the 2D portion of the toolkit, and while its mindblowing, I don’t think I can create the game I’d like with it. To be sure, here’s an image of what I’m trying to do:
It plays exactly like your toolkit, but uses 2D images instead.
Does anybody know how I could implement 2D sprites with the 3D version of your toolkit?
@LuckyDuck12 I don’t know how to achieve this, but if you really want 2D graphics for the characters, I would imagine they would be planes with the sprite animation textures, that would always be looking straight at the camera, no matter the rotation. So, I would A) look up Unreal’s 2D tools, and B) work this rotation functionality for my sprites to always rotate to face the camera.
It is no more difficult than having the interface event tied to a branch that checks if a bCanCounterAttack variable is true or not. I don’t think you would gain much by having status effects, unless you want to turn on and off counter attack capability for the same unit during a game as well as modify the effect on turn start or turn end.
You’re welcome
To take the BeginActorTurn event as an example I’m preventing the toolkit from activating a nonexistent actor, as this could lead to some weird behavior. There validity checks are done in some cases where I always expect it to be valid. If it fails it will now do so in a way that is less confusing when I’m debugging. Ideally I should connect the invalid output to a print node to make the developer aware of exactly what failed. I do this in some instances, but I’ve missed a few spots. Some are remnants of bug-testing that should perhaps have been removed.
Like said, you can just place a sprite or flipbook component on your unit and it should work fine. If you have a game with a set camera than cannot rotate you can just have them face in that direction to begin with and refrain from rotating them during movement. If you have camera rotation you can rotate them to face the camera on tick. Here is the first AnswerHub thread I found on how to do this.
Hello Dr. , First off congrats on the completion of your phd. that is a lot of hard work you have done in the past few years doing that and keeping up with this. Again it looks like I have some new vids to look at and updates to check out, thank you for those.
I have been thinking about level steaming and figuring it may be difficult, any thoughts on this ?
Also, I have been testing out the imposter system from Fortnite, managed to double the frame rate of the example map(Hex) so that made me happy. I see on you trello you might be working on a procedural map system, I have found something I am trying to implement here… Map Generator 2.0 - Please Critique! - Blueprint - Epic Developer Community Forums
I will let you know how that works out, but it might take some time…
So then, if the unit is going to have a public boolean that specifies whether this single entity can do the effect or not, do you not agree the BPI_CounterAttack serves no purpose anymore and could be taken out of the equation? After all, the branch will just check if the boolean within the unit is true or not, and the entire exchange will be communicated between the ability’s ExecuteAbility() and the unit’s TakeDamage() - I see no need to add in a BPI, no?
If I am understanding you correctly, you don’t deny that if those validity checks end up as false, they really can freeze the game, right? I was under the assumption that this could happen and the game would flow normally.
It just so happens to be that you have already accounted for all possible failure scenarios, or at least to the best of your knowledge, so all those validity checks are there mostly as a debug tool for us.
Well, partly. If you add the interface to BP_Unit you can just use a regular event or function. However, if you make these additions to a child actor such as BP_Unit_Anim in order to keep BP_Unit simple, using an interface means you do not have to cast to that unit. This could become cumbersome if you have many different types of unit classes. Casting is also a slow operation and creates dependencies, though that is unlikely to have any significant impact.
Yes, they are basically there for debugging, as they should never return false in a regular game.
I see the light now. Thanks , and thx for the comment about casting too - since I don’t have much of a background programming in Unreal, general guidelines like that is always useful to keep in mind. I believe I should’t need to cast for this, but I will first try and experiment with this new info before rambling more here.
Thanks, and hope you’ll find the updates to your liking. I also hope to make some more tutorial videos soon.
Level streaming of the grid data iteslf could be a bit tricky, but level streaming of how the grid is visualized should be possible using regular level streaming techniques.
That sounds very interesting. Have not looked into that myself. Did you follow any particular guide for implementation?
Ah, you found Zeustiak’s old thread. Me and him chatted a lot and exchanged tips when I first got started with UE4. He did some really impressive work with world generation.
Happy to help I can highly recommend this recent talk on blueprints that was done at Unreal Fest Europe by Sjoerd de Jong. It explains the problems with casting among a lot of other things.
Thanks for your reply, I am reconsidering level steaming, I am testing a hex map with a 400x400 grid with 150 units(all static meshes) and 2 factions using imposters and not seeing any problems. I am gonna try increasing grid size, units and factions this weekend.
I need an urgent help with this plugin.
I’m scripting position damage bonuses (+x% from side/back attack) and it works perfectly when I attack AI as a player (co I move mu unit close to player, calculate angle to determine if is it side or back attack and after that I use attack ability).
The problem is with AI - AI is using Attack Ability before his move will end and it breaks my calculations. Where can I script AI to wait with attack ability until move will end?
Ah, too bad it is a plugin. Then I cannot include it in the toolkit. Lets hope they make it a part of the main branch at some point. Thanks a lot for the links, though. Interesting reading.
Yeah, it is too bad he didn’t finish it. I tried to encourage him to release it to the marketplace, but he was worried he’d spend too much time providing support instead of working on his own game.
Thanks for sharing, I could really use some more of this stuff. I’m just missing half of Part 2 now which I’ll finish later today.
So I think I got the counterattack fully working now. No BPIs needed, no casting done.
Like I mentioned, I’m simply using boolean inputs and outputs to decide whether there should be counterattack damage or not, based on a public boolean I created inside BP_Unit’s TakeDamage():
(While I’m at it, I might as well ask: in the example map, I notice that normal attacks always go to the False scenario of the lower branch, because AutoAnimate is false. In which cases would TakeDamage() want to go the True route, and call the Hurt QueueAction?)
…And then in ExecuteAbility(), if this HasCounterAttack returns as true, simply Take Damage again (after doing the necessary checks):
Does this look sufficently efficient in your eyes ?
Also, is it just me or did the timestamp comments in some videos of yours disappear? I was checking those vids again to refresh on some stuff when I noticed it. I mean, if you deleted those for whatever reason, I’m all ears.
Lastly, I only now realized that whenever I modify parent blueprints, child blueprints will understandably be now treated as modified files that need saving. So I tried saving the parent and not the child blueprint to see what occurred, and upon reopening the engine, I noticed that all the changes I made in the parent blueprint are seemingly correctly inherited by the child BPs. Do you know if we’re screwing up anything in particular if we do not save child blueprints in these situations, or do you know if they can safely be ignored? Obviously for safety’s sake I might as well always save, but I’m wondering if there’s more to it than meets the eye.
Both parts are great. I learned quite a few things myself despite having worked with blueprints for a long time.
Seems very reasonable. The whole idea of having both an interface and a boolean was a bit much, I agree. This is clean and should work fine. If sometime in the future you have many different kinds of units with different counter attack behavior, an interface would make sense, but if this is not the case yours is the cleaner solution.
I certainly did not remove them. Maybe YouTube incorrectly marked them as spam or something? I’ll take a look and see if I can identify what might have happened. Very annoying.
Edit: Nothing in my Held for Review or Likely Spam folders on YouTube. What specific videos are you not seeing your comments on? It will help me figure this out.
When you compile a parent blueprint, UE4 should automatically compile all child blueprints inhereting from it, which will mark them as having to be saved. You should not have to worry about anything breaking if you only compile and save the parent.
Yup, I dont see the timestamps in the Ability System 2 & Turn Manager video. If you cant recover it I will eventually redo those, and next time I suppose I’ll keep an offline copy of them :1
And, thanks for sharing your thoughts on the other points!
We make a topdown game with movement in realtime and turnbased combat using ATBTT. Currently I’m trying to achieve a seamless transition from the realtime world exploration to a fight situation.
I figured out there is the free roam mode but it seems like it only partially suits our case.
Using only Blueprints I couldn’t find a good way to switch between gamemodes, player controllers, states etc without loading another map - therefore I tried instancing the gridmanager and all components required for ATBTT whenever there is a fighting situation which resulted in chaos when starting a second fight.
What would be the best approach on switching between those two modes without loading another level?
I’ve been using your ATBT plugin for couple weeks now and I have to say that I really like it so far :). I was planning on adding buffs/effects that would last X amount of turns and was hoping that maybe the MindControl ability in advanced examples would put some light on this topic. However after debugging the blueprint I’m stuck at this point:
Could you explain where this “special” action is implemented and where does the “AI controlled” switch happen? Also what are your thoughts on buffs/effects that would last couple turns? I was planning on adding an ends_at:integer field to specific ability and then a notify/dispatcher from TurnManager to notify when the whole turn ends and run my update code then (on specific abilities). Would be nice to hear some feedback from you on this topic
I unfortunately cannot see them either… Perhaps some spam filter? Weird that it stayed up so long in that case. I even marked the comments as favorites.
Ok, great! Let me know if you run into any issues along the way.
Hey foqq. QueueAction is tied to an AnimateAction event that is called on whatever object is input in ExecutingObject. In this case it is the owning unit of the ability. This calls AnimateAction on the Unit, which in BP_Unit_Anim by default calls AnimateAction on the unit’s animation blueprint (as this is the default pin, as there are no “special” actions defined for this actor. In the animation blueprint it reaches a new switch which again does not have special defined, which causes it to run the default pin, which runs the shoot animation by default. Special is used here to make it simpler to implement a different animation for this skill (by adding such an option to the animation blueprint of the unit using the ability)
For a buff lasting a couple of turns you could use a status effect. This status effect could have code on activation that modifies whatever stat you want and more code on deactivation that subtracts whatever was added by the buff. To have it last multiple turns you could have a countdown integer that is decremented on the OnUnitTurnEnd interface event (which is automatically called for all status effects as part of unit deactivation). If this counter reaches zero you can then deactivate the status effect.
In other news the toolkit just reached 150 rating on the marketplace! Woohoo! Thanks to everyone for rating the toolkit. After Epic choosing to make assets free for a month I no longer have a chance to have the asset with the most ratings, but 150 is pretty great
Let me be the first to say congratulations, I still think THEE best purchase I have made on the market place.
Thanks for your hard work and dedication !
EDIT: Also wondering how hard would it be to add the fog of war from 2d map to a hex map ?
Ok, leo bar’s method didnot work out for us - we’re now trying to achieve it by spawning characters as children of BP_Unit_Anim on BeginPlay as mentioned by you @ - One question regarding the switch between realtime & turnbased came up now: How to cleanly pause the ATBTT system when combat has ended and the realtime movement begins?
Thanks a lot! Adding fog of war from the 2D example to another kind of map is mosly about how you want to render it. There are simple ways to do it, but not all might look good. For a 2D hex map you could simply place down hexagonal black HISMs in the same way I do in the 2D example. For a 3D map you would want to be more creative. I mean, placing grey 3D hex meshes all over the map would work, but would not look good. You might be able to have them all share a seamless material with a cloud effect or something like that. Or you could play around with lighting or a post-process effect to keep unrevealed tiles dark or greyed out. Fancy rendering stuff is not my forté, though, so these are just suggestions for where I would start experimenting.
As long as you never begin the turn of the next unit after ending the turn of a different one, turb-based combat will be paused for all intents and purposes.