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

KeyError during AoE2DE asset conversion on macOS M2 #1701

Open
ZzzhHe opened this issue Oct 17, 2024 · 1 comment
Open

KeyError during AoE2DE asset conversion on macOS M2 #1701

ZzzhHe opened this issue Oct 17, 2024 · 1 comment
Labels
area: assets Involved with assets (images, sounds, ...) bug Behaving differently as it should behave lang: python Done in Python code

Comments

@ZzzhHe
Copy link

ZzzhHe commented Oct 17, 2024

Hi! I'm encountering an issue while trying to run openage with Age of Empires 2: Definitive Edition. After successfully building the project, I initiated the game launch, but the conversion process fails with a KeyError related to the effect_apply_type during metadata conversion.

I downloaded AoE2DE through the SteamCMD command app_update 813780 validate according to the documentation.

Operating system: macOS 14
System architecture: ARM64 (Apple Silicon M2)
C++ Compiler: AppleClang 16.0.0
Python Version: Python 3.11.5

❯ ./run main
INFO [py] launching openage v0.5.3-460-ga3df3071
INFO [py] compiled by AppleClang 16.0.0.16000026
INFO [py] running in DEVMODE
INFO [py] openage nyan API modpack is up to date
  Do you want to convert assets? [Y/n]
> Y

openage requires a local game installation for conversion
but no local installation could be found automatically.
  Do you want to download the AoC trial version? [Y/n]
> N
Could not find any installation directory automatically.
Please enter an AOE2 install path manually.
> /Users/Programming/Steam/AoE2
converting from '/Users/Programming/Steam/AoE2'
INFO [py] Looking for compatible games to convert...
INFO [py] Compatible game edition detected:
INFO [py]  * Age of Empires 2: Definitive Edition
INFO [py] converting metadata
Traceback (most recent call last):
  File "run.py", line 20, in init run
    main()
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/__main__.py", line 168, in main
    return args.entrypoint(args, cli.error)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/main/main.py", line 84, in main
    convert_assets(asset_path, args)
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/convert/main.py", line 121, in convert_assets
    convert(args)
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/convert/tool/driver.py", line 35, in convert
    convert_metadata(args)
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/convert/tool/driver.py", line 72, in convert_metadata
    gamespec = get_gamespec(args.srcdir, args.game_version, not args.flag("no_pickle_cache"))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/convert/service/read/gamedata.py", line 47, in get_gamespec
    gamespec = load_gamespec(empiresdat_file,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/convert/service/read/gamedata.py", line 102, in load_gamespec
    _, gamespec = wrapper.read(file_data, 0, game_version, dynamic_load=dynamic_load)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/convert/value_object/read/genie_structure.py", line 133, in read
    offset, gen_members = self._read_multisubtye(
                          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/convert/value_object/read/genie_structure.py", line 309, in _read_multisubtye
    offset, gen_members = new_data.read(raw, offset, game_version, new_data_class)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/convert/value_object/read/genie_structure.py", line 133, in read
    offset, gen_members = self._read_multisubtye(
                          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/convert/value_object/read/genie_structure.py", line 309, in _read_multisubtye
    offset, gen_members = new_data.read(raw, offset, game_version, new_data_class)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/convert/value_object/read/genie_structure.py", line 133, in read
    offset, gen_members = self._read_multisubtye(
                          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/convert/value_object/read/genie_structure.py", line 309, in _read_multisubtye
    offset, gen_members = new_data.read(raw, offset, game_version, new_data_class)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/convert/value_object/read/genie_structure.py", line 140, in read
    offset, gen_members, stop_reading_members = self._read_primitive(
                                                ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/convert/value_object/read/genie_structure.py", line 513, in _read_primitive
    lookup_result = var_type.entry_hook(result)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Programming/GitRepo/openage/.bin/usr-bin-clang++-release-Oauto-sanitize-none/openage/convert/value_object/read/read_members.py", line 314, in entry_hook
    raise KeyError("failed to find %s%s in lookup dict %s!" %
KeyError: 'failed to find -55 = -0x37 in lookup dict effect_apply_type!'
@heinezen
Copy link
Member

I think this might be caused by an update of DE2. I'll investigate...

@heinezen heinezen added bug Behaving differently as it should behave lang: python Done in Python code area: assets Involved with assets (images, sounds, ...) labels Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: assets Involved with assets (images, sounds, ...) bug Behaving differently as it should behave lang: python Done in Python code
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants