### Author Topic: Random portrait generator *Source Code Update*  (Read 16650 times)

#### RustKnight

• Newcomer
• Posts: 13
• Karma: +0/-0
##### Random portrait generator *Source Code Update*
« on: January 26, 2013, 07:14:04 PM »
If anyone chooses to work with this generator for his own game, please give us a haul on this thread.

Head here and check the latest post for the update. Keep link for future updates. (Also download the main generator files from mediafire and simply copy the updated EXE in the generator files)

http://www.ja-galaxy-forum.com/board/ubbthreads.php/topics/315255.html#Post315255 - Check for latest exe in the last replies.

http://www.mediafire.com/?thhvg6rjhhz4wk6 - Standard generator files

Would suggest to register and talk in about the generator if you have any feature request or questions regarding it.

So what's going on is pretty simple, I've known this generator for years yet only these days i thought someone could actually do something with it. I am currently in the development team down at the Ja 2 galaxy forum trying to expand it's functions and resources and possibly get my hands (in the future) on the source code of it (legally). Now i am posting my article that i wrote down on the Jagged Alliance 2 galaxy forum: -Source Code seems to be updated by Stucuk to meet our objectives.

(Here is the link to the tutorial topic for the program)

The matter at hand today is simple.
Random generated portraits. And i mean the professional ones.

These are the animations - there is some quality loss due to the video conversion (sorry, my fault) as you can see in contrast with the actual pictures.Also, didn't handle the frame sequence and looping too well, so some animations may seem screwy.

These upper portraits were created by me (through the generator) as trying to show some of the features: male, female, ape generator plus hats and torture marks. Two portrait was personally created while others were selected from a list of randomly generated portraits.

Here i want to show the color ability of the program, you can manipulate every color component, even more you have a random color button which changes colors randomly from a given set of list. In my perspective, just by playing with the random color button on a character changes the way it is expressed, and can also reflect age to a certain degree.

These sets of portraits were generated through preferences settings ( you can tell the generator what "pieces of facial characteristics, and clothes to use) making this tool pretty easy to handle.

Here i tried to create a biker stereotype (i included lots of facial hair, excluded some "soft" facial characteristics, and added hats) so that every time you create a random character, a biker stereotype is created. I didn't work too much on it, but enough to understand for a demonstration of what you can do:
AGAIN, i can't stress this enough; I did not create each picture you see, i just set the general rules for the generator, with what pieces to work with and then just pressed 3 buttons, and i've got 30 bikers, agents etc.

You name them

And these are some prisoners/slaves portraits

These other portraits (the two links under) were generated randomly and posted as they are here.

TO note - Quality is a bit dimmer since i am not so good at manipulating screen shots and such.
- Also, looking back, i can see not all the hair types manage to get in for the girls, total hair types being 20 in number.

A list of features from the generator:

a) A lot of variations on portraits
b) THEY. ARE. HAND-DRAWN. - this is the most important feature of all, since 3d rand-gen portraits are abundant, this one is unique
c) ANIMATED - lips, eyebrows, eyes.
d) Male, female and ape generator.
e) Features like tortured face marks, glasses, hats.

Another option the generator has is an ethnic criteria, being able to choose between arab, american or russian facial characteristics, thou don't expect for changes too radical. (Biggest contrast is between americans and russians, there are differences in beards, eyes and so forth; also arabs looks pretty much like US soldiers because they are mixed mercenaries, some white some with darker skin color)

Waiting comments on what you guys think about it, and if it could be of any use.

NOTE: The generator itself i talked about as for the artwork are NOT part of my work. The generator is maintained by STUCUK (forum administrator and patcher of Original War) as for the art itself being part of a game, Original War.
« Last Edit: February 09, 2013, 07:14:56 AM by RustKnight »

#### Quendus

• Rogueliker
• Posts: 447
• Karma: +0/-0
• $@ \in \{1,W\} \times \{1,H\}$
##### Re: Random portrait generator *Hand drawn*
« Reply #1 on: January 26, 2013, 08:05:23 PM »
Very nice. I've seen character-customising things in flash games and the results of similar technology in yahoo avatars, but I've never seen this kind of thing look good before. Impressive. If it had a website I would send a link to the curator of http://generatorblog.blogspot.co.uk/ .

What's your involvement with this thing?

#### RustKnight

