Comments (9)
Report Contents (WIP)
Basic Character Overview
- Kills
- Deaths
- KDR
- "True" KDR
- Faction
- Server
- Most played class
- Last played profile
- Battle rank / ASP
- Last seen
- Outfit
Extended Character Overview
- ACC
- HSR
- Playtime by profile
- Vehicle KDR
- Infantry KDR
- Top 5 weapons and related stats
- "Siege level" (see Voidwell)
- Facility captures/defences
- Assists
Vehicle Overview
- (Stats broken up by vehicle)
Weapon Overview
- (Stats broken up by weapon)
from auraxium.
That is quite likely. The item types also contain dummy objects used for mounts, player homes and similar shenanigans. EverQuest has left its mark on the engine for sure.
from auraxium.
After a bit of spring cleaning that led to v0.2.0, I got around to adding a tentative API for the reports system to the feature/reports branch.
Here is a non-exhaustive rundown of the current WIP API:
Report Base Class
The Report
base is a generic mapping of Ps2Object
instances to arbitrary types. This allows type checkers to both validate the objects passed and allows defining external data classes or typed dictionaries as the return type:
@dataclasses.dataclass(frozen=True)
class OutfitStats:
"""Read-only data class for outfit statistics."""
...
class OutfitStatReport(Report[ps2.Outfit, OutfitStats]):
"""A hypothetical report generating `OutfitStats` instances for any `ps2.Outfit` passed."""
...
Creating Reports
The Report ABC has two abstract class methods that must be implemented to create a working report.
The first is the query()
factory, which creates the auraxium.census.Query
used to retrieve the required data:
auraxium/auraxium/reports/base.py
Lines 234 to 235 in 866fb95
The other is convert()
, which converts the returned payloads into whatever format the report generates (e.g. an instance of the OutfitStats
data class in the previous example).
auraxium/auraxium/reports/base.py
Lines 180 to 181 in 866fb95
I implemented the vehicle statistics example as a test as this uses a complex query, the example script can be found in the branch's examples:
auraxium/examples/vehicle_damage_report.py
Lines 32 to 155 in 866fb95
Using Reports
Fortunately, using reports has a much simpler interface (that was the point, after all). There are currently two options, a class-based interface and a lazy, instance-based one.
Class-based interface
In the class-based interface, the user passes the elements to look up to the Report.gather()
coroutine:
auraxium/auraxium/reports/base.py
Lines 200 to 203 in 866fb95
Usage:
outfit_list: List[ps2.Outfit] = ...
results: Dict[ps2.Outfit, OutfitStats] = await OutfitStatReport.gather(outfit_list, client=auraxium.Client(...))
All elements are merged into a single query and fetched at once. This makes this a slow but efficient option for small to medium sized lists of elements.
Instance-based interface
In this variant, the Report is instantiated and used as an instance. Awaiting this instance behaves similar to the class-based variant, with all elements being fetched at once.
Alternatively, the user can asynchronously iterate over the Report instance. In this case, the elements passed are returned one-by-one, but the data required is retrieved in batches of 100 (default) elements.
auraxium/auraxium/reports/base.py
Lines 111 to 119 in 4422261
Usage:
outfit_list: List[ps2.Outfit] = ...
report = OutfitStatReport(outfit_list, client=auraxium.Client(...))
item: ps2.Outfit
data: OutfitStats
async for item, data in report:
...
This allows efficiently traversing input lists of any size that would otherwise produce unreasonably long query strings.
from auraxium.
Any feedback or comments on this interface would be much appreciated.
I will start implementing some of the built-in report types as per the previous comments to further test the interface in the coming days if no issues are found. ETA 1-2 weeks, hopefully. 👌
from auraxium.
Another notable example for the report system would be the single_character_by_id
collection, which only makes sense in this context of a larger, optimised batch report.
This could even be a dynamic, user-subclassable system that can be used to further improve performance without having to leave the object model endpoints.
from auraxium.
As I mentioned in #44, I was looking for relevant weapon stats, queried the datasheet, and the weapon stats are useless because of DBG API idiosyncrasies.
I can't grok the API enough to do the queries myself, but using the query the wiki page uses I can tell you relevant keys.
weapon on-paper comparison stats (ns-11a):
"move_modifier": "1",
"projectile_speed_override": "640",
"sprint_fire": "0",
"turn_modifier": "1",
"use_in_water": "0",
"zoom_default": "1",
"fire_refire_ms": "92", # represented as miliseconds per bullet
"fire_pellets_per_shot": "1",,
"reload_chamber_ms": "450", # reload + chamber = long reload
"reload_time_ms": "2000",
"max_damage": "143",
"max_damage_range": "10",
"min_damage": "125",
"min_damage_range": "65",
"shield_bypass_pct": "0", # Relevant for 2 NC weapons
recoil would need to be per firegroup (ADS vs not), but is:
"cof_override": "0",
"cof_pellet_spread": "0",
"cof_range": "50",
"cof_recoil": "0.1",
"cof_scalar": "1",
"cof_scalar_moving": "1",
"recoil_angle_max": "-17",
"recoil_angle_min": "-20",
"recoil_first_shot_modifier": "3",
"recoil_horizontal_max": "0.2",
"recoil_horizontal_min": "0.2",
"recoil_horizontal_tolerance": "0.6",
"recoil_increase": "0.1",
"recoil_increase_crouched": "0.1",
"recoil_magnitude_max": "0.22",
"recoil_magnitude_min": "0.22",
"recoil_max_total_magnitude": "0",
"recoil_recovery_acceleration": "1000",
"recoil_recovery_delay_ms": "92",
"recoil_recovery_rate": "18",
"recoil_shots_at_min_magnitude": "0",
My third request would be something that groups vehicle damage statistics with their resist type, like
"speed": "250",
"damage_radius": "2",
"damage_type": "Damage",
"damage": "700",
"damage_target_type": "2",
"damage_resist_type": "7",
"indirect_damage_max": "500",
"indirect_damage_max_range": "1",
"indirect_damage_min": "50",
"indirect_damage_min_range": "3",
"indirect_damage_target_type": "2",
"indirect_damage_resist_type": "6"
and, for bonus points, spitting out those resists by name along with resist-ID. This allows us to easily make tools that, say, check for which liberator noseguns do the most damage to a bastion hardpoint at a given range, including reload. Or what kills a mosquito faster, a deployed or undeployed Colossus cannon? (Undeployed, surprisingly. Different resists.)
These are obviously big asks, and I don't intend it to be all on you. I can't contribute right now, but I'm hoping someone else with more spare energy comes through and can help with this. Short term I will hack the queries together and can post those, but I don't know Auraxium enough to translate them yet.
from auraxium.
Thank you for the templates - I hope I can find some time to work on this later this month.
As for translating the queries - the auraxium.census
module is what generates the URLs, and it's interface is mostly a carbon copy of the API's structure; every API command has a corresponding method, and so on.
Moving between that and the object model is another matter that is currently woefully undocumented, though there is an introduction on the (work-in-progress) docs/rewrite branch (it uses references to external files so building that branch with Sphinx may be needed).
from auraxium.
Yeah, I think I understand the structure a bit better now that I've thought about it. I already knew it was probably due to their end and not yours.
I'm slowly trying to get the structure of the API for another project and once I do if I have time I'll start trying to implement some of these. I wish the game API wasn't quite so labrynthine, but I'm sure there are game engine reasons for it.
from auraxium.
Closing this issue as none of the WIP report systems were flexible enough to warrant the added complexity.
A manual way to create helper methods similar to those the original reports drafts has been documented on RTD and is both more performant and flexible than class-based reports.
Users looking to recreate a Reports-like class interface may create a dataclass and use a helper method as a class method factory.
from auraxium.
Related Issues (20)
- Reconsider object model getter helpers
- Note GainExperience quirks in documentation HOT 1
- Faction image_path missing HOT 1
- outfit.leader() -> Character or OutfitMember HOT 2
- ('experience_bonus',), 'msg': 'value is not a valid integer', 'type': 'type_error.integer'}])> HOT 2
- Improve error message when pydantic validation fails
- RTD broken link HOT 1
- Allow unsecured connections for expired API certs HOT 3
- WebSocket version migration HOT 1
- Support third-party fallback endpoints HOT 1
- Uncaught exception on await Character.items(): KeyError HOT 5
- README example is raising RuntimeError HOT 2
- Client.get_by_name not using name.first_lower HOT 3
- Ignoring Unsupported Payload (Continent Lock) HOT 1
- Move payload validation to OpenAPI spec
- ClientResponseError: 400, message='Bad Request' when querying census API HOT 4
- events.ContinentUnlock no longer exists HOT 1
- Unable to add World to Trigger filter HOT 4
- Support side-loading object model payload definitions
- Replace dict-helpers and proxy system with `.query()` factories
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auraxium.