Log in

View Full Version : Trying to get a grasp what developers want


Armanthuz
01-29-2004, 01:48 AM
Hi,

I have been playing with attack.cpp code for awhile and put up a few chunks here and there. My question is How do the developers of eqemu want emucombat to be? Are they happy with it atm? Will only exact formulas depicting eqlive behavior be accepted for changes or are you willing to accept things that can get us closer than where its at?

I personally feel combat is a HUGEEE part of the eq experience, and although it is a very hard part to code i think from lookin at available code that we can get a large amount closer to real combat than where we are now...

The question is... is that what you want??

Trumpcard
01-29-2004, 03:28 AM
My PERSONAL opinion is that combat should be completely configurable from the database with eqLIve as a basis for the default system.

Ultimately I'd like to see it fully tweakable outside of the code by whoever runs the server.

Thats my opinion though

kathgar
01-29-2004, 04:12 AM
What ever it is, it has to be fast, commented well, and easy to understand. Our's is horrible because 50+ people have been hacking at it for 2+ years

Armanthuz
01-30-2004, 06:24 AM
Wow now thats thinkin big :P , good idea thou.. Unfortunately no where near my skill level, ill just keep ploddin along..

smogo
02-02-2004, 12:17 PM
Ultimately I'd like to see it fully tweakable outside of the code by whoever runs the server.


and
What ever it is, it has to be fast, commented well, and easy to understand. Our's is horrible because 50+ people have been hacking at it for 2+ years


maybe first step is to turn all these inlined constants to #define's, huh ? 'Big thing is to find the names. :?

Trumpcard
02-02-2004, 02:00 PM
???

smogo
02-02-2004, 03:47 PM
Sry if the post was enigmatic.

Lots of the 'rules' are inlined in the code, as integer constants, like :

// with this formula if you have an attacker with 185 offense skill
// and a defender with 180 defense, the net effect is
// 24.05 - 16.2 == 7.85% added
// an example with the defender having a defense of 85, and the attacker
// having an offense of 60
// 7.8 - 7.65 = 0.15% added
// so basically defense is for cancelling out the attacker's offense,
// but offense is more effective than defense
chancetohit += (float)((float)attacker->GetSkill(OFFENSE) * 0.13f);
chancetohit -= (float)((float)defender->GetSkill(DEFENSE) * 0.09f);

int16 defender_agi = defender->GetAGI();
// skill points over 200 are 1/5 as effective
// at max stat of 252 this is a 10.52% bonus
defender_agi = (defender_agi <= 200) ? defender_agi : defender_agi + ((d
efender_agi-200)/5);
chancetohit -= (float)((float)defender_agi * 0.05f);

// etc ...



could turn into :

in a foo.h :

#define TOHIT_AttackerSkillFactor 0.13f
#define TOHIT_DefenderSkillFactor 0.09f
// with this formula if you have an attacker with 185 offense skill
// and a defender with 180 defense, the net effect is
// 24.05 - 16.2 == 7.85% added
// an example with the defender having a defense of 85, and the attacker
// having an offense of 60
// 7.8 - 7.65 = 0.15% added
// so basically defense is for cancelling out the attacker's offense,
// but offense is more effective than defense
#define TOHIT_Base(attacker,defender) ((float)((float)attacker->GetSkill(OFFENSE)* \
TOHIT_AttackerSkillFactor - \
(float)((float)defender->GetSkill(DEFENSE) \
* TOHIT_DefenderSkillFactor )

// skill points over 200 are 1/5 as effective
// at max stat of 252 this is a 10.52% bonus
#define TOHIT_DefenderAgiCap 200
#define TOHIT_DefenderAgiCappedRaise 0.2f
#define TOHIT_DefenderAgiCapped(defagi) (defagi < TOHIT_DefenderAgiCap \
? defagi \
: (defagi - TOHIT_DefenderAgiCap) * TOHIT_DefAgiCappedRaise ))

#define TOHIT_DefenderAgiModifierFactor 0.05f
#define TOHIT_DefenderAgiModifier(defender) \
(float)(TOHIT_DefenderAgiCapped(defender->GetAGI())*TOHIT_DefenderAgiModifierFactor))



then attack.cpp

// ...

// base attack vs defense skills
chancetohit =TOHIT_Base(attacker,defender)

// apply defender's agility
chancetohit -= TOHIT_DefenderAgiModifier(defender);


obviously the names are not good, as TOHit_Base doesn't explain a thing, and TOHIT_DefenderAgiModifierFactor is way too long. And the change is not complete.

But this could be the first step to :
- group 'rules' in a single source file, leaving only the logic in attack.cpp , and make it more readable.
- easily change a rule through edit of the foo.h
- move 'rules' to database driven, like :

// in foo.h
extern float gamesvars[];

#define TOHIT_DefenderAgiCap \
gamesvars[VAR_TOHIT_DefenderAgiCap]


I guess it did not tell you anything new. It's just that i had been surprised to see all these numbers in engine code. It would be very fine if game could be tuned from the DB.

Trumpcard
02-02-2004, 10:48 PM
I got ya now.

That would be a good first step, I agree.. It would definitely make migration to a database block easy. Breaking it out into those sections would also make it alot more easily tweakable by someone doing their own compiling, so they wouldnt have to go wandering through the code..