-
Notifications
You must be signed in to change notification settings - Fork 4
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
support parsing data from .graal files #12
Comments
This relates to issue #12. I've assembled some reference levels that can be used to verify the parser (at least for tile data). This should also help for adding support for the older ".graal" format.
This relates to issue #12. I've assembled some reference levels that can be used to verify the parser (at least for tile data). This should also help for adding support for the older ".graal" format.
Nothing is hooked up to this, so no exporting to png just yet. But its close! With a test level that doesn't have any repeating tiles as input, the parser is able to fill out a full board without overflowing, and correctly identifies the cut off between tile data and other level data. Levels feature repeating tiles, however, crash. There is enough here that I could try to hook it up to the image converter stuff later and see if the output is anywhere near correct. This might also engender refactoring the nw parser a bit and providing a common base class between the two. This relates to issue #12.
There is now a common level class, and an Actor class. This commit also moves a lot of scarping functionality off of nw_parser.py into the common.py module, so that it can be used by other formats. The two current parsers are not interchangable just yet, but this is really close to being able to parse the tile data from some .graal formatted levels. This, unfortunately introduces a bug, where seteffect images (or maybe just all npcs) don't show up in the final render. This relates to issue #5, and to issue #12.
I started refactoring the project so that the .nw and .graal parsers all use a common base class (see issue #5).
|
The DotGraalParser now populates its board. So, now some levels are renderable with the now inaccurately named nw2png.py script. This is, however, but close. The output is wrong, because it assumes the tile encoding would have something in common with the .nw format, but copying the four lines for that didn't have the desired effect. This relates to issue #12.
Removed the weird interlacing scheme that NW had, and now test.graal renders correctly. Relates to issue #12.
It was using the tile index instead of the tile value. It looked right for some values :) because the test maps have a similar layout. This is still wrong, but its less wrong at least. Relates to issue #12.
The first 32 tiles parsed from the test map looks like this... seems... wrong :| |
From poking around with a hex editor, the following is immediately apparent:
GR-V1.03
chr(10)
seems to maybe be used as a delimiter.I found this page, which has some code that claims to be able to decode the level data,
but in reading through it, it doesn't seem like it should work at all - only 3 bits are left over in each "code", which is very much not enough space for the actual sprite index.edit they're being clever with loops.Perhaps the useful take-aways from that link are this:
To take a wild guess, I think a plausible version of this is:
The text was updated successfully, but these errors were encountered: