PoP 1 Sprites Conversion Tool

Discussions about all other tools (CusPop, SAV/HOF editors) and hex editing.
lvcabral
Vizier
Vizier
Posts: 115
Joined: March 11th, 2016, 10:34 pm

Re: PoP 1 Sprites Conversion Tool

Post by lvcabral »

salvadorc17 wrote:Good work with this, now the question will be if you want to expand engine with snes features...
I was thinking exactly about that (don't tell my wife, she "loves" my nights working on PoP) :)

I'm about to release the "Feature Complete" v0.12 this week, and will work on improving the collision/bumping algorithm to fix some remaining bugs.
After that I will consider look at SNES features.
User avatar
starwindz
Sultan
Sultan
Posts: 133
Joined: March 8th, 2009, 4:48 pm

Re: PoP 1 Sprites Conversion Tool

Post by starwindz »

Thank you very much for your great tool, SpritesConversionTool! :)
I have two questions and request for your work.

1. Can I include your tool(including modified version) to the next version of Total Pack?
2. Could you please explain the detailed algorithm of following two functions? I would like to understand your code.
internal static Boolean buildTile(Object[] files, string path, string output, int width = -1, int height = -1, bool relativeNegative = true)
private static Boolean buildDoor(Object[] files, string path, string output, int width = -1, int crop = -1)

Thank you so much again. :)
lvcabral
Vizier
Vizier
Posts: 115
Joined: March 11th, 2016, 10:34 pm

Re: PoP 1 Sprites Conversion Tool

Post by lvcabral »

starwindz wrote:Thank you very much for your great tool, SpritesConversionTool! :)
I have two questions and request for your work.

1. Can I include your tool(including modified version) to the next version of Total Pack?
2. Could you please explain the detailed algorithm of following two functions? I would like to understand your code.
internal static Boolean buildTile(Object[] files, string path, string output, int width = -1, int height = -1, bool relativeNegative = true)
private static Boolean buildDoor(Object[] files, string path, string output, int width = -1, int crop = -1)

Thank you so much again. :)
Answering your questions:

1. Yes, the project is licensed under MIT https://github.com/lvcabral/PoPSpritesC ... License.md

2. Both methods are similar, the buildDoor, is a little different to allow different cropping on some mods, here a quick overview of buildTile:

Boolean buildTile(Object[] files, string path, string output, int width = -1, int height = -1, bool relativeNegative = true)

The main objective of this method is to assemble a tile based on the different subparts.

Quick explanation of the parameters

files: this parameter should be an array with 'n' objects with 5 values each.
Like this example: {tilesPath, @"floor panels\normal base.bmp", new int[2] {0, 76}, true, true}
  • Index 0: path to the root of PR exported files
  • Index 1: relative path to the tile subpart bitmap file
  • Index 2: relative position (x,y) where this subpart will be painted
  • Index 3: when 'true' indicates that the subpart should have the background made transparent
  • Index 4: when 'true' the bitmap will use the palette from "level color variations.pal" extracted from Prince.DAT

path: the path where the png files should be saved
output the file name of the tile
width and height:
By the default sizes are: dungeon = 60x79 pixels, palace=64x79 pixels
If you pass the parameters you can set any size
relativeNegative: If 'true' the vertical position will be relative to the bottom of the tile (default option)

The Algorithm:

Create a bitmap object with the width and height
Loop for each object on the "files" array
  • Depending on the parameters will use the external or internal palette for transparency
  • Draw the subpart image on the relative position
Save the tile as a png image.
User avatar
starwindz
Sultan
Sultan
Posts: 133
Joined: March 8th, 2009, 4:48 pm

Re: PoP 1 Sprites Conversion Tool

Post by starwindz »

Thank yo so much for your kind and quick comment! :)

My intention is to make some kind of preview feature for each PoP1 mod in the Total Pack 4.0.
Please refer 4th screenshot of this link, viewtopic.php?f=123&t=3085&p=21010#p21010
Post Reply