mheyer32 / alienbreed3d2

Alien Breed 3D II The Killing Grounds
33 stars 4 forks source link

Feature/player stats part 1 #127

Closed 0xABADCAFE closed 8 months ago

0xABADCAFE commented 9 months ago

Introduces a mechanism to track player stats, e.g.

A rule based system allows the external definition of achievements based on these stats. For example, killing a certain number of a specific class of alien can trigger an achievement message.

Achievements may also contain a reward, typically adding some consumable the inventory but can also modify the inventory cap. Thus an achievement may reward a permanently higher carry capacity for some ammo class or permanent HP bonus.

In order to be efficient, the rules are evaluated no more than once per frame and only when an event happens that frame (killing an enemy, collecting something, finding a place) that may have rules to check.

Once an achievement is awarded, it is marked such that it never has to be retested.