Wilminator.com Logo

Dragon Star PHP RPG Engine - Core Engine Nuts and Bolts

Overview

This page deals with the various ways that this game works and figures out how the game play progresses. This is meant for those number geeks that want to know how to maximize their characters!

General

PXP (Potential eXperience Points)

PXP is a measurement of how dangerous a combatant is, and hence is also the amount of experience earned if completely defeated by another combatant. This is calculated using four measures:

  1. Physical Offense
  2. Physical Defense
  3. Magic-Based Offense
  4. Magic-Based Defense
To determine the PXP of a character, the following steps are performed:
  1. First, the third roots (cubic roots) of dodge, block, and Max HP are multiplied together together. The dodge and block ratings include stat adjustments from all equipment.
  2. Next, the third roots of Speed, Accuracy, and Offense are multiplied together. All stats include adjustments from all equipment. This is how offense is calculated:
    • For each weapon, the number of attacks are multiplied by the the number of (estimated) targets that will be affected and the strength of the attack.
    • These values are added together to generate the offense value.
  3. The square root of resistance and Max HP are multiplied together.
  4. For each spell and skill, a determination is made if there is enough MP available to cast a given spell or use a given skill. If so, then the offense generated by the spell or skill is added to a tally for that kind of magical ability. The offense is calculated like for physical attacks above. When finished tabulating the spells and skills, two more values are generated. A spell value is calculated by multiplying the fourth roots of speed, focus, power, and the spell tally. A skill value is calculated by multiplying the third roots of speed, accuracy, and the skill tally.
  5. The values calculated in the above four steps (physical defense, physical offense, magical defense, spell offense, and skill offense) are added together. This value is the character's PXP rating.
A character's rating will change in combat and in the field by changing equipment, running low on magic, being affected by spells, and by leveling. However, because of using roots, a fighter with double the PXP rating of an opponent is actually between three and four times more powerful.

A fighter may earn 100% of an opponents PXP if the oppenent starts with 100% of its life and the only actions to affect the opponent are caused by the fighter. All actions affecting an opponent grant a share of the PXP the opponent has to the combatant responsible for the action. In fact, healing yourself or your party allows a fighter to earn XP off thier own party. This should help clerics not fall so far behind earning XP in combat.

Simply this means that if you are the only one responsible for killing a monster with 100% HP, then you get 100% of its PXP. But if it has 50% HP, then you only get 50% of its PXP. And if two fighters damage the monster for 50% of its HP, they split the PXP 50-50.

As a scenario, though, let's say that a party consisting of a single fighter fights another party of two: a cleric and a mage. While the fighter wails on the mage, the cleric heals the mage. When it is said and done, the cleric has healed the mage for three times his HP and the fighter has damaged the mage for four times his HP. This is a net loss of 100% of the mage's HP and he dies. At this point, the mage owes 700% of his PXP. However, if a character owes more than 100% of his PXP, the percentages are scaled down so the sum is 100%. This means that the fighter would get 4/7 of the mage's PXP and the cleric would get the other 3/7. By chance, the mage would also get a percentage of the fighter's PXP based on the damage caused to the fighter, even though he died.

Combat

Fight Order

The order of fight is determined in a fairly constant manner. There are two major parts to the calculation: the fighter's speed and the number of attacks the fighter is to perform. The fighters' speeds are randomized +-10% and all combatants are ordered from highest speed to slowest speed. In addition, players entitled to more than one attack receive additional speed entries as a fraction of thier speed rating using the formula

(base speed * attack number/total number of attacks)
, ie a person with 100 speed and 4 attacks will have speed ratings of 100 (100*4/4), 75 (100*3/4), 50 (100*2/4), and 25 (100*1/4). All these ratings after ordering determine the order of combat.

Attacking and Skill Success

A fighter attacking another combatant must successfully hit the target in order to cause damage. This is determined using a ratio

(effective accuracy/(effective accuracy+effective dodge))
. In essence, a random number is chosen between 1 and accuracy+dodge. If the number is less than or equal to accuracy, then the target is hit. This provides for a couple of desired game outcomes:
  • There is a balance (symmetry) to the accuracy and dodge stats. If both are equal, there is a 50/50 chance to be hit. If the accuracy is twice the dodge, there is a 2:1, or a 2 in 3 chance to be hit. If the dodge is twice the accuracy, there is a 1:2, or 1 in 3 chance to hit.
  • Even if a fighter has a much lower accuracy than the target's dodge, there is still a fair chance that the target can be hit. Even if the opponent's dodge is five times that of the fighter's accuracy, the fighter still has a 17% chance to hit.
  • As the game progresses and fighters level, more accurate weapons become more important. A weapon that adds 5 accuracy is only good if the fighter's base accuracy is less than 10 and the target has less than 30 dodge. This happens to give a 33% chance to hit, as opposed to a 25% chance without the weapon. However, that same weapon in the hands of a fighter with 100 accuracy only adds 1.2% against a target with 100 dodge.
This check must be against all targets to be hit individually.

Attack and Skill Damage

After making a successful hit, damage is distributed between all hit targets. In the case of group or party attacks, the damage is calculated with a straight

(effective strength-effective block)
formula, with a minimum damage of 1. If the attack is a ranged attack, then the damage is calculated using a linear tapering formula
((effective strength-effective block)*(range-abs(target+-offset))/range)
, with a minimum damage of 1. Dead members of the target party still count as an offset even though no damage occurs (they are dead already!). If the accuracy roll for that target was a 1, the strength is doubled. Next, elemental attributes are applied and the target receives the calculated damage (or healing) rounded up to the nearest whole number.

Skills vs. Weapons

The main difference between skills and weapons are that skills cause a set effect with no modification based on any other stats, while attacking causes the weapon's stats to affect the fighter's effecitve stats. As a fighter levels, his strength will add to the damage caused, while skills will remain constant.

Casting Success

The chance for a negative spell to affect another is directly correlated to power and resistance. There are two scenarios:

  1. The power rating of the caster is higher than the target's resistance. In this case, a number is rolled betwen 1 and power+resistance and if that number is less than or equal to power, then the spell works at 100%. If not, the spell works at 50%.
  2. The power rating of the caster is less than the target's resistance. The same steps as above are followed, except if the roll is larger than twice the power. In this case, the spell fails.
If the spell has a chance to fail, this is figured before the power/resistance check occurs. In addition, the duration of the spell's effect (if limited) will be what is adjusted by the power/resistance check.

Casting Damage

Depending on if the caster's power check was 100%, 50%, or 0% successful, the spell will cause 100%, 50%, or 0% of its rated effect.

Item Use Success

Items have a succes ratio associated with them. Some will always work. Others will rarely work.

Item Use Damage

Items have the same effects as spells and act like spell damage without the power/resistance check.