Implement Attribute System #2

Open
opened 2023-07-12 21:19:54 -05:00 by madxmike · 4 comments
Owner

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.
zephyr added a new dependency 2023-07-12 21:43:45 -05:00
zephyr added this to the Prototype milestone 2023-07-12 21:45:08 -05:00
Owner

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.
Owner

Since duders and enemies have different stats, is the idea to make AttributeSet an interface with a public Attribute Get(someAttrEnum)?

Since duders and enemies have different stats, is the idea to make AttributeSet an interface with a `public Attribute Get(someAttrEnum)`?
zephyr self-assigned this 2023-07-22 22:03:42 -05:00
zephyr referenced this issue from a commit 2023-07-23 14:18:34 -05:00
zephyr referenced this issue from a commit 2023-07-23 14:38:00 -05:00
zephyr referenced this issue from a commit 2023-07-30 10:58:20 -05:00
Owner

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 11:01:50 -05:00
Author
Owner

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.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: studio/idle-survivors#2
No description provided.