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

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

Author:  thefox [ Fri Apr 27, 2012 11:28 pm ]
Post subject: 

Bananmos wrote:
Anyways, let me know if there's bugfixes/improvements to Tilificator I can do to help your effort. I'm really excited about your porting project, so I'd love to help out a bit if I can. :)

Well, here's a feature request: Would it be possible to add an option to not crop the images when using "Import sprite images"?

I'm converting this image (differences of the 2nd frame of Joe's face when compared to the 1st one), and when Tilificator crops it, it loses its positional information relative to the original image.

Image

EDIT: Also opening a project doesn't seem to work?
Code:
Traceback (most recent call last):
  File "tilificatorgui.py", line 486, in openWorkspace
  File "tilificatorgui.py", line 494, in openWorkspaceAs
  File "TilificatorProject.pyo", line 161, in readXML
  File "plistlib.pyo", line 78, in readPlist
  File "plistlib.pyo", line 406, in parse
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 0

Author:  Bananmos [ Sat May 12, 2012 5:49 pm ]
Post subject: 

Sorry for the very late response - my recent move to the UK kept me away from this board more than I had thought. :)

I have removed the cropping as requested, you can find a new Windows build here

About opening the project: you accidentally made Tilificator select the codepath for loading the old deprecated XML-based format that I was using before, probably because your project file did not use '.tpr' naming.

I switched to a JSON-based format before the first public release, and kept this support there just to be able to load my old files, and that codepath will probably be removed completely at some later point...

The choice of it trying to call the deprecated XML loading whenever the suffix is not .tpr wasn't the best one though, as your example shows. So I've also changed it to always use the JSON-codepath unless the filename matches the previous very long suffix that no one should be stumbling across accidentally...

Author:  thefox [ Sat May 12, 2012 10:22 pm ]
Post subject: 

Bananmos wrote:
The choice of it trying to call the deprecated XML loading whenever the suffix is not .tpr wasn't the best one though, as your example shows.

Yeah, I mean, I had no idea that .tpr was the recommended suffix, because the save dialog didn't automatically append it. So I've been using ".tilifactor". :) But thanks for the changes again!

Author:  Movax12 [ Sun Jun 17, 2012 10:41 pm ]
Post subject: 

I was interested in trying this but it doesn't seem to work.

Code:
Traceback (most recent call last):
  File "tilificatorgui.py", line 23, in <module>
  File "gtk\__init__.pyo", line 40, in <module>
  File "gtk\_gtk.pyo", line 12, in <module>
  File "gtk\_gtk.pyo", line 10, in __load
ImportError: DLL load failed: The specified procedure could not be found.


Do I need to install additional python stuff with the .exe version? Pop up windows claims it can't find an except(ion?) handler entry point in msvcrt.dll, but I don't think that is so important.

Author:  thefox [ Sat Aug 25, 2012 6:31 am ]
Post subject:  Re: New sprite conversion tool: Tilificator

DragQueen method crashes with this image (ShiftedRows works):

Image

Color size was set to 4.

Here's the log:
Code:
Traceback (most recent call last):
  File "tilificatorgui.py", line 316, in tilifyAll
  File "tilificator.pyo", line 76, in tilifySpriteImage
  File "tilingmethoddragqueen.pyo", line 213, in tilify
  File "tilingmethoddragqueen.pyo", line 109, in getOptimizedTilificationFromColumns
  File "tilingmethoddragqueen.pyo", line 600, in optimizeRows
  File "tilingmethoddragqueen.pyo", line 499, in reductionImpossible
  File "tilingmethoddragqueen.pyo", line 488, in minimumSpriteTilesNeededForRow
  File "tilingmethoddragqueen.pyo", line 337, in findLastNonBlankColumn
IndexError: list index out of range

Author:  tepples [ Sat Aug 25, 2012 9:36 am ]
Post subject:  Re:

Movax12 wrote:
Do I need to install additional python stuff with the .exe version?

You might need to install GTK. Do you have GIMP (GNU Image Manipulation Program) or Pidgin (multiprotocol chat client) installed?

Author:  thefox [ Sat Aug 25, 2012 10:32 am ]
Post subject:  Re:

Movax12 wrote:
Do I need to install additional python stuff with the .exe version? Pop up windows claims it can't find an except(ion?) handler entry point in msvcrt.dll, but I don't think that is so important.

You shouldn't have to install anything extra. What's the version of msvcrt.dll in your System32 or SysWOW64 directory?

Author:  Bananmos [ Wed Aug 29, 2012 4:35 pm ]
Post subject:  Re: New sprite conversion tool: Tilificator

thefox wrote:
DragQueen method crashes with this image (ShiftedRows works):

Image

Color size was set to 4.

Here's the log:
Code:
Traceback (most recent call last):
  File "tilificatorgui.py", line 316, in tilifyAll
  File "tilificator.pyo", line 76, in tilifySpriteImage
  File "tilingmethoddragqueen.pyo", line 213, in tilify
  File "tilingmethoddragqueen.pyo", line 109, in getOptimizedTilificationFromColumns
  File "tilingmethoddragqueen.pyo", line 600, in optimizeRows
  File "tilingmethoddragqueen.pyo", line 499, in reductionImpossible
  File "tilingmethoddragqueen.pyo", line 488, in minimumSpriteTilesNeededForRow
  File "tilingmethoddragqueen.pyo", line 337, in findLastNonBlankColumn
IndexError: list index out of range


Drat! Now fixed on the trunk in the latest commit.

Author:  thefox [ Mon Sep 10, 2012 2:38 am ]
Post subject:  Re: New sprite conversion tool: Tilificator

Bananmos wrote:
Drat! Now fixed on the trunk in the latest commit.

Thanks! Got another crash with this image. Dunno if it's because of the big size?

Code:
Traceback (most recent call last):
  File "tilificatorgui.py", line 316, in tilifyAll
    for progress in tilifySpriteImage(siw.spriteImage, self.tileTable):
  File "C:\Users\f\Desktop\tilificator-svn\trunk\tilificator.py", line 76, in tilifySpriteImage
    for progress in tilingMethod.tilify():
  File "C:\Users\f\Desktop\tilificator-svn\trunk\tilingmethoddragqueen.py", line 200, in tilify
    ycoordCombinationsMinimal[r] = self.getSpriteColumns(self.si, x)
  File "C:\Users\f\Desktop\tilificator-svn\trunk\tilingmethoddragqueen.py", line 362, in getSpriteColumns
    ycoordCombinations = self.genYCoords(buf, bufNext1, bufNext1[0]-self.settings.tileHeight+1)
  File "C:\Users\f\Desktop\tilificator-svn\trunk\tilingmethoddragqueen.py", line 354, in genYCoords
    tail = self.genYCoords(buf, bufNext1, y+self.settings.tileHeight)
  File "C:\Users\f\Desktop\tilificator-svn\trunk\tilingmethoddragqueen.py", line 354, in genYCoords
    tail = self.genYCoords(buf, bufNext1, y+self.settings.tileHeight)
  File "C:\Users\f\Desktop\tilificator-svn\trunk\tilingmethoddragqueen.py", line 355, in genYCoords
    nextRange = expandedProduct([y], tail)
  File "C:\Users\f\Desktop\tilificator-svn\trunk\common.py", line 115, in expandedProduct
    return [list(itertools.chain([sublist[0]], sublist[1])) if(type(sublist[1])==list or type(sublist[1])==tuple) else [subli
st[0],sublist[1]] for sublist in p]
MemoryError


Attachments:
cropped.png
cropped.png [ 4.42 KiB | Viewed 2349 times ]

Author:  Bananmos [ Mon Sep 10, 2012 4:49 pm ]
Post subject:  Re: New sprite conversion tool: Tilificator

Quote:
Thanks! Got another crash with this image. Dunno if it's because of the big size?


Most likely yes... the DragQueen method basically starts out by trying to test pretty much every combination of "columns variants", where the "column variants" are every way you can cover all pixels in an 8xScreenHeight column with 8x8 sprites without them overlapping. To avoid doing unreasonable amounts of combinations, the columns are reduced by selecting the "probably best ones" (basically a local optimization step, risking to miss out on the final global optimum) so that the final product of all of them doesn't go beyond a certain reasonable size. But the size of your image manages to make the column creation itself go out of memory. :)

I'll have a look at what can be done... probably a lot by just changing list comprehensions to iterators where possible. But even so, the processing time required to tilify that image will probably be enormous due to the large amount of combinations DragQueen tests. So I'd suggest just going with the ShiftedRows method for this particular one...

Author:  thefox [ Mon Sep 10, 2012 11:37 pm ]
Post subject:  Re: New sprite conversion tool: Tilificator

Bananmos wrote:
I'll have a look at what can be done... probably a lot by just changing list comprehensions to iterators where possible. But even so, the processing time required to tilify that image will probably be enormous due to the large amount of combinations DragQueen tests. So I'd suggest just going with the ShiftedRows method for this particular one...

Yeah and it turns out that I can't probably use that big of an image anyways, as it'll result in more than 64 sprite tiles. I guess I could try 8x16 sprites...

Author:  Bananmos [ Tue Sep 11, 2012 5:55 pm ]
Post subject:  Re: New sprite conversion tool: Tilificator

Haven't done anything to Tilificator yet, but I tried to have a go myself at converting that title picture of Superb Joe...

I choose a slightly different set of colors for the conversion. Also, there were two colors only used in a few pixels that were so close to other colors that I assume they were accidentally put there, and you wouldn't be able to use different ones when using the NES palette anyway, so I remapped those.

I started by making the reddish colors of the armor use the BG palette. Also, to not bump into the 8 sprites/scanline limit I had to use an extra BG palette for Joe's right hand, and figured I might as well use that palette for some other BG tiles to have a few sprites less. Got this result using NESST:
Image

Then, I used two separate sprite palettes for the skin and blue details:
Image

To avoid the memory constraints of DragQueen, I manually separated the skin/blue sprite overlays and split them vertically. I guess this is what Tilificator should be improved to do transparently when possible...

Result with Tilificator:

63 tiles and 65 sprites with ShiftedRows method.
58 tiles/sprites with DragQueen method, so no need for 8x16 sprites.

BG uses 118 tiles.

If you want some assistance, I could help you further with optimizing this to fit your title screen requirements, but I'll need to know which constraints you're working with. How does the rest of your title screen look? Do you want to implement some of the scrolling effects from the original game? (logo going in one direction, Suer Joe image and text in other directions) If so you probably need to use sprites exclusively for the top of Joe's head to be able to scroll Joe independently.

Author:  thefox [ Tue Sep 11, 2012 11:08 pm ]
Post subject:  Re: New sprite conversion tool: Tilificator

Bananmos wrote:
Haven't done anything to Tilificator yet, but I tried to have a go myself at converting that title picture of Superb Joe...

If you want some assistance, I could help you further with optimizing this to fit your title screen requirements, but I'll need to know which constraints you're working with. How does the rest of your title screen look? Do you want to implement some of the scrolling effects from the original game? (logo going in one direction, Suer Joe image and text in other directions) If so you probably need to use sprites exclusively for the top of Joe's head to be able to scroll Joe independently.

Nice results! The only real difference to the original I can see is the missing shading on the right (Joe's left) arm, but that's not a big deal.

As for constraints, there's nothing too special in the title screen, like in the original. I used two background palettes for the logo (just because of the light red line in it). I also need one color for the selection bullet point, but that can use a color from Joe's outfit, or wherever (color doesn't really matter). The font needs the white color, that can come from the logo palettes.

I'm up for implementing the scrolling effect. It looks like your version of big Joe already has the top 11 pixels of his head (re-)defined with sprites, so that could be enough for some overlap with the logo. Of course there also the option of not having overlap at all.

Author:  Bananmos [ Wed Sep 12, 2012 2:35 pm ]
Post subject:  Re: New sprite conversion tool: Tilificator

Quote:
The only real difference to the original I can see is the missing shading on the right


Doh! I must have mistakenly erased that while optimizing the image. Just got a bit carried away I suppose... :)

Took some time to optimize BG as well:
Image
Resulting in 98 tiles, that should give plenty of room for the logo and font.

Besides fixing the missing shading you mentioned, I also added a third sprite palette to have almost the entire of Joe's face available for overlap: (Incidentally, the pink color here is also the same as the one used for the selection bullet point you mentioned)
Image

Tile/sprite count went slightly up due to the additions, to 62 tiles/sprites. (no re-use of tiles) That leaves you with a very fine margin of 2 sprites for the bullet point and a sprite#0 hit. Again, I had to split the images vertically to avoid the memory error...

As for the scrolling effect, I can't imagine how you would manage to get all three independently moving objects from the original, so you'll probably need to compromise a bit. Maybe just remove the bottom text when the user presses start and the screen flashes, so that only the logo and Joe have to scroll?

Author:  thefox [ Wed Sep 12, 2012 3:57 pm ]
Post subject:  Re: New sprite conversion tool: Tilificator

Bananmos wrote:
...

Tile/sprite count went slightly up due to the additions, to 62 tiles/sprites. (no re-use of tiles) That leaves you with a very fine margin of 2 sprites for the bullet point and a sprite#0 hit. Again, I had to split the images vertically to avoid the memory error...

As for the scrolling effect, I can't imagine how you would manage to get all three independently moving objects from the original, so you'll probably need to compromise a bit. Maybe just remove the bottom text when the user presses start and the screen flashes, so that only the logo and Joe have to scroll?

Thanks man, that looks absolutely perfect! Can you send me the .tpr file of the sprite overlay?

For scrolling yeah it was my plan to scroll just Joe and the logo.

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