Randomly generate characters: Ideas/help

Status
Not open for further replies.

temmie

Villager
Member
Joined
Jan 26, 2017
Messages
10
Reaction score
0
First Language
english
Primarily Uses
Hello,

I have an idea: randomly generate characters made from the character generators. But, to be able to do it within certain parameters (ie: no green skin, no elf ears, no animal tail, etc.). I decided to post a thread about it, because I don't have the (necessary) skill in scripting to take on this task. Is there an existing plugin for this? Is there a way to do it without creating a giant database of randomly generated actors and saving each individual .png file?

Thanks!
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
876
Reaction score
581
First Language
English
Primarily Uses
RMMV
Auto dump a bunch of random generated pngs into a folder to use later, or just a character with dynamic random face and character parts?
I speak with words without knowledge when I say I could make this because this would be a heap dedicated tinkering for me. So far I've only wrote 3 scripts and they are novice. I just recently started learning some of the node.js (2 functions I know). The time could be a week yet. It could be a whole hair pulling month. I have no idea yet. It could even be impossible if somebody who knows the generator and canvas posts it after me.
I mean this is all the data that goes into a generated char.
PHP:
{
       "male": [{
           "gradient": {
               "2C80CB": {
                   "B": 203,
                   "G": 128,
                   "R": 44,
                   "index": 33
               },
               "4F413C": {
                   "B": 60,
                   "G": 65,
                   "R": 79,
                   "index": -1
               },
               "F9C19D": {
                   "B": 157,
                   "G": 193,
                   "R": 249,
                   "index": 47
               }
           },
           "layer": ["body"],
           "name": "body",
           "variation": 0
       }, {
           "gradient": {
               "F9C19D": {
                   "B": 157,
                   "G": 193,
                   "R": 249,
                   "index": 47
               }
           },
           "layer": ["face"],
           "name": "face",
           "variation": 1
       }, {
           "gradient": {
               "FCCB0A": {
                   "B": 10,
                   "G": 203,
                   "R": 252,
                   "index": 12
               }
           },
           "layer": ["fronthair", "fronthair1", "fronthair2"],
           "name": "frontHair",
           "variation": -1
       }, {
           "gradient": {
               "B892C5": {
                   "B": 197,
                   "G": 146,
                   "R": 184,
                   "index": 16
               },
               "FCCB0A": {
                   "B": 10,
                   "G": 203,
                   "R": 252,
                   "index": 12
               }
           },
           "layer": ["rearhair", "rearhair1", "rearhair2"],
           "name": "rearHair",
           "variation": -1
       }, {
           "gradient": {
               "FCCB0A": {
                   "B": 10,
                   "G": 203,
                   "R": 252,
                   "index": 12
               }
           },
           "layer": ["beard", "beard1", "beard2"],
           "name": "beard",
           "variation": -1
       }, {
           "gradient": {
               "F9C19D": {
                   "B": 157,
                   "G": 193,
                   "R": 249,
                   "index": 47
               }
           },
           "layer": ["ears"],
           "name": "ears",
           "variation": 0
       }, {
           "gradient": {
               "2C80CB": {
                   "B": 203,
                   "G": 128,
                   "R": 44,
                   "index": 33
               }
           },
           "layer": ["eyes"],
           "name": "eyes",
           "variation": 10
       }, {
           "gradient": {
               "F9C19D": {
                   "B": 157,
                   "G": 193,
                   "R": 249,
                   "index": 47
               },
               "FCCB0A": {
                   "B": 10,
                   "G": 203,
                   "R": 252,
                   "index": 12
               }
           },
           "layer": ["eyebrows"],
           "name": "eyebrows",
           "variation": 9
       }, {
           "gradient": {
               "F9C19D": {
                   "B": 157,
                   "G": 193,
                   "R": 249,
                   "index": 47
               }
           },
           "layer": ["nose"],
           "name": "nose",
           "variation": 5
       }, {
           "gradient": {
               "F9C19D": {
                   "B": 157,
                   "G": 193,
                   "R": 249,
                   "index": 47
               }
           },
           "layer": ["mouth"],
           "name": "mouth",
           "variation": 8
       }, {
           "gradient": {
               "009296": {
                   "B": 150,
                   "G": 146,
                   "R": 0,
                   "index": 62
               },
               "F9C19D": {
                   "B": 157,
                   "G": 193,
                   "R": 249,
                   "index": -1
               }
           },
           "layer": ["tattoo"],
           "name": "tattoo",
           "variation": -1
       }, {
           "gradient": {
               "D3CEC7": {
                   "B": 199,
                   "G": 206,
                   "R": 211,
                   "index": 22
               }
           },
           "layer": ["kemono"],
           "name": "kemono",
           "variation": -1
       }, {
           "gradient": {
               "E6D6BD": {
                   "B": 189,
                   "G": 214,
                   "R": 230,
                   "index": 4
               }
           },
           "layer": ["tail", "tail1", "tail2"],
           "name": "tail",
           "variation": -1
       }, {
           "gradient": {
               "A7D6D6": {
                   "B": 214,
                   "G": 214,
                   "R": 167,
                   "index": 60
               }
           },
           "layer": ["wing", "wing1", "wing2"],
           "name": "wing",
           "variation": -1
       }, {
           "gradient": {
               "1C76D0": {
                   "B": 208,
                   "G": 118,
                   "R": 28,
                   "index": 65
               },
               "AE8682": {
                   "B": 130,
                   "G": 134,
                   "R": 174,
                   "index": 57
               },
               "D9A404": {
                   "B": 4,
                   "G": 164,
                   "R": 217,
                   "index": 69
               },
               "FE9D1E": {
                   "B": 30,
                   "G": 157,
                   "R": 254,
                   "index": 58
               }
           },
           "layer": ["cloth", "cloth1", "cloth2"],
           "name": "cloth",
           "variation": 13
       }, {
           "gradient": {
               "A30708": {
                   "B": 8,
                   "G": 7,
                   "R": 163,
                   "index": 66
               },
               "D8AC00": {
                   "B": 0,
                   "G": 172,
                   "R": 216,
                   "index": 66
               }
           },
           "layer": ["cloak", "cloak1", "cloak2"],
           "name": "cloak",
           "variation": 0
       }, {
           "gradient": {
               "A4C911": {
                   "B": 17,
                   "G": 201,
                   "R": 164,
                   "index": 54
               },
               "D3CEC2": {
                   "B": 194,
                   "G": 206,
                   "R": 211,
                   "index": 65
               },
               "DA346E": {
                   "B": 110,
                   "G": 52,
                   "R": 218,
                   "index": 59
               }
           },
           "layer": ["acca"],
           "name": "accessoryA",
           "variation": -1
       }, {
           "gradient": {
               "4155B6": {
                   "B": 182,
                   "G": 85,
                   "R": 65,
                   "index": 67
               },
               "BA3B45": {
                   "B": 69,
                   "G": 59,
                   "R": 186,
                   "index": -1
               },
               "C0D3D2": {
                   "B": 210,
                   "G": 211,
                   "R": 192,
                   "index": 62
               },
               "C78407": {
                   "B": 7,
                   "G": 132,
                   "R": 199,
                   "index": 69
               }
           },
           "layer": ["accb"],
           "name": "accessoryB",
           "variation": -1
       }, {
           "gradient": {
               "999999": {
                   "B": 153,
                   "G": 153,
                   "R": 153,
                   "index": 69
               },
               "607E4B": {
                   "B": 75,
                   "G": 126,
                   "R": 96,
                   "index": 55
               },
               "CCBAD2": {
                   "B": 210,
                   "G": 186,
                   "R": 204,
                   "index": 64
               }
           },
           "layer": ["glasses"],
           "name": "glasses",
           "variation": -1
       }],
       "female": [{
           "gradient": {
               "2C80CB": {
                   "B": 203,
                   "G": 128,
                   "R": 44,
                   "index": -1
               },
               "4F413C": {
                   "B": 60,
                   "G": 65,
                   "R": 79,
                   "index": -1
               },
               "F9C19D": {
                   "B": 157,
                   "G": 193,
                   "R": 249,
                   "index": -1
               }
           },
           "layer": ["body"],
           "name": "body",
           "variation": 0
       }, {
           "gradient": {
               "F9C19D": {
                   "B": 157,
                   "G": 193,
                   "R": 249,
                   "index": -1
               }
           },
           "layer": ["face"],
           "name": "face",
           "variation": 0
       }, {
           "gradient": {
               "FCCB0A": {
                   "B": 10,
                   "G": 203,
                   "R": 252,
                   "index": -1
               }
           },
           "layer": ["fronthair", "fronthair1", "fronthair2"],
           "name": "frontHair",
           "variation": 0
       }, {
           "gradient": {
               "B892C5": {
                   "B": 197,
                   "G": 146,
                   "R": 184,
                   "index": -1
               },
               "FCCB0A": {
                   "B": 10,
                   "G": 203,
                   "R": 252,
                   "index": -1
               }
           },
           "layer": ["rearhair", "rearhair1", "rearhair2"],
           "name": "rearHair",
           "variation": 0
       }, {
           "gradient": {
               "FCCB0A": {
                   "B": 10,
                   "G": 203,
                   "R": 252,
                   "index": -1
               }
           },
           "layer": ["beard", "beard1", "beard2"],
           "name": "beard",
           "variation": -1
       }, {
           "gradient": {
               "F9C19D": {
                   "B": 157,
                   "G": 193,
                   "R": 249,
                   "index": -1
               }
           },
           "layer": ["ears"],
           "name": "ears",
           "variation": 0
       }, {
           "gradient": {
               "2C80CB": {
                   "B": 203,
                   "G": 128,
                   "R": 44,
                   "index": -1
               }
           },
           "layer": ["eyes"],
           "name": "eyes",
           "variation": 0
       }, {
           "gradient": {
               "F9C19D": {
                   "B": 157,
                   "G": 193,
                   "R": 249,
                   "index": -1
               },
               "FCCB0A": {
                   "B": 10,
                   "G": 203,
                   "R": 252,
                   "index": -1
               }
           },
           "layer": ["eyebrows"],
           "name": "eyebrows",
           "variation": 0
       }, {
           "gradient": {
               "F9C19D": {
                   "B": 157,
                   "G": 193,
                   "R": 249,
                   "index": -1
               }
           },
           "layer": ["nose"],
           "name": "nose",
           "variation": 0
       }, {
           "gradient": {
               "F9C19D": {
                   "B": 157,
                   "G": 193,
                   "R": 249,
                   "index": -1
               }
           },
           "layer": ["mouth"],
           "name": "mouth",
           "variation": 0
       }, {
           "gradient": {
               "009296": {
                   "B": 150,
                   "G": 146,
                   "R": 0,
                   "index": -1
               },
               "F9C19D": {
                   "B": 157,
                   "G": 193,
                   "R": 249,
                   "index": -1
               }
           },
           "layer": ["tattoo"],
           "name": "tattoo",
           "variation": -1
       }, {
           "gradient": {
               "D3CEC7": {
                   "B": 199,
                   "G": 206,
                   "R": 211,
                   "index": -1
               }
           },
           "layer": ["kemono"],
           "name": "kemono",
           "variation": -1
       }, {
           "gradient": {
               "E6D6BD": {
                   "B": 189,
                   "G": 214,
                   "R": 230,
                   "index": -1
               }
           },
           "layer": ["tail", "tail1", "tail2"],
           "name": "tail",
           "variation": -1
       }, {
           "gradient": {
               "A7D6D6": {
                   "B": 214,
                   "G": 214,
                   "R": 167,
                   "index": -1
               }
           },
           "layer": ["wing", "wing1", "wing2"],
           "name": "wing",
           "variation": -1
       }, {
           "gradient": {
               "1C76D0": {
                   "B": 208,
                   "G": 118,
                   "R": 28,
                   "index": -1
               },
               "AE8682": {
                   "B": 130,
                   "G": 134,
                   "R": 174,
                   "index": -1
               },
               "D9A404": {
                   "B": 4,
                   "G": 164,
                   "R": 217,
                   "index": -1
               },
               "FE9D1E": {
                   "B": 30,
                   "G": 157,
                   "R": 254,
                   "index": -1
               }
           },
           "layer": ["cloth", "cloth1", "cloth2"],
           "name": "cloth",
           "variation": 0
       }, {
           "gradient": {
               "A30708": {
                   "B": 8,
                   "G": 7,
                   "R": 163,
                   "index": -1
               },
               "D8AC00": {
                   "B": 0,
                   "G": 172,
                   "R": 216,
                   "index": -1
               }
           },
           "layer": ["cloak", "cloak1", "cloak2"],
           "name": "cloak",
           "variation": -1
       }, {
           "gradient": {
               "A4C911": {
                   "B": 17,
                   "G": 201,
                   "R": 164,
                   "index": -1
               },
               "D3CEC2": {
                   "B": 194,
                   "G": 206,
                   "R": 211,
                   "index": -1
               },
               "DA346E": {
                   "B": 110,
                   "G": 52,
                   "R": 218,
                   "index": -1
               }
           },
           "layer": ["acca"],
           "name": "accessoryA",
           "variation": -1
       }, {
           "gradient": {
               "4155B6": {
                   "B": 182,
                   "G": 85,
                   "R": 65,
                   "index": -1
               },
               "BA3B45": {
                   "B": 69,
                   "G": 59,
                   "R": 186,
                   "index": -1
               },
               "C0D3D2": {
                   "B": 210,
                   "G": 211,
                   "R": 192,
                   "index": -1
               },
               "C78407": {
                   "B": 7,
                   "G": 132,
                   "R": 199,
                   "index": -1
               }
           },
           "layer": ["accb"],
           "name": "accessoryB",
           "variation": -1
       }, {
           "gradient": {
               "999999": {
                   "B": 153,
                   "G": 153,
                   "R": 153,
                   "index": -1
               },
               "607E4B": {
                   "B": 75,
                   "G": 126,
                   "R": 96,
                   "index": -1
               },
               "CCBAD2": {
                   "B": 210,
                   "G": 186,
                   "R": 204,
                   "index": -1
               }
           },
           "layer": ["glasses"],
           "name": "glasses",
           "variation": -1
       }],
       "identity": "CharacterGeneratorSettings",
       "version": "1.0.0"
   }
All of those R G B make a color from RedGreenBlue. I think some of those properties are filenames for pngs of parts and 1-color pngs to shade with. So like user set min and max parameter on all those RGB? The way I'm thinking of is copy the generator parts folders to the game folder and delete the ones you don't want, but perhaps some might want the parts later maybe an exclude parts parameter . So like what kind of parameters are we talking about?

Setting all those parameters, it would almost be easier to just export a bunch of random generated people the default way. Then make it just kind of random with pages and variables. However I will tackle this require(canvas) conundrum of dynamic random people if we are serious.
 

Lantiz

Biterkid
Veteran
Joined
Dec 29, 2012
Messages
719
Reaction score
1,069
First Language
Portuguese
Primarily Uses
RMMV
I want to help but I didn't understand:
randomly generate characters made from the character generators
You mean made from generator parts?

Can you describe how would you use it? Not technically, just as a RPG Maker user.
I mean something like:

"My map has a NPC event with a note tag for his ActorID, when the map is loaded the character image is generated and set to the actor and the event graphic"

Got what I mean?

I'm asking it because when using generated images you'll also need to think about saving and loading them when the player does save or load the game. Would every new game have differect characters? Stuff like that...
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
876
Reaction score
581
First Language
English
Primarily Uses
RMMV
Deep into Pixi Texture and toss in the one ring.
 

temmie

Villager
Member
Joined
Jan 26, 2017
Messages
10
Reaction score
0
First Language
english
Primarily Uses
Can you describe how would you use it? Not technically, just as a RPG Maker user.
So, the idea for the mechanic in itself was independent of any real application, but one I could think of is a game that I was actually working on, but stopped because the lack of a function such as this put a huge stump in the game making process. The game is about the main character being tossed into an arena, and having to fight to stay alive. In theory, he could hire (randomly generated) actors from an inn in town, but I couldn't do that without the slow process of dumping a bunch of hand-made actors into a bunch of different .png's and saving every single animation.
 

temmie

Villager
Member
Joined
Jan 26, 2017
Messages
10
Reaction score
0
First Language
english
Primarily Uses
or just a character with dynamic random face and character parts?
Essentially, I don't want to have to save each individual .png, I just want to know if there is a way to randomly generate actors within the skin color parameters in-game.
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
876
Reaction score
581
First Language
English
Primarily Uses
RMMV
I've been frying my brain with tinkering, googling, testing half baked ideas (believe it or not I did a straight 6 hours with no lines of script sitting on my butt frustrated), but I just managed to make a character with two pieces of Generator parts using basic HTML canvas and none of the PIXIspaghetti or the MV equivalents of those functions that I once thought I could comprehend to make work.
Screen Shot 2017-02-03 at 11.07.58 PM.png
I also learned that I can scan the directory for random parts with node.js 'fs' for the other generator parts.
I'm going to bed right now, but I will be on the random part tomorrow. I can already see how to make this.
 

Lantiz

Biterkid
Veteran
Joined
Dec 29, 2012
Messages
719
Reaction score
1,069
First Language
Portuguese
Primarily Uses
RMMV
@temmie ah I meant the configuration.

If you can somehow create the images everytime the player loads his save file, I guess the best option would be to generate the images based on a seed for each actor. This way you would only need to store the actor seed and be able to recreate the images.
If not, you'll need to store too much image files for every save game and information regarding which image is from who.

My game is also based in procedural generation and I actually thought about doing it, and my conclusion is ahead:

I dont think it's worth the hassle.
They say for example that Starbound have procedural monsters, but if they were repeating like 20 of them I would not notice... it does not matter as long as the name and skills change. Anyway, it was developed with random generation in mind, not the case here and this changes everything.

Instead you could create a bunch of actors, randomize then and only generate the names. I think the replay value would be the same, most people would not notice much details.
An example here would be Interstellaria, you can see a lot of similar humans but you still know they are not the same and it's good to see them around anyway. They only have like 3 shirts, 3 pants and 3 hairs, alternating.

Lots of procedural generated games, mostly roguelikes, just change the graphics a bit and the colors, and although I don't know what it actually is, I'm sure there's a reason.
 

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,637
Reaction score
10,934
First Language
English
Primarily Uses
RMVXA

temmie, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


If you want to add something, just edit your earlier post.

And no, you cannot randomly generate characters in game. The game can only load up previously stored data, and the character generator does not function in game, only in the editor. There is no way round having all possible NPCs already included, and then having to use variables, conditionals etc to 'randomly' pick one of them.
 

temmie

Villager
Member
Joined
Jan 26, 2017
Messages
10
Reaction score
0
First Language
english
Primarily Uses
I'm going to bed right now, but I will be on the random part tomorrow. I can already see how to make this.
Thank you! Keep me updated.
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
876
Reaction score
581
First Language
English
Primarily Uses
RMMV
I stayed up late fumbling around with this script. So yesterday I added one static piece after a mind burgling day of research into the PIXI texture js. This time I added a bunch of pieces dynamically from a comment meta. This character looks random, but it's still just calling the pieces.
Screen Shot 2017-02-05 at 2.22.56 AM.png
These pieces are just called from the event comment or actor notes.
Screen Shot 2017-02-05 at 2.23.17 AM.png

Those numbers are the little _p01 numbers on the pieces. It also takes game variables. So it can be made random that way. It takes Hue so far for color, but I want to add Saturation/Lightness/Intensity options too. Still working on it. I'll fumble this thing finished maybe sooner than I predicted. I want to do sv battlers and faces too.

EDIT: Day #3
I thought I had it more buffered out, but it turns out I don't understand the generator layering at all. I just add the pieces on a load listener using the ImageManager blt function and they are falling into disorder.
Screen Shot 2017-02-06 at 12.23.02 AM.png
I tried to preload the whole 900 odd pngs Generator folders at the beginning, but there is an annoying Loading screen. Still tinkering. Always fumbling. I got 375 lines of javascript so far; my biggest MV script. The blt works better than the context drawImage function I was using, though it set me back a few hours switching my script to it.

EDIT: Day#4
I'm playing around with the generator just to learn the layer order. It seems to be added in this order.
PHP:
var parts = [
   // "wing/cloak piece#2 bottom",
   // "gender/body",
   "Rear Hair",
   "Face",
   "Facial Mark",
   "Nose",
   "Mouth",
   "Glasses",
   "Accessory 1",
   "Front Hair",
   "Eyes",
   "Ears",
   "Beast Ears",
   "Beard",
   "Clothing",
   "Accessory 2",
   "Cloak",
   "Wing",
   "Tail"
];
That's where 0 is the bottom, and the higher in the array the higher the layer. I may need to adjust this, but I'm going to try this and play around with it. I only hope that there are no layer exceptions for certain pieces. That will complicate my job.
EDIT-3: Yes, this seems to be the correct order of things. I now load the pieces incrementally. I no longer have the weird hair on top of hats and wings/cloaks on the front.
Screen Shot 2017-02-06 at 5.55.41 PM.png Screen Shot 2017-02-06 at 5.55.28 PM.png
However whatever I did is causing a new "Heisenbug" that only one generator character can load the parts. The skin color works on the other generator characters, but now all of them, but 1 turn out naked.
Edit-4 I half fixed this problem. Now it draws all the parts from comments for each character, but now it draws them on all of the characters labeled for generator parts. Each character is now a stack of all the characters.
Screen Shot 2017-02-07 at 12.05.59 AM.png
 
Last edited:

temmie

Villager
Member
Joined
Jan 26, 2017
Messages
10
Reaction score
0
First Language
english
Primarily Uses
EDIT: Day#4
I'm playing around with the generator just to learn the layer order. It seems to be added in this order.
My bad, I wasn't able to get online for the past few days. So, in essence, you've scripted a function that can call character generator parts into the game? Or am I getting that wrong?

"Heisenbug"
Lmao


Edit-4 I half fixed this problem. Now it draws all the parts from comments for each character, but now it draws them on all of the characters labeled for generator parts. Each character is now a stack of all the characters.
In the case where I need it, this is definitely a huge roadblock.
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
876
Reaction score
581
First Language
English
Primarily Uses
RMMV
Yes I got it working yesterday, but it was loading all the parts onto all the generated characters and not just its own parts/character.

Right now I've got to totally redo the script, because I got an idea to preload all the parts coming into a map, but then game variables have to be set for variable parts before coming into a map which isn't handy, so now I have to completely rewrite it to back the way it was and also find out why it loads all the parts onto all the identical bitmaps. I may have to tinker with the cache keys so each new bitmap has its own key, which may be another whole day of tinkering and learning.

EDIT: Day #6. I just now fixed the bug that loaded the pieces on all the generator characters. I simply Bitmap blt'd all the done-loading images onto a base and then I converted the base's canvas to a base64 URL with toDataURL and set that as the character bitmap URL, and then I dispose of the base. Now your generator characters have individuality.

Screen Shot 2017-02-08 at 3.47.21 PM.png

Now that I've learned this, the random part and face characters and sv battlers should be a piece of cake. I just need to get started.
Sorry for taking so long, but this is how I write... very fumblingly...

EDIT-3: Still haven't done random pieces other than through random set game variables, but I've perfected the color pixel manipulation for hue/saturation/lightness on each individual piece, from event comment / actor note.

Screen Shot 2017-02-08 at 6.15.23 PM.png

The math was already there in rpg_core Bitmap rotateHue, which only did hue. All I had to do was copy that function and add a sat 0 - 240 and lum 0 - 100 percent argument, with 50 being default. Unfortunately I don't know contrast tho. I'm not even going to attemp that, now that I know it has to be mathed one pixel at a time.

There is also a gender parameter optional for each individual piece, so you can put female/kid parts on a male body and vice versa. I'm not sure if many kid parts will translate position wise on the adult bodies, but that can be done too.

EDIT-4: I've made a random character, yepper! I've added a tag parameter random and if used on a character's part tags, it will pick a random part from the generator folder. It will just be random every time it appears.
Screen Shot 2017-02-08 at 7.24.36 PM.png makes => Screen Shot 2017-02-08 at 7.24.15 PM.png Screen Shot 2017-02-08 at 7.35.04 PM.png Screen Shot 2017-02-08 at 7.25.40 PM.pngScreen Shot 2017-02-08 at 8.25.59 PM.png
To make a random character still be the same character when you come back, you'd use random game variables using $gameVariables.value(number) in the tag. It seems like a lot to type for a variable. Maybe I'll shorten it to an alias.

If used in the hue: sat: lum: part "random" will generate random numbers between 360 , 240, and 100.
 
Last edited:

temmie

Villager
Member
Joined
Jan 26, 2017
Messages
10
Reaction score
0
First Language
english
Primarily Uses
@mogwai Awesome! Thank you for taking the time to create something like this. I've never written code in anything outside of Lua, and even then I didn't finish learning/get a full grasp of it, so I apologize if I sound kinda dumb here. Is this in plugin format? Or is it an event "Run Script" command?

Also, going back to what the mod said earlier in this thread, I think the generator parts are independent of the game files themselves, so if we were to run this commercially, would it need to pull the individual generator .png parts from a local folder?
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
876
Reaction score
581
First Language
English
Primarily Uses
RMMV
This will be a plugin, and then all the parameters will be set in event comments or actor notes.Screen Shot 2017-02-09 at 6.15.13 AM.png

On the morning of day#7 after burgling all night to perfect the generated charsets, I also just now started on the Faceset and it seems to be coming along a lot faster than the characters, but now I just need to study the generator folder because there appears to be a little bit more middle shuffling than I know. It'll do eventually. I just wanted to post a picture, because I think it looks funny.

EDIT-2: I got the layer order straight kinda. The face pieces come in sets of 2-4. I'm just assuming they all go on the same layer, but there may need to be more sorting. I'm not sure if it's my random piece picker or if faces are sometimes going behind hair or something, but it's hit and miss. I will get this sorted out.
Screen Shot 2017-02-09 at 7.58.33 AM.png Screen Shot 2017-02-09 at 7.59.04 AM.png Screen Shot 2017-02-09 at 7.58.18 AM.png

Edit-3: I think I've mastered the face graphic. The missing face was just aesthetic overlap of RearHair2 pieces which have a back. It was nothing beyond my comprehension of fixing, like if I broke the cache or something. I probably need to tweak facesets more, but right now I'm moving onto the SV battlers.

Screen Shot 2017-02-09 at 9.36.07 PM.png Screen Shot 2017-02-09 at 8.47.16 PM.png

EDIT-4: I've been tinkering all day, but I think I'm pseudo finished. I did actor faces, message faces, charsets, and sv battlers. It looks like I'm all done except for some testing. I also want to make a demo game to show how to use it. All the default hairs are blond so I need to explain the HSL parameters.

