Skip to content

Added area refresh rules to JSON properties #181

@Synival

Description

@Synival

Every zone's "area.json" should have custom settings to determine how it should refresh.

The following rules should be available:

  • "min_reset_age": int
    The minimum number of area ticks necessary before an update is considered.
    Default: AREA_RESET_MINIMUM_AGE (3)

  • "always_reset_age": int
    The maximum number of area ticks that can pass before an update occurs.
    Default: AREA_RESET_ALWAYS_AGE (31)

  • "active_reset_age": int
    The maximum number of area ticks that can pass before an update occurs If players have been in (or are currently in) this zone before a reset occurs.
    Default: AREA_RESET_AFTER_PLAYERS_AGE (15)

To implement this, we'll need some new fields for struct area_data in structs.h:

int min_reset_age;
int always_reset_age;
int active_reset_age;

When creating new areas, area_init() in recycle.c should set the defaults to the #defines listed in the JSON description.

The area_should_update() function in areas.c should be modified to use the new fields instead of the hard-coded #defines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    minor featureA built-in feature that doesn't change much of the game's implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions