PhaserJS 2.4 released with integrated Creature support!

Discuss issues pertaining to the various game/web runtimes of Creature here.
chong
Posts: 1178
Joined: Thu Feb 19, 2015 2:21 am

Re: PhaserJS 2.4 released with integrated Creature support!

Post by chong » Mon Jun 12, 2017 7:15 pm

Hello,

Ok I will take a look at it soon. Should be fixable.
Can you please file a bug on the GitHub repository for me so that I can track it?

Update: I am going to enhance the blending functionality to bring it up to speed with the rest of the runtimes ( UE4, Unity etc. ) This means there will be "Autoblending" support, allowing you to smoothly transition between animations automatically. Stay tuned.

Cheers

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

Re: PhaserJS 2.4 released with integrated Creature support!

Post by chong » Tue Jun 13, 2017 4:25 am

Update: You can sync up with the latest github.

Auto Blending is in: ( This feature is ported in from the UE4 and Unity Creature runtimes )

Code: Select all

// First enable auto blending, call this once
new_manager.SetAutoBlending(true);

// Now transition to a new animation clip. 
// In this case we are transitioning to a clip called "back" smoothly with a delta of 0.1. 
// The delta is a value > 0 and < 1.
new_manager.AutoBlendTo("back", 0.1);
I assume this is what you want, it enables you to smoothly transition between animations. I also fixed quite a few bugs with the code for blending and deformations so you can try out the new runtime update:
https://github.com/kestrelm/Creature_WebGL

Cheers

zampano
Posts: 70
Joined: Wed Jun 07, 2017 3:37 pm

Re: PhaserJS 2.4 released with integrated Creature support!

Post by zampano » Tue Jun 13, 2017 12:23 pm

Wow, you're quick! That's great! :)

It's not so good though that it's still using a very old Phaser Build (2.2.2) instead of 2.8.0 or - even better - phaser-creature v2.8.0, which prevents it from working with my code.
I think this here is the version where most of the crucial changes were made:
http://phaser.io/download/release/2.7.0

I think they've already fixed some of those things to make it work in their creature.js in the same folder which is as far as I can tell gl-matrix and CreatureMeshBone in one file.

Also, there seems to be a type in the PhasorDemo file:
game.load.text('iceJSON', 'iceAnchorExport_character_data.json');
instead of
game.load.text('iceJSON', 'iceDemonExport_character_data.json');

thanks for your effort :)

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

Re: PhaserJS 2.4 released with integrated Creature support!

Post by chong » Tue Jun 13, 2017 3:29 pm

Hello,

Actually those changes were in the core library of Creature, not the Phaser front end. The core library encompasses all of the JS implementations, not just Phaser.
Which means you can most probably just take those changes and modify the new version to use the backend.

In any case, I will take a look at porting it over to Phaser 2.8 soon.

Cheers

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

Re: PhaserJS 2.4 released with integrated Creature support!

Post by chong » Wed Jun 14, 2017 3:21 am

Hello,

Pleased sync up again for the latest changes. I downloaded the latest Phaser 2.8 CE and patched in some changes, the version now on the Creature GitHub is 2.8.0 I believe ( you can check the comments on top):
https://raw.githubusercontent.com/kestr ... haser-2.js

Anyway, please sync up and give it a go.

Cheers

zampano
Posts: 70
Joined: Wed Jun 07, 2017 3:37 pm

Re: PhaserJS 2.4 released with integrated Creature support!

Post by zampano » Wed Jun 14, 2017 11:25 am

Okay, so this kind of works.
You still got the typo in the PhasorDemo, but when corrected it plays properly. I was a little confused with all the files and because I am using the implementation that phaser suggests, the file you just updated is of no immediate use for me.

I am however considering to just use your approach and write a few functions myself that would simplify the use of the creature code a little (the way phaser-creature does), since the creature-enabled phaser 2.8.0 is also a bit complicated to set up.

So I think I'll be better off just using the regular phaser 2.8.0 with your additional js files and a few custom functions. That way it will also be way easier to update if you would do other fixes or additions at any point in the future.
So thank you for the quick help :)

zampano
Posts: 70
Joined: Wed Jun 07, 2017 3:37 pm

Re: PhaserJS 2.4 released with integrated Creature support!

Post by zampano » Wed Jun 14, 2017 2:06 pm

I implemented it to my game and everything is great. Except for one little thing.

I use WEBGL_MULTI instead of WEBGL, which results in the texture being displayed broken. In your example (Phaser-Demo.html), the problem is not very noticeable, only in the flames above the head can you see some missing polygons. In my animation, I am missing the entire background (which is only 2 polygons and some of my bigger segments have holes in them.

Sorry for being a pain in the ass :|

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

Re: PhaserJS 2.4 released with integrated Creature support!

Post by chong » Wed Jun 14, 2017 3:40 pm

Hello,

Actually the rendering artifact issue should be just coming from the CreaturePhaserRenderer.js ( the front-end renderer )
The remaining files, which constitute the core of the Creature runtime API, are fine since they do not do any rendering.

In other words, I suggest if you can, to either switch the Phaser 2.8's default creature renderer to use my new core or talk to the devs there to integrate my new changes into Phaser 2.8's default core. Does that make sense and sound good to you?

Update: Actually, it looks like the renderer code is mostly the same for my implementation and the official implementation. Do you mind asking the devs what needs to be done to fix this? That way it will be easy to implement and check in a patch.

Cheers

zampano
Posts: 70
Joined: Wed Jun 07, 2017 3:37 pm

Re: PhaserJS 2.4 released with integrated Creature support!

Post by zampano » Sat Jun 17, 2017 8:29 am

Hey,
that's the answer I got:
Phaser CE still has some outstanding WEBGL_MULTI bugs, so I'd recommend just avoiding WEBGL_MULTI mode until they're fixed. If everything works in regular WEBGL mode, that should be fine for now.
So I'm gonna switch to WEBGL for now. Thanks for the great fixes! Auto-transition works fine which is great.
I'll go ahead and post some feedback on the actual software within the next few days, too.

Best

zampano
Posts: 70
Joined: Wed Jun 07, 2017 3:37 pm

Re: PhaserJS 2.4 released with integrated Creature support!

Post by zampano » Tue Sep 26, 2017 12:18 pm

Hey, I wanted to switch to the flatdata format and I've stumbled over a bit of a problem.

This is what I load, all are fresh from the git today.

Code: Select all

<script src="sys/phaser28.js"></script>
<script src="sys/gl-matrix.js"></script>
<script src="sys/CreatureMeshBone.js"></script>
<script src="sys/flatbuffers.js"></script>
<script src="sys/CreatureFlatData_generated.js"></script>
<script src="sys/CreaturePixiJSRenderer.js"></script>
<script src="sys/CreaturePhaserRenderer.js"></script>
Then following the instructions, I try this:

Code: Select all

var texture = new PIXI.Texture(game.cache.getBaseTexture(texturekey));
var actual_data = CreatureModuleUtils.LoadCreatureFlatData(game.cache.getBinary('testAnim'));
	
var new_creature = new Creature(actual_data, true);
new_animation_1 = new CreatureAnimation(actual_data, "idle", true);
But I get this error on the line of "new Creature"

Code: Select all

Uncaught TypeError: Cannot read property 'pointsArray' of null
    at Creature.LoadFromDataFlat (CreatureMeshBone.js:3184)
    at new Creature (CreatureMeshBone.js:2916)
    at addCreature (Functions.js:20) //line of 'new Creature'

Post Reply