PDA

View Full Version : New Character Creator - Alpha (Source included)



jdarling
27-09-2010, 08:13 PM
Like many on this board a long time enemy of mine has been placeholder (or programmer) art in my applications as I'm either too cheap or too untalented to actually get real artwork. I ran across a great site the other day for characters (http://silveiraneto.net/tag/pixelart/) and after some reading (and downloading) I realized that this guy had generated an almost perfect template for multiple different characters. The only problem (at least in my mind) was that the template was done in GIMP.

I'm no GIMP expert, and doing things in it takes me much longer than it should. So, being the awnery lil feller I am, I exported each layer of his graphics to a PNG file and then wrote a quick and dirty app to build characters from it. A bit of Google and some playing with basic math and I managed to add HSV adjustments to the editor. Now you can grab different building blocks, drop them into "layers" change the color/etc and export to a PNG for your own use.

Of course, you can also easily create new layers to be added.

Anyways, I'm posting the entire source as Open Source (not my fault if it formats your HD) for anyone to screw up. Hopefully this will be of some use to someone. If you make improvements that you want to share, post them here for others to make use of. If you make improvements and don't have a website to host them on, post the code changes here and I'll think about putting it into my build (:))

Anyways, download link: http://www.eonclash.com/charsbuilder/charsbuilder.zip

Screenie:

http://www.eonclash.com/charsbuilder/charsbuilder.png

Some planned updates:
Export frame information
Preview animations (as you can see from the icons and buttons)
More effects
Import/Export per Parts Bin entry
etc etc etc....

BTW: This should work on MAC, Linux, and Windows as I've done all I can to stay away from platform specific code!

- Jeremy

PS: Yes, I did take a bit of concept from Charas Character Creator.

AthenaOfDelphi
27-09-2010, 09:40 PM
To post images, check out this post:- http://www.pascalgamedevelopment.com/showthread.php?6029-Posting-Images

jdarling
27-09-2010, 09:47 PM
Thanks AOD, I'm sure I'm the only moron in the group, but the new board has been a hard move for me to make :(.

One upside I've found is not having to enter bbCode for URL's as they seem to get picked up automagically.

chronozphere
28-09-2010, 07:03 AM
Oh that's very nice. :) I'm not really working on something 2d now, but if I do, I'll have a close look at this. ;)

jdarling
28-09-2010, 06:35 PM
Made a few minor updates, added in RGB color shifting and (basic) Palette editing. Updated screenshot above, and posting a new Char from the builder for all to see:
http://www.eonclash.com/charsbuilder/char2.png

Updated zip has also been uploaded.

Enjoy,

farcodev
02-10-2010, 09:41 PM
cool and clean work :)

WILL
02-10-2010, 10:37 PM
Hey cool concept. If only I had such a thing for some of my older projects. Hmm... actually I was thinking about doing a somewhat retro style Castlevania style RPG not too long ago where you can change your clothes and general appearance. I wonder if this approach could be helpful. :)

chronozphere
02-10-2010, 11:41 PM
Would it be easy to create a new character with your editor, based on a template?

I'm curious about the workflow. Could you elaborate?

jdarling
04-10-2010, 12:52 PM
Would it be easy to create a new character with your editor, based on a template?

I'm curious about the workflow. Could you elaborate?

Thats the basic idea. The "templates" that are there now I grabbed from http://silveiraneto.net/tag/pixelart/ and broke each layer (in Gimp) from his images into a new PNG with full alpha. Then the app basically puts your select layers (in order) back together into a single image again. Of course allowing you to edit each layer. Granted you could do the same thing in Gimp, but I wanted something faster, easier, and lighter than Gimp.

You can add your own stuff and organize it by placing it into the partsbin directory (and sub directories) as you see fit. The app takes care of actually sizing the image, but doesn't do scaling (yet). I think I'm going to work on setting it up so you select a base body and then it attempts to scale the graphics appropriately. This way you could have multiple sets of graphics for different sized characters. Right now I'm working out using different scaling techniques so you can create larger/smaller versions of the given character without much trouble.

Hopefully this will be of some use to someone besides myself, but if not, I'm having fun with it for now :)

- Jeremy

Ñuño Martínez
06-10-2010, 12:32 PM
This seems great! I didn't downloaded it yet (I'm at job now) so I have few stupid questions.

Are the templates "fixed" or can add new ones? I'm thinking in some character templates I've seen in opengameart.org.

Is transparece set by alpha channel only or can define a "transparent colour" (i.e. pink)?

Does it support 8bpp sprites?

jdarling
06-10-2010, 04:09 PM
Are the templates "fixed" or can add new ones? I'm thinking in some character templates I've seen in opengameart.org.
You can add your own, just simple dump the 32 bit PNG file into the proper partsbin folder (or create new ones, add ones to existing etc) and it will be picked up the next time the app is run. All the exiting parts are for 105x210 images, but it should support just about anything.


Is transparece set by alpha channel only or can define a "transparent colour" (i.e. pink)?
Right now it only uses PNG's with Alpha channel (32 bit PNG). I've been thinking through ways to allow color key's and group parts by character size, though this will have to wait till I get other features done as its low on my totem poll.


Does it support 8bpp sprites?
See above response on import, but for export, you can save to any image format that FPC/Lazarus supports. Basically it just does a draw to the surface and then saves it with the default image streamer for the extension.

- Jeremy

PS: Thanks for the link to OpenGameArt.org hadn't seen that one before :)

Ñuño Martínez
07-10-2010, 07:13 AM
Thanks for the info. BTW I can use GIMP or TuxPaint to complete the spritework. ;)

I've tested it and I think I'll use it soon and often. :D But I've found two problems.

First, my Lazarus can't read property tvPartsBin.Options. May be you're using a different Lazarus, are you? Mine is 0.9.28.2-ubuntu beta.

The other is that it shows graphics "face-down" running it in Wine (http://www.winehq.org/). See the attached file. I've read something abaut this in the Lazarus' forums and FPC's mailing lists but can't remember what was the conclusion.

Anyway, everything else do work. :)

jdarling
07-10-2010, 12:21 PM
I'm running Lazarus 9.29.?? (rev 26163) with FPC 2.4.1, so yeah, there are new features that don't exist in the 9.28 builds.

Can't see your screen shot to see what your talking about with the "face down" part. If I get a chance I'll see if I can spin up a Linux install and try running the app in there. Since your using Ubuntu you can use APT package installs, maybe I should put one of those together for this project :)

- Jeremy

Ñuño Martínez
08-10-2010, 08:50 AM
Can't see your screen shot to see what your talking about with the "face down" part. If I get a chance I'll see if I can spin up a Linux install and try running the app in there.
I've found the thread at Lazarus forums about this "bug": Transparent PNG showed inverted in Wine ( TImage problem ) (http://www.lazarus.freepascal.org/index.php/topic,10353.0.html).

When a PNG picture with transparent color is loaded in a TImage,
the image is showed correctly in Windows XP, but is showed vertically
mirrored in Wine.

As I've read it's not only a Lazarus problem but WineHQ has a possible bug.


Since your using Ubuntu you can use APT package installs, maybe I should put one of those together for this project :)
Good luck: I've read how to build .deb packages and it's quite hard. Be careful with dependencies.

I'm sure some people will appreciate a .rpm package too. ::)