This is super rough just to get ideas on the page. Will be much clearer with a proof of concept.
As with all roguelike rpgs, we need some way to describe an Attribute Set (hp, str, dex, etc) along with ways to provide temporary or permenant changes to these attributes. To do this we need to create an Attribute system that has the following core ideas:
Attribute
Effectively a float but wrapped to provide some convience functions, bounds checking and because non-primative types are useful here
Really would be 2 floats, the base value and the current value.
AttributeSet
Defines a collection of Attributes that exist as one set
Responsible for initializing and providing control of attributes
Effect
A class defining a bit of logic for modifying attributes
Can be duration based, infinite, or instant
Can be addative or multiplicative
Can basically do whatever to any attribute on the character its on
AttributeSystem
- Stored on a character or other object with attributes
- Can contain many AttributeSets
- Entry point for applying Effects
- Manages lifecycle of applied Effects
Lets say we pickup an item that gives our units 20% more health for 10 seconds. We would grab all the units, apply an Effect to their AttributeSystem. The attribute system will then start managing the lifecycle of the Effect. Each tick, the AttributeSystem will go through all its active Effects, reprocess them and update the current value of the attributes, remove effects no longer valid.
This is super rough just to get ideas on the page. Will be much clearer with a proof of concept.
As with all roguelike rpgs, we need some way to describe an Attribute Set (hp, str, dex, etc) along with ways to provide temporary or permenant changes to these attributes. To do this we need to create an Attribute system that has the following core ideas:
Attribute
- Effectively a float but wrapped to provide some convience functions, bounds checking and because non-primative types are useful here
- Really would be 2 floats, the base value and the current value.
AttributeSet
- Defines a collection of Attributes that exist as one set
- Responsible for initializing and providing control of attributes
Effect
- A class defining a bit of logic for modifying attributes
- Can be duration based, infinite, or instant
- Can be addative or multiplicative
- Can basically do whatever to any attribute on the character its on
AttributeSystem
- Stored on a character or other object with attributes
- Can contain many AttributeSets
- Entry point for applying Effects
- Manages lifecycle of applied Effects
Lets say we pickup an item that gives our units 20% more health for 10 seconds. We would grab all the units, apply an Effect to their AttributeSystem. The attribute system will then start managing the lifecycle of the Effect. Each tick, the AttributeSystem will go through all its active Effects, reprocess them and update the current value of the attributes, remove effects no longer valid.
Just a note: "a float" won't really be able to capture the idle game spirit. I think we'll want some variety of arbitrary precision number. Doubles may suffice, depending on final balancing, but I'm hesitant to include the possibility of infinities.
Just a note: "a float" won't really be able to capture the idle game spirit. I think we'll want some variety of arbitrary precision number. Doubles may suffice, depending on final balancing, but I'm hesitant to include the possibility of infinities.
Attribute and Effect are implemented, at least to an extent. AttributeSet and AttributeSystem are not. I feel like we can hold off on those for a while and go ahead with #3.
Attribute and Effect are implemented, at least to an extent. AttributeSet and AttributeSystem are not. I feel like we can hold off on those for a while and go ahead with #3.
zephyr
removed a dependency 2023-07-30 12:01:50 -04:00
Attribute and Effect are implemented, at least to an extent. AttributeSet and AttributeSystem are not. I feel like we can hold off on those for a while and go ahead with #3.
Sounds good to me.
> Attribute and Effect are implemented, at least to an extent. AttributeSet and AttributeSystem are not. I feel like we can hold off on those for a while and go ahead with #3.
Sounds good to me.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This is super rough just to get ideas on the page. Will be much clearer with a proof of concept.
As with all roguelike rpgs, we need some way to describe an Attribute Set (hp, str, dex, etc) along with ways to provide temporary or permenant changes to these attributes. To do this we need to create an Attribute system that has the following core ideas:
Attribute
AttributeSet
Effect
AttributeSystem
- Stored on a character or other object with attributes
- Can contain many AttributeSets
- Entry point for applying Effects
- Manages lifecycle of applied Effects
Lets say we pickup an item that gives our units 20% more health for 10 seconds. We would grab all the units, apply an Effect to their AttributeSystem. The attribute system will then start managing the lifecycle of the Effect. Each tick, the AttributeSystem will go through all its active Effects, reprocess them and update the current value of the attributes, remove effects no longer valid.
Just a note: "a float" won't really be able to capture the idle game spirit. I think we'll want some variety of arbitrary precision number. Doubles may suffice, depending on final balancing, but I'm hesitant to include the possibility of infinities.
Since duders and enemies have different stats, is the idea to make AttributeSet an interface with a
public Attribute Get(someAttrEnum)?Attribute and Effect are implemented, at least to an extent. AttributeSet and AttributeSystem are not. I feel like we can hold off on those for a while and go ahead with #3.
Sounds good to me.