Indonesian Gentleman
Guest
|
Post by Indonesian Gentleman on May 11, 2018 4:37:24 GMT
So yeah, I'm trying to modify the combat system so instead of determining hit rate and damage from ATK and DEF stats, it goes a bit like this:
Each attack Ability have two stats (or attributes?) other than Damage and Range, which is ATKROLL and ATKRATING. Each Ability would have different values for these. When the Ability gets executed, it rolls ATKROLL amount of d10 dice, and the dice that rolls below ATKRATING 'hits' the target for the amount of Damage. If it rolls over ATKRATING, it misses. Now, I think this meant that the rolling system would change HitRate, and I've put the code there for now. I also wish to visualize the combat, showing which dice rolled what number.
So, what I'm having trouble with is how to implement these ideas, and if I'm doing it right. Currently I've modified: -HitRate: RollToHit into reading the ATKROLL and ATKRATING stats attached to an ability, and then using them to roll the combat system described above, and keeping the results in a public List<int> rollTracker and int successCount, to be passed on. -Ability and BaseAbilityEffect: added the rollTracker variable to be passed on. -CombatSequenceController: a new script that is supposed to act out the combat by showing the rolls being made and the results happening. Imagine it to be like Advance Wars' combat sequence but with the rolls being visible. Still a bit vague since I don't quite know what to do here yet, I might even have to make a new CombatSequenceState to occur after PerformAbilityTargetState.
I'm currently kinda confused on the implementation of the system above. Theoretically I can see it, but to express it in programming is a bit hard. Anyone willing to help me?
|
|
Indonesian Gentleman
Guest
|
Post by Indonesian Gentleman on May 11, 2018 4:43:28 GMT
Oh yeah, forgot to mention that I've also modified the StatTypes so they now have these instead: -RANK, (just a renamed Level with less gradations) -EXP, -SIGHT, (how far a Unit can see)
-HP, (health) -MHP, -AP, (armor point) -MAP,
-ACT, (action point, which will be consumed by an ability) -MACT,
-DMG, (damage) -RNG, (range) -ATKRATING, -ATKROLL, -AMMO, (instead of mana) -MAMMO,
-MOV, (movement in hexes/tiles)
-CTR, -Count
Thank you for the time reading this.
|
|
|
Post by Admin on May 11, 2018 22:06:32 GMT
How you choose to display the rolling of dice can vary quite a bit and I'm not sure what you have in mind. For example, you might want 3D dice bouncing around with physics and to show the simulated roll on top of the rest of the content. A simpler approach could should sprites (one per dice) that randomly change their image every frame (while simulating the 'roll') and then will stop on a sprite indicated by the number picked in your random number generator. Did you have a preferred approach in mind?
It sounds like you are on the right track implementation-wise. The Tactics RPG currently uses states to control the display and input of various screens. Inserting a new state or states to display the roll before applying it is a perfectly valid approach. I don't think that you need the ability itself to hold the list of dice rolls because I am not sure what value it would have outside of this state. From what I understand so far, I would make that list of dice rolls to be a local property on the state itself, or a local property of an attack system that the state would invoke. When the state enters I would look at the stat of the attacker to initialize the list with the right capacity, and then populate it with random numbers accordingly. The state/system would maintain that result long enough to display it to the user and perform any needed actions such as applying damage.
|
|
Indonesian Gentleman
Guest
|
Post by Indonesian Gentleman on May 14, 2018 7:50:56 GMT
Visuals would be 2D slot machine-type roll, I think I can implement it. The more serious problem is in the setting up of the system itself.
Currently the rolling system method is still in HitRate, so I should move it to the new state, yes? I intend for each Ability to have their own ATKROLL, ATKRATING, range and damage stats, so that a Unit could have, say, a gatling gun attack which has high ATKROLL but low ATKRATING (because it can shoot multiple bullets with dubious accuracy), and also a sniper rifle attack which has a single ATKROLL but high ATKRATING (because it shoots once and is quite precise). So, to do this, is my current method of attaching a Stat element on the Ability itself correct? Or should I do something else?
Thank you for your time.
|
|
|
Post by Admin on May 14, 2018 14:36:13 GMT
One thing that a lot of people miss is the idea of doing a prototype. Even in a professional setting things end up becoming "protoduction" projects. The tactics RPG is a second pass prototype for me. For you, especially as you change mechanics you should feel free to think of this as merely a first pass prototype. Don't worry too much about what you "should" do or what is "right" - just focus on getting it working and see what you can learn along the way. If any particular area feels too cumbersome then it should be approached differently later, but for now, just try to get it working and see if the idea is even fun or not.
With that said, I wouldn't put the "Stat" component on the weapons. My design intended them to be on the Unit. I had a separate component called a "StatModifierFeature" that would live on the weapon and which could update the stats of the owning Unit when the item would be equipped or unequipped. My reasoning is that the combat system is complex enough by itself with all the damage algorithms etc. I didn't want it to need to know how to parse a complex object hierarchy to know what all features of the game would modify a unit's stats. I wanted it to simply be able to grab the already known stats and work with them.
|
|
Indonesian Gentleman
Guest
|
Post by Indonesian Gentleman on Jul 12, 2018 5:30:53 GMT
It's been two months and I'm still stuck at rewriting this combat system, and it's driving me crazy. OK, forget about the visual implementation for a while. In the original tutorial, when an Ability can be performed, it applies the Ability Effect to the target(s). Ability Effect could be DamageAbilityEffect, HealAbilityEffect, EsunaAbilityEffect, etc. Ability determines if it hits or misses via HitRate, which compares the relevant stats from the target and ability user and determines hit or miss from that. Ability also determines how powerful an attack is via Ability Power, which affects how much damage/heal/effect happens on a hit. Ability also sometimes has AbilityMagicCost tacked on it, to determine how much MP is taken from the unit's MP pool. Now, what I wanted is: when an Ability can be performed, it determines hits and misses via a series of dice rolls that depends on the Ability's own AbilityRoll (how many dice thrown, and also how many times the ability is launched per single activation) and AbilityRating (the number that must be bypassed, determines if hit or miss). The amount of damage (or effect) done by the Ability depends on its own base damage stat, multiplied by the amount of passing rolls. Each ability may also have their own ammo count and cost per activation. So, what I currently have is having HitRate to do the rolls and record the roll results, and BaseAbilityEffect determine what to do with those rolls. But I think I have spaghettified the code too much and now I am very, very confused. Here is the project, please give it a once-over and tell me what I did wrong. I am growing desperate here. www.dropbox.com/s/veo56vvpw83l0mn/Hex%20Map%20Game%20Project.zip?dl=0
|
|
|
Post by Admin on Jul 12, 2018 15:20:19 GMT
I'd like to try and help, but my time is limited, so let's see if I can make it a little easier on myself. I tried downloading your project and didn't know what to do with it. I assumed I should start from the "battle" scene, but when I press play, I immediately get an "ArgumentOutOfRangeException" from the InitBattleState. I managed to overcome that problem by swapping the mapdata to a different one in your project, but that merely led to another error, which led to another error, and I am not sure how far the rabbit hole goes. These are all errors that dont appear to have anything to do with your question about the architecture of your combat system so I dont want to spend too much time on it.
So here is my request, can you get the project to a running state and then send that to me. Next, give me clear instructions about what scene to load, and how to get to the place where I should observe something happening related to your new combat stuff. Then tell me what you expect to see vs what actually happens so I have a better idea what needs fixing. Note that its ok if you just havent implemented the part that you need help on. Just let me know that you "get to such and such point, and I would like to see X but am not sure what to do" or something like that. Feel free to spend some time introducing me to your project and pointing out the names of the scripts that need attention. Also, just to verify, I will need this to work on a mac (probably not a problem, but could be depending on shaders etc).
I feel like you have already explained the goal of the combat architecture pretty well, and I think the original approach you said could work. I now understand that you are more concerned with architecture than you are with the visuals for now, so just let me know how you will measure the success of its implementation. In other words what will demonstrate that the code is working. Does that all make sense?
|
|
Indonesian Gentleman
Guest
|
Post by Indonesian Gentleman on Jul 13, 2018 3:47:07 GMT
ah yes, sorry, I just realized it still has plenty of holes in it. I haven't made jobs yet because of this ability issue, I will try though. I think what would help me currently is a diagram of how the original ability works, what links where and what got used during an activation of an ability. I think from there I can figure out what to modify, and create something resembling an experimental prototype I can tweak.
|
|