Please enlightmen me, how are creature stats handled?
Without going as far as enlightening someone which is in the project since much longer than myself, here are the bits I gathered so far:
The creature have those stats:
- Level: Base value of 1. Will go up to 100.
- hp/level: The max HP value the creature will have per level.
- mana/level: The max mana value the creature will have per level.
- maxHP: The absolute max HP value the creature can ever have, whatever its level is.
- maxMana: The absolute max mana value the creature can ever have, whatever its level is.
- sightRadius: The visibility the creature has got around it, in tile. Permitting to check for stuff to dig, claim, attack, ...
- digRate: The rate per turn the creature can reduce the tile fullness.
- danceRate: The rate per turn, the creature can claim a tile or a wall in percent.
- moveSpeed: Is the speed in tiles depending on the turn per seconds and time elapsed per frame (in seconds): All in all. Speed in tiles = 1.4 * moveSpeed * secondsSinceLastFrame
- TilePassability: Tells on which tile passability type the creature can go through. currently, walkable Tiles per default, flyableTile, or impassableTile (walls).
- Damage: Base value of 1.
- Defense: Base value of: 3 + defense values of weapons.
- Range: base value of one tile, replaced eventually by the weapon own range when computing the reachable enemies.
- A right weapon and a left weapon. Each of those has got a damage, defense and range modifier.
When attacking, the creature use his left and right weapon and wait for next turn.
The attack is computed like this:
Base value of 1 + weapon attack if the weapon range is sufficient.
then the new value multiplied by log(log(creature_level + 1) + 1); (log() is there twice, not a typo.)
Newly spawned creatures have both weapons having 5 in damage, 4 in range, and 0 in defense, but certain ones already on map at load time have some more powerful, making them more deadly.
the creatures all heal of 0.1 HP and 0.45 mana point per turn,
+ 1 HP and 1 mana per turn when sleeping.
+ 4.0% in awakeness when sleeping per turn.
- Their awakeness (starting at 100.0) decreases of 0.15 per turn.
Not long time ago, I made creatures go to bed when they have less than 1/3 of their HP, as I found out them dying too easily even when fixing the max HP problem.
Level up:
While on it, note that the worker creatures dig rates and claim rates grow like this when levelling up:
- {l Code}: {l Select All Code}
DigRate += 4.0 * level / (level + 5.0);
DanceRate += 0.12 * level / (level + 5.0);
All the creature move speed grows like this when levelling up:
- {l Code}: {l Select All Code}
MoveSpeed += 0.4 / (level + 2.0);
Their scale grows by 3-4% each 2 levels before level 30, and then each 3 levels.
Their max health, mana is increased on level up using the corresponding parameters.
A creature earnes XP while digging, claiming, attacking, training, and earn a level when its Experience is above:
5 * (level + pow(level / 3.0, 2))
- cHumans
- cCorpars
- cUndead
- cConstructs
- cDenizens
- cAltruism
- cOrder
- cPeace:
From what I understood, all those are doing this:
When the portal wants to spawn a creature, it will make a probability list based on the current factions (Humans, ...) the current player has already got, and will change those probabilities according to the already spawned creatures faction values given here.
I didn't look at this thoroughly, but it seems all those values are becoming more or less obsolete, according to the new system of spawn pools. I must say I would like to know what to do with those. If I add support for custom spawn pools per player/AI + spawn conditions based on the rooms existence, will those still be needed?
Overall, I hope I helped you.