Welcome, Guest. Please login or register.

What openbor you prefer: Double dragon,battletoads or final fight !? by lirexpatrio
[December 07, 2012, 07:15:27 pm]


what are your favorite games OpenBOR?! by lirexpatrio
[December 07, 2012, 07:09:46 pm]


Post Some Awesome Videos by maxman
[December 07, 2012, 05:51:39 pm]


Can @cmd playmusic "aaaa" 1 also increse music sound ? by BeasTie
[December 07, 2012, 05:24:38 pm]


Streets of Rage: Silent Storm by mtrain
[December 07, 2012, 03:45:05 pm]


Site will be down for maintenance on 12/8/2012 thru 12/10/2012 by Damon Caskey
[December 07, 2012, 07:42:42 am]


Cancelled SOR 3d Remake by riccochet
[December 07, 2012, 03:58:33 am]


Dungeon Fighter: B.O.R. by msmalik681
[December 07, 2012, 03:24:27 am]


[TUTORIAL] How to create 4 Games of OpenBOR in 1 CD (650 MB) by magggas
[December 06, 2012, 09:46:25 pm]


custknife by Bloodbane
[December 06, 2012, 09:34:09 pm]


blockfx help by B.Kardi
[December 06, 2012, 04:09:14 pm]


street of age 4 hd by corradlo
[December 06, 2012, 01:41:36 pm]


ClaFan - Classic Fantasy ver 1.17 by soniczxblade
[December 06, 2012, 05:01:20 am]


Bug Archive by Bloodbane
[December 06, 2012, 02:00:44 am]


"Bio-Doom" and "Gears of Doom" by BulletBob
[December 05, 2012, 10:07:21 pm]


Contra Locked 'N' Loaded v2 by Bloodbane
[December 05, 2012, 09:39:43 pm]


Downloadable OpenBoR Manual by BeasTie
[December 05, 2012, 08:31:24 pm]


Having trouble testing changes by B.Kardi
[December 05, 2012, 03:05:53 pm]


DragonBall Absalon by msmalik681
[December 05, 2012, 02:52:13 pm]


[Hi-Res] Swamp by Vibrant
[December 05, 2012, 10:47:14 am]


  • Dot Guests: 166
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.



Author Topic: defense and offense  (Read 684 times)

0 Members and 1 Guest are viewing this topic.

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
defense and offense
« on: June 12, 2012, 01:07:37 am »
I have been fixing the defense bug recently.

I found the logic had been changed since openbor 3.x was out, so maybe we need a discussion.

The defense factor was planned to be used like the antigravity logic.

Code: [Select]
damage = basedamage * (1.0 + attacker.offense + attacker.model.offense)
totaldamage = damage * (1.0 - target.defense - target.model.defense)

But now it works like this:

Code: [Select]
damage = basedamage * attacker.model.offense
totaldamage = damage *  target.model.defense

So you see the problems: changing one entity means changing all of its type.

First of all, I'm about to transfer the values to entity from model. So it will be like this:

Code: [Select]
damage = basedamage * attacker.offense
totaldamage = damage *  target.defense

This should fix the first problem, but leaves a question: when giving a new model, should the values from the new model be copied to current entity?

For example, there is a player who has a scripted level up bonus, say, it changes current defense factor from 1.0 to 0.8, now he picks up a new weapon, which has a defense factor of 0.9, should the new factor 0.8 or 0.9 or 0.8*0.9 or another value?

Ideas?




« Last Edit: June 12, 2012, 01:09:50 am by utunnels »

Offline MatMan

  • Hero Member
  • *****
  • Posts: 1320
Re: defense and offense
« Reply #1 on: June 12, 2012, 04:51:00 am »
Quote
For example, there is a player who has a scripted level up bonus, say, it changes current defense factor from 1.0 to 0.8, now he picks up a new weapon, which has a defense factor of 0.9, should the new factor 0.8 or 0.9 or 0.8*0.9 or another value?
I don't like the idea of the weapon taking over the defense/attack factor. This would suggest that the weapon makes the fighter (The way 99% of d&d games are like, anyone play diablo before). personally I would prefer that it takes the fighters skill into account so something like a half way mark, say about 0.85.

Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: defense and offense
« Reply #2 on: June 12, 2012, 05:27:59 am »
Hmm, then things go complicated. Some people use weapon to change capabilities,  while others only wants a new look. The weapon feature is never good enough to cover all situations we need.

For backward compatible sake, the safest way is let the engine perform the easy copy job, and add an onmodelcopyscript for those who like exceptions .

The difficult part is the script needs to get both old and new values, unless we add 2 different scripts, one before the copying and one after the copying.

Offline MatMan

  • Hero Member
  • *****
  • Posts: 1320
Re: defense and offense
« Reply #3 on: June 12, 2012, 06:33:27 am »
Lol, I had a feeling you might say something like that.

Then I might suggest with letting the engine take the best/strongest/most beneficial option as I would imagine that the average game would prefer that.

Offline Damon Caskey

  • Hero Member
  • *****
  • Posts: 5335
    • The Gorge
Re: defense and offense
« Reply #4 on: June 13, 2012, 01:35:56 pm »
Yeah, the engine should not have any say in the math, at all. The player is free to do that themselves.

BTW, sorry about the screw up. I'm the one who changed the logic. I meant to simplify the math and make it more straight forward. It's much easier to think Damage = Base * %. I didn't mean to make it model based instead of entity though. Mea culpa.

DC
OpenBOR Wiki.

Coming Soon:
Spoiler
Fatal Fury Chronicals


Offline utunnels

  • Developer
  • Hero Member
  • *****
  • Posts: 2713
Re: defense and offense
« Reply #5 on: June 14, 2012, 05:31:51 am »
It's OK.

I'm thinking about some script additions recently.

One of them is a model copy event driven script. The hard part is get both old and new values from the same entity. Maybe there can be a global dummy entity which can be used to transfer values, like the global drawmethod.


 



 0%




mighty
SimplePortal 2.3.3 © 2008-2010, SimplePortal