open5e / open5e-api

The api for open5e.com
Other
156 stars 97 forks source link

v2 Distance and/or speed solutions. #470

Closed augustjohnson closed 4 months ago

augustjohnson commented 5 months ago

Here are some places that have distance as part of the model: v2 spell range (along with all casting options). - this should be FIXED, today it's a string. v2 size space_diameter - this should apply to all objects, creatures and items included. v2 creature speed - speed isn't exactly distance, it's distance per time, but can probably be measured in the same way. v2 race trait speed ? - this is a trait at the moment, not its own field.

We need to have a consistent approach to that for all. It should support distinct units (some documents are in meters rather than feet).

I think that a DOCUMENT should be the source of a unit of measurement, and that all of these quantities should be floating-point numbers.

augustjohnson commented 5 months ago

This is probably a pre-requisite for v2 going public :/

augustjohnson commented 5 months ago

walk swim climb fly walk (hover) burrow

These scenarios should all by covered by the speed field. Walk is required, and is present for all creatures. Other types are only present when explicit, but can be calculated based on movement. For example, a creatures fly speed is 0 by default. A creatures burrow speed is 0 by default. A creatures climb speed is 1/2 walk speed by default. I think that the defaults should be available upon every request.

Races: Speed is in an attribute, but could be surfaced to top level using a property? Pretty much always specified in walk. That's the easy comparison. There may be races with climb and fly modifiers, but this is lower priority.

Spell: - these are both distance numbers. range shape_magnitude

For creatures, it should be basically the exact same as skills, using "distance" fields. Speeds, and all_speeds. speeds:{walk:30 fly:10 unit:feet}

For spells it should be basically 2 distance fields with names like "range" (just a plain distance field), and shape_magnitude, probably a distance field.