Soon.

I still have a lot of debugging to do. Oh boy!
 
Last edited:

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
876
Reaction score
581
First Language
English
Primarily Uses
RMMV
Monday EDIT: My question to the forum moderators:
Can I copy this post and paste it as a thread in the completed plugins forum? I mean it's redundant, but it's not exactly a double post. I'm just proud of my new script and I want to share it where people are looking for plugins.


CharacterFromGeneratorParts.js

I know I have the last post in this thread, but I want to post and also bump the thread with my announcement. @temmie

I've been working on this script since I posted last on that Thursday and I think I finally hammered out a functional first version.

To generate a character, you must set its character image file to one of these. It can just be named these; it doesn't have to be these exact files, but these visually signify the generated characters from the regular ones.
  • /img/sv_actors/$Is_Generator_Battler.png for SV Battlers
  • /img/characters/$Is_Generator_Char.png for Characters
  • /img/faces/$Is_Generator_Face.png for Faces



You'll need to copy the folder called Generator with the part images from your RMMV folder to your game /img/ folder too.

The first and foremost parameter to use is <gender:value> value can be male, female, or kid, or also 0 for male, 1 for female, and 2 for kid. Gender is basically also the body. You can add hue, sat and lum to that tag to change the skin color.

<part:random hue:random sat:random lum:random> random for a value will set any parameter to random based on its attribute. It will be random every time. It may be better to use var() and set a Game Variable to random that way.

For example Game Variables #5 - #8 to use its value <part:var(5) hue:var(6) sat:var(7) lum:var(8)>

