nesdev.com
http://forums.nesdev.com/

New sprite conversion tool: Tilificator
http://forums.nesdev.com/viewtopic.php?f=21&t=8589
Page 1 of 5

Author:  Bananmos [ Sun Feb 05, 2012 3:30 pm ]
Post subject:  New sprite conversion tool: Tilificator

Tilificator has now reached a state where it might actually be useful for other people.

Tilificator is a sprite conversion tool I wrote to try to solve an annoying problem I've always had with sprite graphics for the NES: How to create CHR and sprite data that re-uses CHR patterns and tries to minimize the sprites per scanline, without lots of repetitive effort.

To do this for you, it uses some clever heuristics, and a lot of brute-force, trading artist time for computer time. It's a work in progress, and will still produce bad results for some seemingly obvious cases. But it'll probably do the job better for big amounts of sprite data unless you're dedicated to hand-optimizing your sprites. :)

Have a try with it, and give me your feedback!

Author:  tepples [ Sun Feb 05, 2012 5:22 pm ]
Post subject: 

A long time ago, back in the first quarter of 2007, I had written a similar tool that only worked across, turning large (fighting-game-sized) characters into rows of 8x16 pixel sprites.

Andrew Davie wrote a similar tool called Objective

Author:  zzo38 [ Mon Feb 06, 2012 8:21 pm ]
Post subject: 

Tilificator is open-source and work with multiple targets (and runs on many operating systems, too). So, that is one advantage over using Objective. However, I see no command-line mode for Tilificator; but someone can add that if wanted.

But, good idea! Thank you!

Author:  thefox [ Thu Feb 09, 2012 1:09 pm ]
Post subject: 

Seems pretty nice, gotta try it some time. I wrote something similar myself, it handles layered sprites but it's much slower and doesn't do "global optimization" of the resulting tiles.

On a side note, not sure if you're aware of this, but the .zip contains the .svn directory.

Author:  Bregalad [ Thu Feb 09, 2012 2:30 pm ]
Post subject: 

Hey this looks pretty cool but unfortunately I have a problem running it.
I compiled/installed it successfully but when I try to run from the terminal I get some error.

Author:  Bananmos [ Thu Feb 09, 2012 2:57 pm ]
Post subject: 

Quote:
Seems pretty nice, gotta try it some time. I wrote something similar myself, it handles layered sprites but it's much slower and doesn't do "global optimization" of the resulting tiles.


Well, lack of what I would also call "global optimization" is the current limitation of Tilificator as well. While the 'TilingMethodDragQueen' is the most capable (albeit slowest) of the methods to choose from, each of the methods suffer from the limitation that they will process each image separately, and try to match it to the tile table already built. To get better results for the cases where the optimal tilification for one image actually gives a crappy match for a later one, there'd probably be a need for a pre-pass that looks for similarities in all images at once.

I have some ideas for how this could work, but no idea when I'd get the motivation to do so, considering how much time this "side-project" of mine has already eaten up :)

Quote:
On a side note, not sure if you're aware of this, but the .zip contains the .svn directory.


Indeed I am aware of this. I figured there'd be no point in removing it, since it means you can update your version from the trunk just by using tortoiseSVN. The release .zip was just there to provide some convenience for those that don't want to mess with versioning systems just to try it out.



Quote:
Hey this looks pretty cool but unfortunately I have a problem running it.
I compiled/installed it successfully but when I try to run from the terminal I get some error.


Heh, it would be much much easier to help you out if you could tell me what that "some error" actually was... ;)

Author:  Bregalad [ Thu Feb 09, 2012 3:17 pm ]
Post subject: 

That's what I wanted to do but this stupid terminal doesn't allow to copy/paste what is written in it and I can't dump it as text either !
Looks like I'll have to copy the error message by hand :(

It says :
Code:
Taceback (most recent call last):
  File "C:\[...]\tilificatorgui.py", line 23 in (module)
     import gtk, gobject, cairo, pango
  File "C:\python27\[...]\gtk\__init__.py", line 40, in (module)
     from gtk import _gtk
ImportError : DLL load failed: La procédure spécifiée est introvable.

Author:  Bananmos [ Thu Feb 09, 2012 3:48 pm ]
Post subject: 

Quote:
Taceback (most recent call last):
File "C:\[...]\tilificatorgui.py", line 23 in (module)
import gtk, gobject, cairo, pango
File "C:\python27\[...]\gtk\__init__.py", line 40, in (module)
from gtk import _gtk
ImportError : DLL load failed: La procédure spécifiée est introvable.


Hmm, that shows that PyGTK (the python interface to GTK+) is being found, but that one cannot find the .DLL files of GTK+. According to Google, this is usually caused by having installed multiple versions of GTK+, missing the GTK+ directory on the %PATH% system variable (which the all-in-one installer should have done for you), and other tricky issues.

Could you maybe give me some more info such as: exactly how you installed it, what your %PATH% variable is, what Windows version you're running, phase of the moon, etc?

Author:  Bregalad [ Fri Feb 10, 2012 5:55 am ]
Post subject: 

I installed it by using the 3 installers in the page you linked in your first post, and by following the instructions to run the install scripts from the terminal.

My %path% variable is.... long (agan I can't copy it form the terminal) but I don't find any python related path I think.

I use Windows 7 professional.

The moon was full 2 or 3 nights ago I think.

Author:  tepples [ Fri Feb 10, 2012 6:47 am ]
Post subject: 

Try Alt+Space E K, drag a box around what you want to copy, and press Enter. Then paste into Notepad. Does that still work in Windows 7?

Author:  thefox [ Fri Feb 10, 2012 9:33 am ]
Post subject: 

tepples wrote:
Try Alt+Space E K, drag a box around what you want to copy, and press Enter. Then paste into Notepad. Does that still work in Windows 7?

Thanks for this! Sometimes the right-click menu doesn't work on cmd.exe windows, I didn't know you could access the menu from the application menu/title bar as well.

Bananmos wrote:
Quote:
Taceback (most recent call last):
File "C:\[...]\tilificatorgui.py", line 23 in (module)
import gtk, gobject, cairo, pango
File "C:\python27\[...]\gtk\__init__.py", line 40, in (module)
from gtk import _gtk
ImportError : DLL load failed: La procédure spécifiée est introvable.


Hmm, that shows that PyGTK (the python interface to GTK+) is being found, but that one cannot find the .DLL files of GTK+. According to Google, this is usually caused by having installed multiple versions of GTK+, missing the GTK+ directory on the %PATH% system variable (which the all-in-one installer should have done for you), and other tricky issues.

Could you maybe give me some more info such as: exactly how you installed it, what your %PATH% variable is, what Windows version you're running, phase of the moon, etc?

I remember having the same problem with GTK some other time, not with Python though. Pretty sure it was caused by non-compatible version of GTK (libgtk*.dll) in Windows' System32/SysWOW64 directory.

Author:  Bananmos [ Fri Feb 10, 2012 1:26 pm ]
Post subject: 

Quote:
I remember having the same problem with GTK some other time, not with Python though. Pretty sure it was caused by non-compatible version of GTK (libgtk*.dll) in Windows' System32/SysWOW64 directory.


Yes, that could indeed be the case... I'd suggest doing a global search for libgtk*.dll across the file system and removing those, or at least renaming them temporarily.

Unless you changed this at installation, the proper .dll's should be in c:\gtk\bin, so also double check that your %PATH% environment includes this path.

Author:  Bregalad [ Fri Feb 10, 2012 2:14 pm ]
Post subject: 

The repertory c:\gtk doesn't even exist.

I have a load of libgtk-win32-2.0-0.dll files all over the place in my system though, namely in :
c:\program files\pigdin\gtk
c:\program files\common files\gtk\2.0
c:\python27\lib\site-packages\gtk2.0\runtime

I also have 2 times libgtkspell.dll in
c:\program files
c:\program files\pigdin

PS : I'm pretty sure none of those paths are in %path%

Author:  Bananmos [ Fri Feb 10, 2012 2:57 pm ]
Post subject: 

Quote:
The repertory c:\gtk doesn't even exist.


Pardon me for leading you on the wrong path (no pun intended) in this case. I realize now that my c:\gtk\bin directory is from some old installation and is not used by PyGTK.

My installation of PyGTK uses the .dll files under 'C:\Python27\Lib\site-packages\gtk-2.0\runtime\bin'. (did you just forget the '\bin' ending part in your post above?) I was also able to reproduce an error similar to yours by renaming the 'bin' directory to the dummy name 'binn':

Code:
Traceback (most recent call last):
  File "E:\rnb\tilificator\trunk\tilificatorgui.py", line 23, in <module>
    import gtk, gobject, cairo, pango
  File "C:\Python27\lib\site-packages\gtk-2.0\gtk\__init__.py", line 30, in <module>
    import gobject as _gobject
  File "C:\Python27\lib\site-packages\gtk-2.0\gobject\__init__.py", line 26, in <module>
    from glib import spawn_async, idle_add, timeout_add, timeout_add_seconds, \
  File "C:\Python27\lib\site-packages\gtk-2.0\glib\__init__.py", line 22, in <module>
    from glib._glib import *
ImportError: DLL load failed: The specified module could not be found


I could then restore the normal behavior by doing:

Code:
set PATH=C:\Python27\Lib\site-packages\gtk-2.0\runtime\binn;%PATH%


To make the dummy 'binn' directory name still be searched. Maybe you could try this to put the directory on the path explicitly? (even if it seems that is unnecessary on my system)

However, it's possible you must also make sure Windows cannot find any other conflicting .dlls, as specific directories (such as system,system32 etc) have priority over the ones in %PATH% in later Windows versions, IIRC...

Author:  Bregalad [ Sat Feb 11, 2012 4:55 am ]
Post subject: 

Don't worry I pardon you.
And yes I forgot the \bin\ in my previous post.

I tried adding the path to path specifically, but unfortunately I still get the same error :(

Page 1 of 5 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/