I’m thinking I’d love to figure out how to set up simple battle ‘math’ like a dungeon crawler or a Final Fantasy ( classic) game. Turn based stats that get randomized or damaged depending on hits. Am I explaining that right? Can I even do something like that in Blueprint? Is there anything you guys have seen online that starts to help me understand a setup like that? I’m more of an artist than a programer,but setting up rules like a digital D and D game , I have no idea where to even begin. Thanks for any comments or a , you’re insane go home, would be fine haha
Found this , not sure how i missed it
I think this is a good starting point , but yeah any info feel free to post
mhm, not sure if this is what I need,but great video so far
I’m not sure how what you linked in your 2nd post was related to the first one (also, you should just edit and add to your first post, you’ve bumped your post to the top twice in less than 30 minutes, that’s sort of faux pas as far as forum etiquette goes - but that’s neither here nor there.) So I’m going to ignore the video.
I’m assuming what you’re referring to as “battle math” are health/mana(whatever you wanna call it)/stamina etc and how they interact with skills in a turn based game.
I think you could create this in blueprints no problem. I’ll give you some ideas, but I’d like to also mention you posted this in Content Creation, you may get better traction/help if you post specific questions to the Blueprint subforum.
Anyway - first, the stats themselves - these are entirely up to you and you could copy or expand/trim down a system that you find interesting. Just store them as variables in your character class, integers/floats are probably fine (you could store things like: level, experience, health/life, mana/magic, stamina/endurance, charisma/charm, dexterity/agility - whatever.) This isn’t hard, you can look for how to store variables in blueprints - there’s tons of available material for it, just go through the blueprint videos provided by Epic and you can see how to do this part.
Next would be what I assume you’re referring to as the “battle math”, how do those things interact - well this is harder mostly because it depends on what you want to do and how you want your game to work. I’ve not made or tried to make a turn based game ever, I’m sure it’s possible in UE - but I’m going to skip the turn based part because I have no personal knowledge of it and don’t want to lead you in the wrong direction. Skills (like attacks) or spells, items, whatever - are just actions you’re going to create a blueprint for (most likely under your character blueprint, depending on how you create your enemies - you’ll probably want them there too.) Let’s just psuedo walk through a skill or a spell then.
When you build a blueprint for, lets just say a spell - fireball. You’re going to want to handle things such as the particle effects (I assume you’ll have a little fireball particle to show the spell took place). You could probably find a starting place in some of the assets Epic provides in their different examples (perhaps the cave demo, there’s fire there.) Moving it is easy, you will be selecting your target in a game ‘like’ Final Fantasy, so you would have your spell blueprint spawn the particle, and move it from the caster to the target, after that animation - you could trigger an onhit on the character that received it and use this to remove health/stamina whatever from the character that was hit (or apply status effects, like being on fire, or poisoned.) Casting the spell should also remove some mana from the character who casted it - against just a simple subtraction.
I know that’s vague, but it really really does depend on how you want to do it. You could make this so that a fireball costs 5 mana and does 5 damage, no matter what. You could set it up to have a base damage of 10 + (caster_level*2) + (caster_max_mana % 5), which would increase the damage based on the casters level and the maximum mana (not current mana) that they have. You could also incorporate resistances, say - (10 + (caster_level * 2)) * (target_magic_resist)). This is all up to you and how you want your game to play. They have their own benefits - the flat damage is nice sometimes because you know you’re always going to hit for X - I like formulas that incorporate more (such as increasing based on character level, skill level, spell level - modified by a corresponding stat, for spells maybe intelligence or wisdom) you could even have items/armor etc that applies it’s own additional affect (or increases another stat, like intelligence) - these typically deal consistent damage, but may vary even on targets of the same type based on their own specific stats. I’m not a fan of adding randomness to it - but I like competitive multiplayer games, RNG is the anti-thesis of competitive gaming in my opinion (that’s a different discussion for a different day), so I avoid including any randomness in combat stats. You could however have your damage be like, 15 + rnd(5,20) (base damage of 15 + a random number between 5 and 20), or you could do critical strikes (again I’m not a huge fan of things like this) where your damage is doubled (or modified by some other number) in the event of a critical hit.
If that’s what you’re going for - get an idea of exactly what you want - don’t be afraid to look at games you’ve enjoyed and see if you can find out the math behind them (lots of games may not advertise it openly, but chances are you can find places online that will lay it out much more plainly for you.) Maybe you want a very simple system, just health and mana and the only thing that affects health is spell damage and the only thing that affects mana is casting spells - fine, that’s simple - go for it. Perhaps you want a very complex system, where your skill level in athletics determines your max run speed, stamina decay rate, jump height etc and applies a modifier for your chance to hit or damage, and your skill level in magery directly affects not only your chance to successfully cast a spell but also your damage is amplified based on your skill and level. Maybe you want battlemages where the spells always cast (no failing) but are stronger if you aren’t hit/damaged/have to move during the cast. It’s all up to you.
Honestly, take the time to flesh out a starting point (I advise you to not build a super complex system on paper, start testing as soon as you have a basic idea and add to it and tweak from there), and if you are doing it in blueprints - ask specific questions on how to perform specific things in the Blueprint subforum.
Hope that helps, best of luck to you.
Thanks! That’s certainly some great info. Gives me a good place to start thinking this over. Appreciate the incite!