To add a part to one of these $generator image characters, just list any of these tags in the event comment (flow control Page1) or the Actor Note in the database. It goes <part:number hue:number sat:number lum:number gender:value> Hue, sat, and lum are Hue Saturation and Lightness (Luminance). Gender the attribute of a parameter will uses a trans part from another folder, example a female character with <beard:5 gender:male> can have a beard from the male parts. Those are optional. To use a parameter, all you really need is part name and number. The number is the little p01 - p02 on the generator image.
PHP:
| - - - - - - - - - - - - - - - - - - - - - - - - -|
|------------------- Folder /TV -------------------|
| Charset Male  "Front Hair"      <fronthair:1-17> |
| Charset Male  "Rear Hair"        <rearhair:1-18> |
| Charset Male  "Beard"               <beard:1-11> |
| Charset Male  "Facial Mark"    <facialmark:1-8>  |
| Charset Male  "Beast Ears"      <beastears:1-6>  |
| Charset Male  "Tail"                 <tail:1-6>  |
| Charset Male  "Wing"                 <wing:1-5>  |
| Charset Male  "Clothing"         <clothing:1-23> |
| Charset Male  "Cloak"               <cloak:1-4>  |
| Charset Male  "Accessory 1"    <accessory1:1-8>  |
| Charset Male  "Accessory 2"    <accessory2:1-8>  |
| Charset Male  "Glasses"           <glasses:1-5>  |
| - - - - - - - - - - - - - - - - - - - - - - - - -|
| Charset Female  "Front Hair"    <fronthair:1-15> |
| Charset Female  "Rear Hair"      <rearhair:1-20> |
| Charset Female  "Facial Mark"  <facialmark:1-7>  |
| Charset Female  "Beast Ears"    <beastears:1-6>  |
| Charset Female  "Tail"               <tail:1-6>  |
| Charset Female  "Wing"               <wing:1-5>  |
| Charset Female  "Clothing"       <clothing:1-26> |
| Charset Female  "Cloak"             <cloak:1-4>  |
| Charset Female  "Accessory 1"  <accessory1:1-7>  |
| Charset Female  "Accessory 2"  <accessory2:1-10> |
| Charset Female  "Glasses"         <glasses:1-6>  |
| - - - - - - - - - - - - - - - - - - - - - - - - -|
| Charset Kid  "Front Hair"       <fronthair:0-22> |
| Charset Kid  "Rear Hair"         <rearhair:0-22> |
| Charset Kid  "Ears"                  <ears:2-2>  |
| Charset Kid  "Facial Mark"     <facialmark:3-4>  |
| Charset Kid  "Clothing"          <clothing:0-22> |
| Charset Kid  "Accessory 1"     <accessory1:1-6>  |
| Charset Kid  "Accessory 2"     <accessory2:1-4>  |
| Charset Kid  "Glasses"            <glasses:1-1>  |
| - - - - - - - - - - - - - - - - - - - - - - - - -|
|------------------ Folder /TVD -------------------|
| Fallen Male  "Front Hair"       <fronthair:1-17> |
| Fallen Male  "Rear Hair"         <rearhair:1-18> |
| Fallen Male  "Beard"                <beard:1-11> |
| Fallen Male  "Facial Mark"     <facialmark:1-8>  |
| Fallen Male  "Beast Ears"       <beastears:1-6>  |
| Fallen Male  "Tail"                  <tail:1-6>  |
| Fallen Male  "Wing"                  <wing:1-5>  |
| Fallen Male  "Clothing"          <clothing:1-23> |
| Fallen Male  "Cloak"                <cloak:1-1>  |
| Fallen Male  "Accessory 1"     <accessory1:1-8>  |
| Fallen Male  "Accessory 2"     <accessory2:1-8>  |
| Fallen Male  "Glasses"            <glasses:1-5>  |
| - - - - - - - - - - - - - - - - - - - - - - - - -|
| Fallen Female  "Front Hair"     <fronthair:1-15> |
| Fallen Female  "Rear Hair"       <rearhair:1-20> |
| Fallen Female  "Facial Mark"   <facialmark:1-7>  |
| Fallen Female  "Beast Ears"     <beastears:1-6>  |
| Fallen Female  "Tail"                <tail:1-6>  |
| Fallen Female  "Wing"                <wing:1-5>  |
| Fallen Female  "Clothing"        <clothing:1-26> |
| Fallen Female  "Cloak"              <cloak:1-4>  |
| Fallen Female  "Accessory 1"   <accessory1:1-7>  |
| Fallen Female  "Accessory 2"   <accessory2:1-10> |
| Fallen Female  "Glasses"          <glasses:1-6>  |
| - - - - - - - - - - - - - - - - - - - - - - - - -|
| Fallen Kid  "Front Hair"        <fronthair:0-22> |
| Fallen Kid  "Rear Hair"          <rearhair:0-22> |
| Fallen Kid  "Facial Mark"      <facialmark:3-4>  |
| Fallen Kid  "Clothing"           <clothing:0-22> |
| Fallen Kid  "Accessory 1"      <accessory1:1-6>  |
| Fallen Kid  "Accessory 2"      <accessory2:1-4>  |
| Fallen Kid  "Glasses"             <glasses:1-1>  |
| - - - - - - - - - - - - - - - - - - - - - - - - -|
|------------------ Folder /Face ------------------|
| Face Male  "Face"                    <face:1-12> |
| Face Male  "Front Hair"         <fronthair:1-17> |
| Face Male  "Rear Hair"           <rearhair:1-18> |
| Face Male  "Beard"                  <beard:1-11> |
| Face Male  "Ears"                    <ears:1-2>  |
| Face Male  "Eyes"                    <eyes:1-27> |
| Face Male  "Eyebrows"            <eyebrows:1-19> |
| Face Male  "Nose"                    <nose:1-13> |
| Face Male  "Mouth"                  <mouth:1-15> |
| Face Male  "Facial Mark"       <facialmark:1-8>  |
| Face Male  "Beast Ears"         <beastears:1-6>  |
| Face Male  "Clothing"            <clothing:5-23> |
| Face Male  "Cloak"                  <cloak:1-4>  |
| Face Male  "Accessory 1"       <accessory1:1-8>  |
| Face Male  "Accessory 2"       <accessory2:1-8>  |
| Face Male  "Glasses"              <glasses:1-5>  |
| - - - - - - - - - - - - - - - - - - - - - - - - -|
| Face Female  "Face"                  <face:1-7>  |
| Face Female  "Front Hair"       <fronthair:1-15> |
| Face Female  "Rear Hair"         <rearhair:1-20> |
| Face Female  "Ears"                  <ears:1-2>  |
| Face Female  "Eyes"                  <eyes:1-20> |
| Face Female  "Eyebrows"          <eyebrows:1-10> |
| Face Female  "Nose"                  <nose:1-13> |
| Face Female  "Mouth"                <mouth:1-13> |
| Face Female  "Facial Mark"     <facialmark:1-7>  |
| Face Female  "Beast Ears"       <beastears:1-6>  |
| Face Female  "Clothing"          <clothing:5-26> |
| Face Female  "Cloak"                <cloak:1-4>  |
| Face Female  "Accessory 1"     <accessory1:1-7>  |
| Face Female  "Accessory 2"     <accessory2:1-10> |
| Face Female  "Glasses"            <glasses:1-6>  |
| - - - - - - - - - - - - - - - - - - - - - - - - -|
| Face Kid  "Face"                     <face:1-1>  |
| Face Kid  "Front Hair"          <fronthair:0-22> |
| Face Kid  "Rear Hair"            <rearhair:0-22> |
| Face Kid  "Ears"                     <ears:0-2>  |
| Face Kid  "Eyes"                     <eyes:0-15> |
| Face Kid  "Eyebrows"             <eyebrows:0-14> |
| Face Kid  "Nose"                     <nose:0-3>  |
| Face Kid  "Mouth"                   <mouth:0-16> |
| Face Kid  "Facial Mark"        <facialmark:1-4>  |
| Face Kid  "Clothing"             <clothing:5-22> |
| Face Kid  "Accessory 1"        <accessory1:1-6>  |
| Face Kid  "Accessory 2"        <accessory2:1-4>  |
| Face Kid  "Glasses"               <glasses:1-1>  |
| - - - - - - - - - - - - - - - - - - - - - - - - -|
|------------------- Folder /SV -------------------|
| Battler Male  "Front Hair"      <fronthair:1-17> |
| Battler Male  "Rear Hair"        <rearhair:1-18> |
| Battler Male  "Beard"               <beard:1-11> |
| Battler Male  "Facial Mark"    <facialmark:1-8>  |
| Battler Male  "Beast Ears"      <beastears:1-6>  |
| Battler Male  "Tail"                 <tail:1-6>  |
| Battler Male  "Wing"                 <wing:1-5>  |
| Battler Male  "Clothing"         <clothing:1-23> |
| Battler Male  "Cloak"               <cloak:1-4>  |
| Battler Male  "Accessory 1"    <accessory1:1-8>  |
| Battler Male  "Accessory 2"    <accessory2:1-8>  |
| Battler Male  "Glasses"           <glasses:1-5>  |
| - - - - - - - - - - - - - - - - - - - - - - - - -|
| Battler Female  "Front Hair"    <fronthair:1-15> |
| Battler Female  "Rear Hair"      <rearhair:1-20> |
| Battler Female  "Facial Mark"  <facialmark:1-7>  |
| Battler Female  "Beast Ears"    <beastears:1-6>  |
| Battler Female  "Tail"               <tail:1-6>  |
| Battler Female  "Wing"               <wing:1-5>  |
| Battler Female  "Clothing"       <clothing:1-26> |
| Battler Female  "Cloak"             <cloak:1-4>  |
| Battler Female  "Accessory 1"  <accessory1:1-7>  |
| Battler Female  "Accessory 2"  <accessory2:1-10> |
| Battler Female  "Glasses"         <glasses:1-6>  |
| - - - - - - - - - - - - - - - - - - - - - - - - -|
| Battler Kid  "Front Hair"       <fronthair:3-22> |
| Battler Kid  "Rear Hair"         <rearhair:0-22> |
| Battler Kid  "Ears"                  <ears:2-2>  |
| Battler Kid  "Facial Mark"     <facialmark:3-4>  |
| Battler Kid  "Clothing"          <clothing:0-22> |
| Battler Kid  "Accessory 1"     <accessory1:1-6>  |
| Battler Kid  "Accessory 2"     <accessory2:1-4>  |
| Battler Kid  "Glasses"            <glasses:1-1>  |
| - - - - - - - - - - - - - - - - - - - - - - - - -|

