It is currently Mon Oct 23, 2017 3:47 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 64 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
PostPosted: Sun Feb 05, 2012 3:30 pm 
Offline

Joined: Wed Mar 09, 2005 9:08 am
Posts: 348
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!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 05, 2012 5:22 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19122
Location: NE Indiana, USA (NTSC)
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 06, 2012 8:21 pm 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 930
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!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 09, 2012 1:09 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2963
Location: Tampere, Finland
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.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 09, 2012 2:30 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7235
Location: Chexbres, VD, Switzerland
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.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 09, 2012 2:57 pm 
Offline

Joined: Wed Mar 09, 2005 9:08 am
Posts: 348
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... ;)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 09, 2012 3:17 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7235
Location: Chexbres, VD, Switzerland
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.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 09, 2012 3:48 pm 
Offline

Joined: Wed Mar 09, 2005 9:08 am
Posts: 348
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?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2012 5:55 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7235
Location: Chexbres, VD, Switzerland
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.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2012 6:47 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19122
Location: NE Indiana, USA (NTSC)
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?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2012 9:33 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2963
Location: Tampere, Finland
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2012 1:26 pm 
Offline

Joined: Wed Mar 09, 2005 9:08 am
Posts: 348
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2012 2:14 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7235
Location: Chexbres, VD, Switzerland
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%

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2012 2:57 pm 
Offline

Joined: Wed Mar 09, 2005 9:08 am
Posts: 348
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...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 11, 2012 4:55 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7235
Location: Chexbres, VD, Switzerland
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 :(

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 64 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group