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

Env-driven switch to stop rejecting AI players and team games #130

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Logg-y
Copy link
Collaborator

@Logg-y Logg-y commented Sep 26, 2024

As per our discussion, this adds env switches to allow non 1v1s and games containing AI players.

The env variables are:
RECPARSER_ACCEPT_AIS
RECPARSER_ACCEPT_TGS

Setting these to any truthy value will stop the parser rejecting the corresponding game types.

Caveats and further thoughts:

  • AI player containing games work only if hosted via multiplayer lobbies. This still lets you do 1v1 demos for build orders, but you HAVE to host them in multiplayer, else the profile keys are missing in the rec and parsing them will fail.
  • Is it worth adding a containsAIPlayers field to the parsing for the sake of DB queries? If you want to be able to filter these out, simply merging this as-is would not make an easy way to do that.

Copy link

vercel bot commented Sep 26, 2024

@Logg-y is attempting to deploy a commit to the erin-fitzpatric's projects Team on Vercel.

A member of the Team first needs to authorize it.

@erin-fitzpatric
Copy link
Owner

I understand that the AI games don't have all of the same fields to parse, but I think it still might be nice to accept them and just nullify the fields that are missing. Build orders are often made against AI.

@Logg-y
Copy link
Collaborator Author

Logg-y commented Sep 26, 2024

You can get games vs AI with intact metadata, as long as you host via a multiplayer lobby. This works even if it's just a 1v1 with AI, but has to happen through the multiplayer mode.

If hosted through singleplayer, all the metadata/profile keys are just flat out missing. It might be possible to retrieve a lot of the important ones from the "real" packed data - doing some little looking, the only one that's important and that probably can't be retrieved in any form is the player's rlinkid. The other really important stuff (game guid, player names/civs/map name) look like they exist in the binary data in a pretty easy places to find.

This would take a reasonable amount of turning the parsing logic on its head, but it is doable. In theory.

Copy link

vercel bot commented Nov 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aom-gg ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2024 2:28am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants