Skip to content

Initial Design #1

@Shibang

Description

@Shibang

Overall, goals are defined in the README. This issue largely documents the initial design intentions, subject to review and change.

Current idea is that we largely break the code into two parts: Entities and Simulator.

Entities

Entities are allies / enemies / summons in HSR. They are mainly made of stats and buffs. They have a method that, given a controller which can be queried for suggested actions. For example, a controller replicating the prydwen scenario would just always use a character's skill on their turn, and ult anytime available.

Stats are the values used in calculations for DPS, etc. This has all the identifiable character information for weaknesses, effects of current buffs (+20% defense, etc) and are basically the sum of ongoing buffs as well as inherent effects.

Buffs are things that alter stats, sometimes conditionally. These might range from avoiding the next event of damage to increasing the flat attack of an entity. Buffs include things such as relics, lightcones, and combat buffs.

Simulator

Actual logic for leveraging entities. Includes monte carlo sim logic and events.

Monte carlo sim logic will just run a monte carlo sim with a provided randomizer. Randomizer will be provided the current event being randomized for (so each randomizer can choose to only randomize certain events). Will have a timeline which moves to the next entities' (pre) turn after another ending (if nobody wishes to ult), then ensure nobody wants to use ult before calling the act of the entity.

Events are anything that could result in a character's stats changing. For example, a turn beginning, someone being targeted, damage being dealt (or intended to be dealt), a buff / debuff being applied. These are used so that we can query them in conditional buffs, as well as deal with any possible special resolution on these events.

Character design

Since buffs are generic, easy to swap them out and add / remove. Means optimizing things such as relics may be feasible, as well as reusing buffs commonly seen in multiple characters. Character mainly contributes basic, skill, and ult events which would have to be coded for each character.

Entities always act through calling events. In other words, an entity cannot directly change another entities stats and must instead call the appropriate event(s) for it. For example, they may call an event which triggers a DamageDealt event or a BuffApplied event.

Buffs also will allow lightcones to be a lot easier. For example, equipping the lightcone "Cruising in the Stellar Sea" would just be a conditional buff that, on application, increases crit rate by X%, then X% more if the target of an attack event is <50% hp in its stats.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions