Jump to content
IGNORED

Damage...


Opry99er

Recommended Posts

Every game is a little different. Take, for example, the Vita MMORPG type game Sword Art Online, Hollow Fragment. (Guide is here.) There's a long winded discussion at the first URL linked about someone wanting to know how DPS Total, DMG, ATK and STR all factored into the game... for example:

 

"The axe esoteric skill has a (+STR180% & VIT180% & DEX100%) adjustment value, which is calculated as (+DMG10% & STR190% & VIT180% & DEX100%). In terms of damage increases for that esoteric skill, 1 STR = 1.05 VIT = 1.9 DEX = 19 DMG. If you are using an axe, weapon parameters to prioritise would be would be STR > VIT > DEX > DMG. When casting the esoteric skill, an axe with 100 DMG and 50 STR would deal the same damage as an axe with 1050 DMG and 0 STR."

 

So, mapping to skills and items is one thing - how many different assets are you going to have that will modify damage stats?

 

Some other things (just thinking out loud): You can even minimize damage by applying a divider if you have a "block" or "dodge" move. Also, take into account a "miss" being completely random, and causing 0 damage. You could miss swinging a weapon, or you can even miss dodging (which means you get whatever damage you were intended to anyway).

 

I can't wait to see your game! :)

 

 

 

Link to comment
Share on other sites

Here's a bare-bones tester (RANDOMIZED) to test out some of the formula ideas from Ksarul.... Seems to work really well. I played it 6 times, won 4 lost 2.

 

Thanks for the formula, Jim! I needed to tweak the variable values a little bit to create parity, but the equation works nicely! Paste into Classic99 and RUN to whack a skeleton with a tree branch!

 

 

 

 
100 RANDOMIZE
110 HEROHP=20 :: HEROMHP=20
120 HEROATK=5 :: HEROATKMOD=4
130 HERODEF=5 :: HERODEFMOD=2
140 SKHP=15
150 SKATK=5 :: SKATKMOD=4
160 SKDEF=3 :: SKDEFMOD=2
170 TURN=0
180 CALL CLEAR
190 DISPLAY AT(1,5):"BATTLE TEST";
200 DISPLAY AT(3,1):"HERO HP:";HEROHP;"/";HEROMHP
210 DISPLAY AT(4,1):"SKELETON HP:";SKHP
220 DISPLAY AT(10,1):" " :: DISPLAY AT(12,1):" "
230 IF TURN=1 THEN GOSUB 350
240 DISPLAY AT(6,1):"PRESS 1 TO ATTACK"
250 CALL KEY(0,K,S):: IF S=0 THEN GOTO 250
260 ON K-48 GOSUB 270
270 DISPLAY AT(10,1):"HERO ATTACKS!" :: DISPLAY AT(6,1):" " :: GOSUB 470
280 DAM=(INT(RND*HEROATK)+HEROATKMOD)-(INT(RND*SKDEF)+SKDEFMOD)
290 IF DAM<1 THEN DAM=0 :: DISPLAY AT(12,1):"MISS!" :: GOSUB 470
300 IF DAM>0 THEN DISPLAY AT(12,1):"DIRECT HIT!" :: GOSUB 470
310 SKHP=SKHP-DAM :: IF SKHP<1 THEN GOSUB 430
320 TURN=1
330 GOTO 200
340 RETURN
350 DISPLAY AT(10,1):"SKELETON ATTACKS!" :: GOSUB 470
360 DAM=(INT(RND*SKATK)+SKATKMOD)-(INT(RND*HERODEF)+HERODEFMOD)
370 IF DAM<1 THEN DAM=0 :: DISPLAY AT(12,1):"MISS!" :: GOSUB 470
380 IF DAM>0 THEN DISPLAY AT(12,1):"DIRECT HIT!" :: GOSUB 470
390 HEROHP=HEROHP-DAM :: IF HEROHP<1 THEN GOSUB 450
400 TURN=0
410 GOTO 200
420 RETURN
430 DISPLAY AT(20,1):"SKELETON IS DEAD!"
440 END
450 DISPLAY AT(20,1):"HERO IS DEAD!"
460 END
470 FOR I=1 TO 300 :: NEXT I
480 RETURN
Edited by Opry99er
Link to comment
Share on other sites

Got waxed, eh Rich? LOL!! Maybe youre not holding your tongue right or something, I dont know. :)

 