Those folders are the part number ranges, but these parameters in comments/notes will control all 3 character, battler, and face.

Message faces take some extra parameters to change the face parts live. If you are using the $generator face image, to generate a face, end the message with \[face] and that mark will activate the generated face. It generates from the event notes, but you can also add the part parameters in the message after \[face] like <eyes:5><mouth:10> to change their expression. <event:id>or<actor:id> where id is the EV001 number or the Actor 1-4, if that particular person is also a generator char. It doesn't work on regular characters, but use the built in way for those faces, duh.

script download (my wordpress) : http://jakeis.com/rpg_maker_scripts/CharacterFromGeneratorParts.js
it's also attached to this post

demo game: https://drive.google.com/open?id=0B5Wl5t3fnFXGd2JOUHBtdnFBZDA (.zip)
Edit: I had to re-upload the demo game. The script is still ok, but I actually found a part where I was using my own parameters wrong making my example of said parameters wrong.

There is one more parameter <down> and it will make a TVD fallen character instead of a TV regular character.
There is more in the demo game.

This does not replace the actual character generator for efficiency, but if you come across a random character that you like, you can save all the generated bitmaps to a folder by running this function in the F8 key Dev Tools console.
Code:
generatorSpecs.savePreviewed();
It will only save the ones that are ready. If you've seen a character or face, it will save those, because they are cached.
 

Attachments

Last edited:

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
876
Reaction score
581
First Language
English
Primarily Uses
RMMV
I just want to bump this thread one more time because I have a better solution and you have not yet replied.

(the thread was backed up to page three and there are lack of other other posters for me to follow up after)

I just learned that my script and the demo will only work on Mac because I had another script using the same node.js "fs" functions fail on Windows. I corrected that script and I will correct this generator parts script for Windows too if you are still interested in it.

However, I discovered a better script since I made this and it will even work on iPhones and Androids which is something my little script is incapable of. It's called SRD Character Creator by @SumRndmDde and here is a link to that thread.
 

temmie

Villager
Member
Joined
Jan 26, 2017
Messages
10
Reaction score
0
First Language
english
Primarily Uses
and you have not yet replied.
Sorry, I wasn't able to get to a computer for the past few days. I'm happy to see so much progress made and that you took a serious interest in the idea!@ Thank you man, I'll test it out when I get some time (probably never), and I'll let you know how it goes. Thank you!
 

Meh

Villager
Member
Joined
Oct 20, 2015
Messages
27
Reaction score
24
First Language
Meep
Primarily Uses
RMMV
I just want to bump this thread one more time because I have a better solution and you have not yet replied.

(the thread was backed up to page three and there are lack of other other posters for me to follow up after)

I just learned that my script and the demo will only work on Mac because I had another script using the same node.js "fs" functions fail on Windows. I corrected that script and I will correct this generator parts script for Windows too if you are still interested in it.

However, I discovered a better script since I made this and it will even work on iPhones and Androids which is something my little script is incapable of. It's called SRD Character Creator by @SumRndmDde and here is a link to that thread.
Hey man, I've just came across this thread and you what you've done.
SumRndmDde's Character Creator Ex is amazing and may work on mobile, but it isn't random, which yours is!
This is something I need, I'll be testing it tomorrow in my game. I hope still works
Thanks for all your hard work
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Hey people! What do you think about a core plugin? This will save some lines of code that I repeatedly use in all my plugins...
Wondering if I should make my enemies scale in my non-linear rpg. I'm leaning towards yes, but I don't want to use Yanfly's plugin...
French folk trying to pronounce English words. I loved how the man pronounced squirrel as 'square friend'.
Therapist: any questions? Me: Yeah, are there actually people who think Hotel California is about drugs and not fame or are people just trying to upset me?
Therapist: They WHAT?
It's interesting. There are no safety hazards in our country, but if you look at the shelves in supermarkets, you'd say there's a zombie apocalypse here.

Forum statistics

Threads
94,592
Messages
922,147
Members
124,461
Latest member
ppkvvet
Top