Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2015-02-18 03:51:54

velcro4hair
New member
Registered: 2015-02-18
Post 1/3

pokecrystal: Image compression and map editor

Hello. I'm a long time lurker whose curiosity was piqued when I recently heard about the disassemblies of Pokemon Red and Pokemon Crystal. I decided to set up the repository for pokecrystal in a vm ubuntu environment, and I was able to confirm the majority of my setup by being able to run the makefile.
I decided that before I start trying to modify things I should make sure the pokemontools module works.

I am currently having trouble with setting up the map editor that is provided. I think one of the things I need to do is extract the compressed image files, which I know can be done with gfx.py. As far as I can tell this will only extract one file at a time. I was wondering if there was a way to quickly extract all of the .2bpp and .lz files into the png format (as opposed to one file at a time).

As for the map_editor, I am able to get it running, but when I attempt to open a map I get the following error:

kirby@ubuntu:~/pokecrystal$ python extras/pokemontools/map_editor.py
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1413, in __call__
    return self.func(*args)
  File "extras/pokemontools/map_editor.py", line 191, in open_map
    self.init_map()
  File "extras/pokemontools/map_editor.py", line 210, in init_map
    self.map = Map(self.map_frame, self.map_name, config=self.config)
  File "extras/pokemontools/map_editor.py", line 339, in __init__
    self.tileset_id = eval(self.tileset_id, self.config.constants)
AttributeError: Map instance has no attribute 'tileset_id'

I was wondering if anyone could help me with either of these issues. I apologize if these are already common knowledge, but I was unable to find anything on this particular issue myself. And of course thank you for your assistance.

Offline

#2 2015-02-18 04:59:48

comet
Member
Registered: 2012-04-09
Post 529/673

Re: pokecrystal: Image compression and map editor

velcro4hair wrote:

I think one of the things I need to do is extract the compressed image files, which I know can be done with gfx.py. As far as I can tell this will only extract one file at a time. I was wondering if there was a way to quickly extract all of the .2bpp and .lz files into the png format (as opposed to one file at a time).

It'll take as many as you throw at it. The map editor should also extract whatever it needs on the fly.

You're probably interested in having all the images as png though. There's a build target just for that. Run "make pngs".


The map headers have been changed to use a macro. The map editor was never changed to reflect that, mostly because no one uses it. Here's a quick fix: https://github.com/kanzure/pokemon-reve … ls/pull/88

Last edited by comet (2015-02-18 05:05:27)

Offline

#3 2015-02-18 21:31:13

velcro4hair
New member
Registered: 2015-02-18
Post 2/3

Re: pokecrystal: Image compression and map editor

I'm a bit new at using git, so I was wondering if I could get a bit of help with how to update the file based on the fix.

More importantly, I am curious as to how most people edit their maps. I'll try to learn how to use that method for simplicity's sake.

I also tried running "make pngs" at the root of pokecrystal and I got this error:
kirby@ubuntu:~/pokecrystal$ make pngs
find . -iname "*.lz"      -exec python extras/pokemontools/gfx.py unlz {} +
find . -iname "*.[12]bpp" -exec python extras/pokemontools/gfx.py png  {} +
Traceback (most recent call last):
  File "extras/pokemontools/gfx.py", line 1668, in <module>
    main()
  File "extras/pokemontools/gfx.py", line 1664, in main
    method(args.filenames)
  File "extras/pokemontools/gfx.py", line 1614, in convert_to_png
    export_2bpp_to_png(filename)
  File "extras/pokemontools/gfx.py", line 1135, in export_2bpp_to_png
    arguments.update(read_filename_arguments(filein))
  File "extras/pokemontools/gfx.py", line 1114, in read_filename_arguments
    w, h = argument.split('x')
ValueError: too many values to unpack
make: *** [pngs] Error 1

This is kind of what led me to believe I could only unpack 1 file at a time. I was wondering if I could also get help with this.

Offline

#4 2015-02-19 23:53:06

velcro4hair
New member
Registered: 2015-02-18
Post 3/3

Re: pokecrystal: Image compression and map editor

Okay, it looks like there was a fix for make pngs as well. The map editor is also functional now, but loading specific maps (routes 42 and 43 off the top of my head) causes an error. I remember these being rather large maps, so it may be a boundary thing.

In any case my previous question about how to edit maps stands (rather, what do people normally do). And also is GIMP a decent tool for editing the graphics on unix? Thanks for your help so far.

Offline

Board footer

Powered by FluxBB