Ill give it another spin... But I did win 4 of 6 last night... Ill check to make sure I posted the most recent code (with updated DEF and ATK values)

 

Thanks for giving it a shot. :)

Link to comment
Share on other sites

Every game is a little different. Take, for example, the Vita MMORPG type game Sword Art Online, Hollow Fragment. (Guide is here.) There's a long winded discussion at the first URL linked about someone wanting to know how DPS Total, DMG, ATK and STR all factored into the game... for example:

 

"The axe esoteric skill has a (+STR180% & VIT180% & DEX100%) adjustment value, which is calculated as (+DMG10% & STR190% & VIT180% & DEX100%). In terms of damage increases for that esoteric skill, 1 STR = 1.05 VIT = 1.9 DEX = 19 DMG. If you are using an axe, weapon parameters to prioritise would be would be STR > VIT > DEX > DMG. When casting the esoteric skill, an axe with 100 DMG and 50 STR would deal the same damage as an axe with 1050 DMG and 0 STR."

 

So, mapping to skills and items is one thing - how many different assets are you going to have that will modify damage stats?

 

Some other things (just thinking out loud): You can even minimize damage by applying a divider if you have a "block" or "dodge" move. Also, take into account a "miss" being completely random, and causing 0 damage. You could miss swinging a weapon, or you can even miss dodging (which means you get whatever damage you were intended to anyway).

 

I can't wait to see your game! :)

 

 

 

 

I somehow missed this post, Jon! Thanks for posting that link... Some cool info there, for sure. :)

 

As far as the melee attacks in my own battle engine, really only focusing on the ATK value, the modifier(s) of that value (as I believe STR is simply a part of the ATK value as a whole and I really do not see any need for it in battle) and DEF and it's modifier(s).

 

Magic will be a little more detailed, by necessity... It is in this field I will be focusing a good chunk of my attention on study and research. MATK and MDEF are primaries, but Class and level will also come into play.

 

Elemental considerations will also be factored... If you are facing an Ice Golem and you cast FireSlash, you will do significant damage, because of the elemental differences. Conversely, IceBlast will do next to nothing.

 

Much of the elemental stuff will be tied into what is equipped to a specific party member... If you're facing a Flame Wraith and you have a FireShield equipped, damage from melee attacks from the Wraith will be significantly lessened.

 

 

There is still much reaearch and testing to do, but I feel I have a pretty good feel on what I am HOPING to accomplish. Will take work, time, study, coding, debugging, and a ton of testing and adjusting to get it where I want it. :)

 

Thanks for responding, bud.

Link to comment
Share on other sites

Looks like I WILL need some additional modifiers. LOL!! For class differentiation, I would like for stats to grow at differing levels.

 

It is easy to differentiate class at low levels, as I can just have different starting values which distinguish party members from one another... In this way, a Level 1 thief could have an ATK value if 1, and a Level 1 fighter could have an ATK value of 5. Good separation there. However, if both members increase levels simultaneously and their stats increase at the same rate, a Level 20 thief and a Level 20 fighter would have relatively identical ATK values when it comes to combat. Basically I am saying, without additional modifiers, the higher the level, the less the classes matter.

 

I do not want that.

 

I need to study some more, obviously... At LEAST I will need modifiers like STR, INT, and AGI. (INT more for the magic casting and defense in battle)

 

Ya know... It pays to study the wheel before trying to reinvent it. LOL!!

Link to comment
Share on other sites

The more I think about this, ATK and DEF should be derived variables...

 

Maybe, something like:

 

ATK=STR+VIT :: DEF=AGI+VIT

ATKMOD=WEAPVAL :: DEFMOD=ARMORVAL

 

Then...

 

DAM=(INT(RND*ATK)+ATKMOD)-(INT(RND*DEF)+DEFMOD)

 

In this way, the algorith stays the same, but the variables used can be modified properly with level gains..

 

FIGHTER LEVEL UP:

STR=STR+2 :: AGI=AGI+1 :: VIT=VIT+1

 

THIEF LEVEL UP:

STR=STR+1 :: AGI=AGI+2 :: VIT=VIT+1

 

This brings the question... Should VITality ALSO be derived? It can be modified based on condition (poisoned, burdoned, etc) but should it be derived in some regard from the difference between MAX HP and CURRENT HP?

 

For instance, if your party member has a max health of 40, but is beat up to sh** and has a current HP is 5, should VITality not decrease? This would make melee attacks while injured less effective... Seems realistic to me. :)

Link to comment
Share on other sites

Okay... In my insanity, I attempted to come up with a way to weight the character's physical "state" into the effectiveness (or lack thereof) of attack and defend. What resulted was a bloody mess.... I was able to get something to work, though... I had to drop the priority of that factor down quite a bit, but here's one way to make it work. Notice this code is slightly different than the last incarnation I posted. ATK and DEF are now "derived" variables, STRength, AGIlity, and VITality have been added. VIT is a derived variable, one which attempts to determine the character's physical state by dividing his HP by his MHP... Them multiplying by 5 to give a vitality rating. ( I initially multiplied by 10, but this was madness)... This is added to STR (for attack) and AGI (for defense)...

 

Notice that ATKMOD and DEFMOD have been replaced by more concrete values, WEPVAL (the +rating of the weapon equipped) and ARMVAL (the +rating of the armor equipped)..... It is a work-in-progress, but I think I'm at least getting SOMEWHERE in the melee portion of the battle sequence. Tweaking needs to occur, but if you play through this a few times, you will see that the power of the attacks and the effectiveness of the defense decrease as the player "weakens"... The farther the HP drops from the MHP, the more "tired" the character becomes.

 

If you want to REALLY see this in action, change the values in LINE 110 to "100" and "100" and change the value in LINE 180 to "100"... This will give both the hero and the skeleton much higher starting health points, letting the demo run a bit longer so you can observe the changes in effectiveness. This will not affect VITality, as it is simply a calculation of percentage of health... wouldn't matter if you changed the value to 1,000,000, the number would be the same.

 
100 RANDOMIZE

//REM STATS

110 HEROHP=30 :: HEROMHP=30
120 HEROSTR=4 :: HEROAGI=4
130 HEROVIT=(INT(HEROHP/HEROMHP)*5)
140 HEROATK=HEROSTR+HEROVIT
150 HERODEF=HEROAGI+HEROVIT
160 HEROWEPVAL=3
170 HEROARMVAL=2
180 SKHP=30
190 SKATK=6 :: SKWEPVAL=6
200 SKDEF=5 :: SKARMVAL=3
210 TURN=0

//REM START

220 CALL CLEAR
230 DISPLAY AT(1,5):"BATTLE TEST";
240 DISPLAY AT(3,1):"HERO HP:";HEROHP;"/";HEROMHP
250 DISPLAY AT(4,1):"SKELETON HP:";SKHP
260 DISPLAY AT(10,1):" " :: DISPLAY AT(12,1):" "
270 IF TURN=1 THEN GOSUB 390

//REM Hero Attack

280 DISPLAY AT(6,1):"PRESS 1 TO ATTACK"
290 CALL KEY(0,K,S):: IF S=0 THEN GOTO 290
300 ON K-48 GOSUB 310
310 DISPLAY AT(10,1):"HERO ATTACKS!" :: DISPLAY AT(6,1):" " :: GOSUB 510
320 DAM=(INT(RND*HEROATK)+HEROWEPVAL)-(INT(RND*SKDEF)+SKARMVAL)
330 IF DAM<1 THEN DAM=0 :: DISPLAY AT(12,1):"MISS!" :: GOSUB 510
340 IF DAM>0 THEN DISPLAY AT(12,1):"DIRECT HIT!" :: GOSUB 510
350 SKHP=SKHP-DAM :: IF SKHP<1 THEN GOSUB 470
360 TURN=1
370 GOTO 240
380 RETURN

//REM Skeleton Attack

390 DISPLAY AT(10,1):"SKELETON ATTACKS!" :: GOSUB 510
400 DAM=(INT(RND*SKATK)+SKWEPVAL)-(INT(RND*HERODEF)+HEROARMVAL)
410 IF DAM<1 THEN DAM=0 :: DISPLAY AT(12,1):"MISS!" :: GOSUB 510
420 IF DAM>0 THEN DISPLAY AT(12,1):"DIRECT HIT!" :: GOSUB 510
430 HEROHP=HEROHP-DAM :: IF HEROHP<1 THEN GOSUB 490
440 TURN=0
450 GOTO 240
460 RETURN

//REM DeadSkeleton

470 DISPLAY AT(20,1):"SKELETON IS DEAD!"
480 END

//REM DeadHero

490 DISPLAY AT(20,1):"HERO IS DEAD!"
500 END
510 FOR I=1 TO 300 :: NEXT I
520 RETURN
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...