Comments (12)
Hi, can you please provide the replay file? DE support is a bit rough right now since there is not a lot of sample data available.
from aoc-mgz.
https://drive.google.com/open?id=1Oh8d8WSk0M44Qyk9q9T4qgD-oxsITlUA
I wanted to build an offline analytical tool, trying to parse the binary file.
from aoc-mgz.
Thanks for the rec. I've replicated the issue. Something has recently changed in the DE rec structure. I will attempt to update the parser.
from aoc-mgz.
I took a look at the rec. Player 2 is an AI, which changes how the initial struct is formatted (mgz/header/de.py
). I attempted a few things to get it working, but there's more complexity than I have time right now.
Human-only recs are working (I fixed a few other issues as indicated in my previous response).
from aoc-mgz.
Tried with this replay with a multiplayer 1v1 ranked de: https://drive.google.com/open?id=1k-61dFAEc-bFBqRfNEK22IwqXnn4ysMe
Got this exception:
Traceback (most recent call last):
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 2844, in _decode
return self.decoding[obj]
KeyError: 4
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 1042, in _parse
obj.append(self.subcon._parse(stream, context._, path))
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 311, in _parse
return self._decode(self.subcon._parse(stream, context, path), context)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 2849, in _decode
raise MappingError("no decoding mapping for %r" % (obj,))
construct.core.MappingError: no decoding mapping for 4
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 2784, in _parse
return self.subcon._parse(stream, context, path)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 867, in _parse
subobj = sc._parse(stream, context, path)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 1050, in _parse
raise RangeError("expected %d to %d, found %d" % (min, max, len(obj)))
construct.core.RangeError: expected 7 to 7, found 3
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 1042, in _parse
obj.append(self.subcon._parse(stream, context._, path))
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 2784, in _parse
return self.subcon._parse(stream, context, path)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 867, in _parse
subobj = sc._parse(stream, context, path)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 2788, in _parse
raise e.__class__("%s\n %s" % (e, path))
construct.core.RangeError: expected 7 to 7, found 3
(parsing) -> initial -> players -> attributes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 2784, in _parse
return self.subcon._parse(stream, context, path)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 867, in _parse
subobj = sc._parse(stream, context, path)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 1050, in _parse
raise RangeError("expected %d to %d, found %d" % (min, max, len(obj)))
construct.core.RangeError: expected 7 to 7, found 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "app.py", line 6, in <module>
header.parse_stream(data)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 171, in parse_stream
return self._parse(stream, context2, "(parsing)")
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 867, in _parse
subobj = sc._parse(stream, context, path)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 295, in _parse
return self.subcon._parse(stream, context, path)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 867, in _parse
subobj = sc._parse(stream, context, path)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 295, in _parse
return self.subcon._parse(stream, context, path)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\mgz\util.py", line 36, in _parse
return self.subcon._parse(new_stream, context, path)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 357, in _parse
return self.subcon.parse(data, context)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 158, in parse
return self.parse_stream(BytesIO(data), context, **kw)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 171, in parse_stream
return self._parse(stream, context2, "(parsing)")
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 867, in _parse
subobj = sc._parse(stream, context, path)
File "C:\Users\rajje\PycharmProjects\helloworld\venv\lib\site-packages\construct\core.py", line 2788, in _parse
raise e.__class__("%s\n %s" % (e, path))
construct.core.RangeError: expected 7 to 7, found 0
(parsing) -> initial
Process finished with exit code 1
from aoc-mgz.
Also, do you have a DE replay that works with this parser? Thanks for this work btw.
from aoc-mgz.
Hi, can you please provide the replay file? DE support is a bit rough right now since there is not a lot of sample data available.
What kind of sample data would you prefer?
Also, do you have a DE replay that works with this parser? Thanks for this work btw.
This one can be parsed successfully. (only summary
module, the parse_stream
seems to have some problems right now)
MP Replay v101.101.34793.0 @2020.02.13 213505 (1).zip
from aoc-mgz.
@chesteripz With the MP replay I linked, I'm getting an error while trying parse the header or the body using the following code:
from mgz import header, body
from os import fstat
with open('./mp-replay.aoe2record', 'rb') as data:
eof = fstat(data.fileno()).st_size
header.parse_stream(data)
while data.tell() < eof:
body.operation.parse_stream(data)
I'm on python @3.6.2
from aoc-mgz.
I'm tracking this issue. Thanks for reporting.
from aoc-mgz.
@rajjeet Took a look at your rec, mp-replay.aoe2record
. It's from an older version of DE. Commit 247c246 can parse it. DE rec formats change somewhat frequently and this module isn't backwards compatible (theoretically it could be, but that's more work than I care to do). I expect the format to stabilize soon anyway. Also, FYI, that rec is an unranked lobby-hosted 3v3, not a ranked 1v1. Sorry you're having so much trouble getting this to work!
@chesteripz By sample data I just mean recs, ideally in bulk. The rec you posted should work with parse_stream
, let me know what problem you're having.
from aoc-mgz.
When I try to use parse_stream
, I've got the same error
never mind, I opened the older file
from aoc-mgz.
Closing. Feel free to re-open if you're still experiencing an issue.
from aoc-mgz.
Related Issues (20)
- Decoding error when calling summary.Summary() HOT 3
- Unable to run any of the examples provided on the main page HOT 6
- construct.core.MappingError - Same error consistently HOT 2
- crash since v101.101.61591.0 - construct.core.MappingError: no decoding mapping for 8 HOT 2
- construct.core.MappingError: no decoding mapping for 8 HOT 1
- Parsing incorrect bytes when using summary snippet in README file HOT 4
- Unable to use JSON parser HOT 6
- collections.Hashable -> collections.abc.Hashable HOT 1
- RuntimeError: bad object parse HOT 11
- How to merge two games that share a common point? HOT 1
- Issue using parse_match() function in python 3.10 HOT 5
- how do you generate minimaps? HOT 2
- What is playback? HOT 2
- struct.error: unpack requires a buffer of 4 bytes HOT 1
- error: construct.core.PaddingError: subcon parsed more bytes than was allowed by length HOT 4
- RuntimeError: bad object parse HOT 2
- AI learning from recordings HOT 3
- Full summary isn't working HOT 5
- Consider add documentation? HOT 1
- Read chapter information HOT 2
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 aoc-mgz.