Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul traning to be associated internally with state #163

Closed
mattdelsordo opened this issue Feb 14, 2019 · 1 comment · Fixed by #168
Closed

Overhaul traning to be associated internally with state #163

mattdelsordo opened this issue Feb 14, 2019 · 1 comment · Fixed by #168
Labels
feature New feature or request

Comments

@mattdelsordo
Copy link
Owner

mattdelsordo commented Feb 14, 2019

Modify training system first before adding hunger to make the latter process more manageable.

What I want to do is have the states keep track of energy cost/exp/state transitions/etc. in a way that creates sort of a state machine managed by the state classes themselves. That way, the UI can just send a message to the Friendo object that will say "do crunches" and the Friendo will either transition to that state and start exercising automatically or not change state due to a lack of transition from the state it's currently in.

@mattdelsordo mattdelsordo added the feature New feature or request label Feb 14, 2019
@mattdelsordo mattdelsordo added this to In progress in Friendo Development Feb 14, 2019
@mattdelsordo mattdelsordo changed the title Overhaul traning to be associated passively with state objects Overhaul traning to be associated internally with state Feb 14, 2019
@mattdelsordo mattdelsordo moved this from In progress to To do in Friendo Development Apr 13, 2019
@mattdelsordo mattdelsordo moved this from To do to In progress in Friendo Development Aug 25, 2019
@mattdelsordo
Copy link
Owner Author

Refactor all states to include:
Fields:

  • "schedule": > 0 if exercising, 0 if done exercising, -1 for infinite/not timed (sleep and idle)
  • fatigue modifier
  • exp modifier
  • associated stat (for exercises, null for others)

Methods:

  • "tick()": called on each behavior tick (separate from animation tick?), updates schedule, applies fatigue/exp modifiers, checks whether to update state
  • handleAction(): interprets action input from player, transitions to other states based on current state
    • idle -> exercise
    • cancelled exercise -> idle
    • not sure whether to also use this for internal state transitions e.g. exercise -> sleep/sleep -> idle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

1 participant