Search Results
Searched for posts by fejoa in all forums

Showing results 921 - 930 out of 983 total
Modify your search
Posted by fejoa, Nov 3, 2011 at 12:48 pm
Hi Squash! I don't count as a programmer either, probably for the same reasons. I'd also prefer to revert to the main line of IVAN development, in a group setting, but at the moment I'm using CLIVAN as a test bed for wacky ideas.
Posted by fejoa, Nov 1, 2011 at 11:42 am
Wonderful work Translating IVAN must've been very challenging.

Navastater, hmm, the Devs came up with it. It's part of the holy stack and can be found in Mola_Mola.rtf:

to navastate – For example, it is navastating to ponder what navastating means.

By the way, did you translate the opening story and the encrypted scroll?
Posted by fejoa, Oct 28, 2011 at 5:54 am
So where do I find the severed groin of a mistress whip champion?

Posted by fejoa, Oct 25, 2011 at 6:41 am
Quite slowly. I'll have to take some time out to write down some plans on paper regarding what needs to be done next.
Posted by fejoa, Oct 20, 2011 at 4:31 pm
Yeah the THV's seem counterintuitive to me too at this stage.

Let me show you another function, this time from item.cpp:

long item::GetBlockModifier() const
    return GetSize() * GetRoundness() << 1;
    return GetSize() * GetRoundness() << 2;

I don't know how it works because I have not stared at it for long enough. It gets called inside this function in bodypart.cpp,
double arm::GetBlockValue() const { return GetToHitValue() * GetWielded()->GetBlockModifier() / 10000; }
when the game calculates the BlockValue of an arm, for blocking.
It would seem that the blocking value of a shield is modified by its roundness and size.

Posted by fejoa, Oct 20, 2011 at 3:41 pm
What about permanent polymorph into an orc, by drinking a potion or something? Then you can play the rest of the game as an orc character.

Is there any code for the Magic 8 ball, by the way?
Posted by fejoa, Oct 17, 2011 at 4:13 pm
Also, now I think about it, I think the devs used bitwise operation in place of floating-point operation as often as possible because it may be faster. I'm not a computer engineer but I recall that bitwise operations are a more fundamental structure inside most modern ALU's. Geek geek.
Posted by fejoa, Oct 17, 2011 at 3:51 pm
Ischaldirh wrote
How did you calculate this? I see Short Sword's StrengthModifier value (90) and Mithril's Strength value (200), but how did you find the formula (and the "/ 2000" part)?

It's in item.cpp, and the function goes a little something like this:

int item::GetStrengthValue() const
  return long(GetStrengthModifier()) * GetMainMaterial()->GetStrengthValue() / 2000;

Regarding the bitchift operator, you are correct. If k = BlockSinceLastTurn and (1 << k) signifies a 'left-shift' operation, then this is the same as multiplying the first operand, i.e. 1, by 2^k. F. ex. 1*2^k: 1*2^2 = 4.
Really it's like this: 0001 << 2 = 0100 = 4, (in binary of course). All the bits are shifted two places to the left.

I agree with all your observations of the code you mentioned here:
if(RAND() % int(100 + WeaponToHitValue / BlockValue / (1 << BlocksSinceLastTurn) * (100 + Success)) < 100)
then (block)

Ischaldirh wrote
Double crap, I just realized I used the wrong number in WeaponToHitValue (I used Guss's block value instead of his THV). With his actual THV it becomes a 17% chance to block (but he still gets two chances at it). This seems... wrong.

Isn't the THV just the ToHitValue of the weapon/item?
With a little sourcediving I think this may just be the case. The THV flows through several functions before finding its use in the blocking function, but I think it originates inside bodypart.cpp. Specifically, the game checks to see if the character is wielding something, and then calculates a THV (of the item/arm) based on what is being wielded (or not).

Therefore, in bodypart.cpp we have this extremely interesting piece of code:
double arm::GetWieldedToHitValue() const
  int HitStrength = GetWieldedHitStrength();

  if(HitStrength <= 0)
    return 0;

  citem* Wielded = GetWielded();

  double Base = 2e-11
		* Min(HitStrength, 10)
		* GetHumanoidMaster()->GetCWeaponSkill(Wielded->GetWeaponCategory())->GetBonus()
		* GetCurrentSWeaponSkillBonus()
		* Master->GetMoveEase()
		* (10000. / (1000 + Wielded->GetWeight()) + Wielded->GetTHVBonus());
  double ThisToHit = GetAttribute(DEXTERITY) * sqrt(2.5 * Master->GetAttribute(PERCEPTION));
  const arm* PairArm = GetPairArm();

  if(PairArm && PairArm->IsUsable())
    citem* PairWielded = PairArm->GetWielded();

      if(Wielded->IsTwoHanded() && !Wielded->IsShield(Master))
	return Base * (ThisToHit + PairArm->GetAttribute(DEXTERITY)
		       * sqrt(2.5 * Master->GetAttribute(PERCEPTION))) / 2;
    else if(!Wielded->IsShield(Master) && !PairWielded->IsShield(Master))
      return Base * ThisToHit / (1.0 + (500.0 + PairWielded->GetWeight())
				 / (1000.0 + (Wielded->GetWeight() << 1)));

  return Base * ThisToHit;

I think it calculates the THV and hence the WeaponTHV in the block. I think it bears resemblance to the parsing shown by Squash, no?
It's getting a bit late for me atm, but hopefully this provides more clues.
Posted by fejoa, Oct 16, 2011 at 10:25 am
Ischaldirh wrote
Block Capability = 19 * 90 * 1400 * 1450 / 10000000

Block Strength = 347 /* If this were true, the next part would reveal that you would need to deal some 350 damage in order to pass a successful block. I don't feel this is accurate. */

I'm looking at this presently:

I calculated the StrengthRequirement = 0.153.
Therefore, HitStrength is indeed 19, as Izzy has calculated.

in Bodypart.cpp there is this function:

int arm::GetBlockCapability() const

This function returns the value of the block capability of a humanoid's arm as follows:
Min(HitStrength, 10) * Wielded->GetStrengthValue() * GetHumanoidMaster()->GetCWeaponSkill(Wielded->GetWeaponCategory())->GetBonus() * (*GetCurrentSWeaponSkill())->GetBonus() / 10000000;

The first part is a Min function, which takes the minimum between two values f.ex. HitStrength and 10. So the result of Min(19, 10) = 10.

Next I calculate the strength value of the Short Sword to be (90 * 200)/2000 = 9

I do not know how to calculate class skill bonus or specific skill bonus so will assume they are as above, i.e. 1400 and 1450 respectively.

Then I have:
Block Capability = 10 * 9 * 1400 * 1450 / 10000000
                                  = 18.27

That is all I have for the moment, hope this helps

Posted by fejoa, Oct 7, 2011 at 4:55 pm
I can't remember where the worst item list is, but this fella was carrying a very unfortunate weapon: