Mythruna
March 19, 2019, 10:27:36 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Even though I got the bullet...  (Read 4579 times)
pspeed
Administrator
Hero Member
*****
Posts: 5562



View Profile
« on: March 16, 2015, 01:00:24 AM »

So, even though I did end up buying Dragon Age (Amazon had it on sale + rewards points = free game)... I've still managed to make some progress on things.

On our previous episode, I was working on the character model stuff and revamping the design.  I had it to the point of being selected in the book UI and so on.

This weekend I played with adding the parameterized parts like body type, hair color, etc... in a more general way that can apply to not just the avatar but any character model I want to use.  The models are defined in groovy scripts and so can be customized as needed (some models require fixing in order to work properly).

For example, a really simple script might look like this:
Code:
charModel( "human-male" ) {
    asset = "Models/male/human-male.j3o"

    onModelLoad {
        def hair = it.child("Hair")
        hair.transparent = true
        hair.move(0, -0.04f, 0.1f)
    }
}

charModel( "human-female" ) {
    asset = "Models/female-parts.j3o"

    onModelLoad {
        it.child("hair1").transparent = true   
    }   

}

That defines two character model types along with model to load and each of them tweaks the model a little bit to make them work properly.

But, you can also define runtime parameters that are exposed to the engine.  So if I want to give the female a hair color parameter, I can do something like this:
Code:
    parameter("HairColor") { ColorRGBA color ->
        def m = child("hair1").material       
        m.setColor( "Diffuse", color );
        m.setColor( "Ambient", color );
    }

That defines a parameter called "HairColor" that is type color.  When the HairColor is set, it looks up the right child object, grabs its material, and sets its colors.

To test all of this, I created another tester app for testing char models.

Here is a picture of that app with my test-female-model type loaded:


She has all of the parameters... hair color, body type, etc... actually, I added height later too but I didn't take pics of that.  In that pic, she's a little thicker than normal.

Here is the male model.  He doesn't have any parameters defined yet:


For fun I also loaded a rat model that I have:


One neat thing about this tester app is that I can edit the scripts at runtime and reload them without closing the app.  This is great for tweaking animation parameters and stuff.  Way more flexible than my old avatar tester.

For fun, I also added a Colored Rat with a color parameter.  Here is the regular rat again:


Here he is green:


Here I've given him a lighter color:


This kind of thing is great for creating a little variation in creatures.

There is still other stuff to add to the character model support in the long run (no animation support yet for example) but it's far enough along to get avatars working and that was my original point.  Hopefully this will also allow me to get the male model working properly without his head flying off.  Creating model-specific customizations is really easy now.

As a point of reference, I spent my free time Friday and Saturday creating this tester app and adding the right parameter support.  It only took me an hour then to get these models working in it and then it was just like playing.  Should be really helpful as I go along.
Logged
Michael Musgrove
Donators
Hero Member
***
Posts: 2157



View Profile WWW
« Reply #1 on: March 16, 2015, 04:06:04 AM »

Lovely. I'm enjoying the progress with the script support. Smiley
Logged

Visit my blog!
Visit my YouTube Channel!
Rayblon
Donators
Hero Member
***
Posts: 1837


One day I'll be a species in Mythruna...


View Profile
« Reply #2 on: March 16, 2015, 12:59:05 PM »

I'm totally gonna be a mouse when the character creation is released. Trololo
Logged


^Useful links^
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!