• Newcomer
• Posts: 13
• Karma: +0/-0
##### Re: Random portrait generator *Hand drawn*
« Reply #2 on: January 26, 2013, 09:59:29 PM »
I just turned into it some years ago, picked it up these days, embarked on a project on expanding it. I do not own it, altar does along with the art work involved.
We are free to use it as we see fit in any non commercial games.
Might try to get my hands on the source code of the program, talking with former altar boys currently.
With or without source code, i am working on a mod to expand it's art features, I being more on the artist side then coding.
Will add new facial characteristics, clothes (piercings would be nice!) so that the new ones fit with the Jagged Alliance 2 portraits. (so to make it clear, i am sort of reproducing facial characteristics of the JA 2 portraits in the art style of the generator's art)

It's a long shot job, but at the moment i am just wondering if a coder, specially these kind (roguelike  kinds) could make use of it as it is.

As i said i have written tutorial you could check it out for refference, explains simple and a little more complex stuff.

#### Quendus

• Rogueliker
• Posts: 447
• Karma: +0/-0
• $@ \in \{1,W\} \times \{1,H\}$
##### Re: Random portrait generator *Hand drawn*
« Reply #3 on: January 26, 2013, 11:16:37 PM »
The program's mostly very usable, even without looking at the tutorial. The Czech (?) words everywhere can be a bit opaque, but they're mostly in places where the actual meaning isn't important.

It looks like there's no direct way to export whole portraits as images, just components?

#### RustKnight

• Newcomer
• Posts: 13
• Karma: +0/-0
##### Re: Random portrait generator *Hand drawn*
« Reply #4 on: January 26, 2013, 11:52:14 PM »
Not that i know, i think not.
I guess the only way is to save the gallery to .xgl and that's it.
I can understand your concern since if you can't export portraits, you can't make it useable for the game you want to integrate it.
Hm, really a problem.

#### Quendus

• Rogueliker
• Posts: 447
• Karma: +0/-0
• $@ \in \{1,W\} \times \{1,H\}$
##### Re: Random portrait generator *Hand drawn*
« Reply #5 on: January 27, 2013, 12:32:07 AM »
I can take screenshots of the default expression if I fancy doing extra work, but on the whole an XGL2PNG utility would be essential for efficient use of the program...

#### RustKnight

• Newcomer
• Posts: 13
• Karma: +0/-0
##### Re: Random portrait generator *Hand drawn*
« Reply #6 on: January 27, 2013, 02:43:22 PM »
So making such of a program is how hard?
I know you don't just clap your hands and that's that but it's just a conversion program.

What i get from your saying is that a "XGL to PNG" is crucial for an efficient integration of portraits into the game.

And besides that, could it be possible that at the end you have a game that generates portraits on the spot, random?
Say you meet NPCs or such, and they always have different faces?

My notions for coding are limited, thou i have a rough understanding of how possible or impossible is to program a certain feature; i somewhat limit myself to the art design sector only.

And as a sidenote, and i will stress it out on the starting of the topic, if anyone starts using this program for his own game, be it starting from scratch or adding it to an already functional one, please let me know.
I am just as happy as the person that will integrate this so i would really like to see what it's capable of.

In my opinion this would have been just crazy if it could have been used in Rogue Survivor...
Thou the creator sort of disappeared, and there is no source code of the game as far as i know.
« Last Edit: January 27, 2013, 02:45:45 PM by RustKnight »

#### Quendus

• Rogueliker
• Posts: 447
• Karma: +0/-0
• $@ \in \{1,W\} \times \{1,H\}$
##### Re: Random portrait generator *Hand drawn*
« Reply #7 on: January 27, 2013, 06:44:32 PM »
So making such of a program is how hard?
I know you don't just clap your hands and that's that but it's just a conversion program.
It probably wouldn't be difficult - apart from being in Czech, the XGL file format is very easy to understand. Writing a program that understands it will also be easy. To actually convert the gallery text to a picture, a program will need the original image data for each animation frame. There are two ways to do this - export every component as BMP (which is time consuming), or find out how to read the file format of the components (which might be difficult).

Unfortunately, if you export a component as BMP, you don't get the original image; you get the coloured version (try exporting the same hair when it's blue and when it's red - you get different images). It might be possible to get around this by colouring each component white, and then recolouring the white components according to specification, but I can't be sure that would make the portraits correctly.

All of this effort would be essentially duplicating the functionality of the portrait editor - one would prefer to simply use the editor's own code for this purpose, if possible.

Quote
What i get from your saying is that a "XGL to PNG" is crucial for an efficient integration of portraits into the game.

And besides that, could it be possible that at the end you have a game that generates portraits on the spot, random?
Say you meet NPCs or such, and they always have different faces?
There are a few ways you might go about this - You could just open the editor, generate 1000 faces according to your custom frequency settings, and use 1000 faces in the game. As the XGL file format is very compact, that would present no problems (provided you had an XGL->BMP converter).

Alternatively, you could duplicate not only the editor's graphical capabilities, but also its randomisation features. This would require quite a lot of effort, but wouldn't be impossible. Once again, it would be preferable to just use the program's original source code.

Quote
My notions for coding are limited, thou i have a rough understanding of how possible or impossible is to program a certain feature; i somewhat limit myself to the art design sector only.

And as a sidenote, and i will stress it out on the starting of the topic, if anyone starts using this program for his own game, be it starting from scratch or adding it to an already functional one, please let me know.
I am just as happy as the person that will integrate this so i would really like to see what it's capable of.

In my opinion this would have been just crazy if it could have been used in Rogue Survivor...
Thou the creator sort of disappeared, and there is no source code of the game as far as i know.
I might consider using this to generate some portraits for my current project; the character sprites I'm using do have associated portraits, but I think these could potentially be preferable.

#### RustKnight

• Newcomer
• Posts: 13
• Karma: +0/-0
##### Re: Random portrait generator *Hand drawn*
« Reply #8 on: January 27, 2013, 07:21:13 PM »
Quendus, i thank you for your time in making a little light into this matter.
Ultimately i would, as much as anyone else for that matter like to see this generator do it's job within a game.

Funny thing is most people choose to simply use the program to define a portrait for their own game. And thank God, the lucky part is, this art is somewhat obscure, as for the game itself.
Now of course i can understand why coders limit themselfs only to use pregenerated portraits; making your game code ingest this generator is difficult and tricky without the source code.

Speaking of which - i will try hard and with all my ability to negotiate for it.
But being the fact that i have to speak with a game company, makes things considerably difficult.

Although there has been a precedent created. Stucuk the one that is maintaining Original War has treated with Altar to let him maintain the game.
It's all on the subjective matter, if they feel like being nice, they will.
« Last Edit: January 27, 2013, 07:23:24 PM by RustKnight »

#### Quendus

• Rogueliker
• Posts: 447
• Karma: +0/-0
• $@ \in \{1,W\} \times \{1,H\}$
##### Re: Random portrait generator *Hand drawn*
« Reply #9 on: January 27, 2013, 07:32:27 PM »
In summary, This is a very nice library of images, and the program can be used to generate very nice portraits in a very customisable way, but the process is slow.
If work is done to duplicate the program's portrait display, then the process of generating fixed portraits will be sped up and will take less human time.
If work is done to duplicate the program's portrait randomiser, then any game could generate random portraits using an appropriate library of components.
However, that would amount to basically rewriting the whole tool - at least the parts we care about.

Although there has been a precedent created. Stucuk the one that is maintaining Original War has treated with Altar to let him maintain the game.
It's all on the subjective matter, if they feel like being nice, they will.
I don't know this game and I might be wrong, but this thread ( http://fractalsoftworks.com/forum/index.php?topic=2111.msg26277#msg26277 ) seems to say that XichtEd comes with unofficial patches (ie. wasn't made by Altar) and that its developer disappeared 7 years ago...?

#### RustKnight

• Newcomer
• Posts: 13
• Karma: +0/-0
##### Re: Random portrait generator *Hand drawn*
« Reply #10 on: January 27, 2013, 10:25:56 PM »
Don't worry, i know that what that thread contains even before opening it. I've read it myself. (bumping in the thread trying to find any other related information about the generator).
His information is misguided and wrong.
I talked directly to Stucuk, the one who released the tools in an unofficial patch and he said that Xichted is property of Altar.

Even so, i must urge you to talk privately on this matter, and so I've messaged you on this forum.

#### RustKnight

• Newcomer
• Posts: 13
• Karma: +0/-0
##### Re: Random portrait generator *Source Code Update*
« Reply #11 on: February 07, 2013, 06:45:49 PM »
Updated the article for those interested.
As i said in the main message, go on the JA 2 forum, search for the latest replies and get the latest EXE for the generator.

The rest of the files you will get from the download link.

#### Skeletor

• Rogueliker
• Posts: 579
• Karma: +0/-0
• villains ftw
##### Re: Random portrait generator *Source Code Update*
« Reply #12 on: February 08, 2013, 03:21:53 PM »
That's pretty awesome man!
What I enjoy the most in roguelikes: Anti-Farming and Mac Givering my way out. Kind of what I also enjoy in life.

#### RustKnight

• Newcomer
• Posts: 13
• Karma: +0/-0
##### Re: Random portrait generator *Source Code Update*
« Reply #13 on: February 09, 2013, 07:13:32 AM »
The reason i suggest to all interested to head down to the Ja 2 topic is that i can't get technical with explaining what has been changed source-wise with the generator in favor of integrating it in any game.

Those guys have things sorted out more or less and if you have the knowledge to ask the right questions and get into the debate you might even have requests handled.

For me, i am happy that i just burned down two forums with this subject because it simply deserves it (for the sake of this generator)! If i could have helped more than to put people into contact i would have already done it.