I am trying to make an RPG. I'm still stuck conceptually on a lot of issues, though. My main issues are skill trees and combat in general.
Here is a list of some questions I have, if you can answer any of them, I would be most grateful.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#1: How do I create custom events? For example, let's say I want to organize my events by input, output, etc. It seems a bit sloppy to put everything in one place, so I was wondering if you can create custom, named events and trigger them through actions. It would look like this:
Then, you could have the same command multiple times, with different conditions, like so:
If "Sword_Swing_24" is triggered, and "Player" is within range of "Enemy", and "Block" animation of "Enemy" is currently playing, then change the animation of "Player" to "Sword Swing - Blocked"
And at the same time, you could have another command that says:
If "Sword_Swing_24" is triggered, and "Player" is within range of "Enemy", and "Block" animation of "Enemy" is not playing, then change the animation of "Player" to "Sword Swing - Strike"
Obviously there is no 'within range' command, but it's not very difficult to code that part and hopefully you get the idea. Instead of having each command include the "If user presses the J key", the events (such as receiving the input to swing the sword) would have their own names. This might take an extra event or so, but it will be much easier to understand and much cleaner if/when I might come back to the project at a later time.
PS: I have thought of keeping each of these 'commands' in their own event group, and activating/deactivating to use the command, but that seems extremely sloppy and will no doubt result in bugs down the road.
TL:DR - How do I trigger a custom, named action which activates an event?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#2: How do I handle buffs, debuffs, and skill trees? Let's say I have a buff that gives me a 5% critical chance increase, and one passive from my skill tree which gives all of my attacks a 3% damage bonus. The enemy I'm fighting has a buff that increases damage resistance by 10%, but a debuff applied by me that increases incoming damage by 6%.
Let's say I have a base chance of 20% to critically hit the enemy, and my critical hits deal 50% bonus damage. Let's say that the attack, by default, would deal 1000 damage. With the application of my 3% damage bonus (base * 1.03) it would be 1030 damage. Then the enemy has a buff that reduces incoming damage by 10%, so with that in mind my damage for that attack is now 927 (1030 * .9). The enemy does have a damage vulnerability of 6% though, so we have to take that into consideration too. That would be 982.62 (927 * 1.06) which I would probably end up rounding to 983, so let's just say 983. Then I have a 25% chance to critically hit, which would mean the damage would be 1474.5, rounding up to 1475 (983 * 1.5). Therefore, my attack has a 25% chance to deal 1475 damage, and a 75% chance to deal 983. That would make my average hit damage of that ability (assuming we care about this, which we might) 1106 damage ((1475 + 3*983)/4).
So my point is, and my question is, how do I handle that? I understand how to put that into a command, obviously. My question is, how do I think about this? How do I tell the program which buffs and debuffs the two entities (player and enemy) have? How do I take the passive bonuses granted by the chosen skill tree options, and factor that into the equation that deals damage?
One way I can think of is a giant equation that takes all of the buffs into account, but it only works for things like damage. For example, an attack deals: "base_damage * damage_buff1 * damage_buff5 * skill_tree_passive23" if the player has a buff, passive, etc, then the buff/passive number would be the decimal value of the percent, such as 1.01 for 1%, etc. This sorta works, but if the game has a bunch of buffs, debuffs, and skill tree passives, I can't simply have a five-thousand-character command that tests if every single buff is present or not. In the same way, I cannot have thousands of commands which each have a different equation depending on the thousands (if not millions) of different combinations the buffs could have. That doesn't seem like a reasonable solution.
Therefore, how would I solve this problem? Would I give each buff and passive a single command each, that if it is present, that it would add itself to the equation? Or perhaps, I would deal the damage in steps, first starting with the base damage, then running through every buff and debuff and modifying the damage until I had fully modified it and checked for all buffs and debuffs? Skill tree use is so common in games, I know there's a way to categorize and apply the different effects, I just can't figure it out myself.
TL:DR - How do I check for buffs, debuffs and skill tree passives on both the player and the target enemy, and apply them into an equation that calculates the damage the player deals to a targeted enemy?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#3: What combat systems would you recommend? What combat systems have already been created using this program, and are there any tips you can offer? First let me start out by saying that my game will be a multi-directional game. It will not be a platformer, it will use MMO-style on-screen button abilities, WASD keys to move, that sort of thing. However, I'm still not sure how the combat should work.
Some ideas I have entertained:
• Pokemon-ish, where encountering an enemy takes the player into a separate battle area. I have several reasons I don't think I want to choose this option though. First, if the system is designed like that, you could simply avoid the enemies unless they are invisible and random fight encounters, spread throughout the game. That's not really how I want it to work though. Another problem is, well, I haven't actually played any Pokemon games... that could be a problem. Nevertheless, I do recognize the combat system as a possibility.
• Turn-based, most likely that's pretty straightforward. The you take a turn, enemy takes a turn, etc. A great example of that system is Star Wars: Knights of the Old Republic (1 and 2). This system has some pretty serious drawbacks though, such as encounters with multiple enemies (which I strongly prefer to fighting a single enemy at a time). Also, the system is a slower type of combat, and (in my opinion) not quite as fun.
• Real-Time, where players and enemies still have internal attack limits (GCD, Global Cooldown), but can attack at any time the limit is not up (or the ability is not on cooldown). I would definitely prefer this system, but I still welcome any opinions. I favor this system because it easily allows combat with multiple enemies, it is fast-paced and requires the most skill (movement, positioning and timing, as opposed to simply an ability rotation).
TL:DR - What combat system would you recommend, and do you have any tips on how to implement it?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#4: How should I handle the ability usage in the combat of the game? This question assumes that the third option, real-time, is chosen from the previous question. I will most likely use that system, but I do like to hear other opinions and get some different ideas. So I'm thinking of a system that has a global cooldown (like mentioned above) which is pretty much a limit that triggers when most abilities are used, so that you can only attack once every so often. In the game I'm thinking of, the base GCD is 1.5 seconds, which seemed to work out pretty well. There's a stat that decreases the GCD, as well as the cast time of abilites, and the classes' resource regeneration rate. What I want to know is, how do I go about making a cooldown system? Right now, in my current status as a Fusion user, I would take a value (probably make an Active and use it's alterable value) and set it to some high number, then make an Always command which decreases that value by 1, and when the value reaches zero then the cooldown is finished... I know that's a very sloppy way to go about it and I'm sure there is a timer I could use which has milliseconds on it, allowing me to count down exact times. That's honestly the real question, here. It reminds me of the way Unreal Engine works, specifically Unreal Kismet (now known as the Blueprint Editor, I believe). The command system works in command 'blocks', essentially, which have either input nodes, output nodes, or both. So, if you had an event, that event could trigger an action, but also trigger a timer. After that timer finished, it would trigger another event. That's essentially what I need, a reliable timer, precise to the hundredth or thousandth of a second, which I can stop, reset, test for completion, etc.
TL:DR - Is there a timer object precise to the hundredth or thousandth of a second?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OVERALL TL:DR - Essentially I'm trying to make a single-player RPG game with many MMO elements in it. I have a decent understanding of Fusion (worked with it for about six or seven years, with only a week of official training at the very beginning from people I passed in knowledge in but a few weeks), so I have a general understanding of how to achieve the result I want, once I have a plan in place. The primary issue I find myself dealing with right now is how to think about the problem. What I'm struggling with right now is the concepts that solve the various problems I've encountered when designing the game. I'm confident that, once I understand the solution to the problem, I'll be able to implement it. If that isn't the case, I can always ask a specific question about it here. Right now I just need to understand the concepts that solve the problems. Any and all help is greatly appreciated