CreaturePack for Construct2

Discuss issues pertaining to the various game/web runtimes of Creature here.
Post Reply
servusdei
Posts: 5
Joined: Thu Dec 21, 2017 4:13 pm

CreaturePack for Construct2

Post by servusdei » Wed Apr 25, 2018 5:40 am

Hello,
would it be possible to support the new CreaturePack in the current C2 runtime ?
Thanks.

chong
Posts: 1178
Joined: Thu Feb 19, 2015 2:21 am

Re: CreaturePack for Construct2

Post by chong » Wed Apr 25, 2018 5:57 am

Hello,

I can take a look at it when I get the cycles. However, the WebGL runtimes all use a common core library so if you can find somebody with reasonable JS skills, I will be happy to point and guide that person in the right direction for porting.

Cheers

servusdei
Posts: 5
Joined: Thu Dec 21, 2017 4:13 pm

Re: CreaturePack for Construct2

Post by servusdei » Thu Apr 26, 2018 12:00 am

Thanks for the quick reply.

I know some JS (but got no webgl knowledge), so I tried to adapt the current C2 runtime to support the creature pack (CreaturePixiPackJSRenderer.js was helpful) .
This is what I've done so far : https://pastebin.com/VmvuCFv2
For my personal use, I only want the creature pack, so I deleted the json format support.

I test it, It works fine I guess, but the animations looks huge, I think because I'm missing this part :

Code: Select all


// Compute Pixel Scaling
var target_creature = this.creature_manager["target_creature"]; 
target_creature["ComputeBoundaryMinMax"]();
var mesh_size_x = target_creature["boundary_max"][0] - target_creature["boundary_min"][0];
var mesh_size_y = target_creature["boundary_max"][1] - target_creature["boundary_min"][1];

this.pixel_scale_x = 1.0 / mesh_size_x;
this.pixel_scale_y = 1.0 / mesh_size_y;
I didn't find the API to port this part.
I tried using this:
https://github.com/kestrelm/Creature_We ... e.js#L3080
But it deals with regions and I have no idea what that is.


My question is how to fix the scale of the animations ?

chong
Posts: 1178
Joined: Thu Feb 19, 2015 2:21 am

Re: CreaturePack for Construct2

Post by chong » Thu Apr 26, 2018 3:33 am

Hello,

Great progress! Please look at:
https://github.com/kestrelm/Creature_We ... ime.js#L99

You can reference how the pixel scale is computed in the Construct 2 runtime and follow the same pattern.

After that, remember to actually scale your vertices:
https://github.com/kestrelm/Creature_We ... me.js#L145

Cheers

Post Reply