Q3D V-2.4 [3D Physics + Skeletal Animation UPDATE]

  • QuaziGNRLnose, Understood...I am not complaining...After all you really dared to make a great plugin that lot of us could not even imagine...

    So in the same capx file that I sent you, if you can "toggle disable" the following lines -

    • Disable Line 2 till Line 11 ( here is where I am checking if it has already come to this layout before, then using these events)
    • Disable only "System first time = 0 " condition in Line 12
    • Disable only "System first time2 = 0 " condition in Line 22

    If you observe, I am almost doing the same thing between Line 2 to Line 11 as between Line 12 to Line 22 - The difference being checking for "On model created" event in Line 12 to 22 and not checking for the same during LIne2 to LIne 11.

    When I run with the above mentioned lines disabled in the below scenario, I get this error -

    Here is how to create this scenario -

    1. Choose a cylinder shape and click Nets ( Now for the first time it works fine)

    2. Go back using 3D shapes button

    3. Again click on Nets ( Cylinder shape is chosen by default anyway)

    4. I get the JS error as mentioned in the image.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Edit:

    Sorry, I mistook the "Q3D" models as Quake 3 MD3 files for some reason.

    This looks like a great project. Thanks for sharing it with us

  • As i explained, you need to create one of each model at least once, either by swapping to it with change model when the model is finally loaded, or by creating and destroying instances with that model (again the model has to be loaded first, or Q3D will "wait" for the load to finish and it wont initialize in the same way). It's kind of difficult to explain but Q3D models use complex internal pooling, so that things work efficiently if you create and destroy a lot of objects. "Change model" isn't really meant to be used the way you're using it without hiccups, so it makes things a bit more complicated to initialize.

    Normally Q3D expects one model file for each Q3DModel in the scene, so it just initializes everything at the beginning, and as you dynamically load in things that it's never seen before it has to do the setup work on the spot. Since you're basically always changing to things it's never seen before, it has to take that time the first time it sees it. You have to force it to see it earlier to get around that.

  • Understood. I will give this early loading a try. Also I hope you were able to reproduce the error I mentioned above...Thanks!

  • Edit:

    Sorry, I mistook the "Q3D" models as Quake 3 MD3 files for some reason.

    This looks like a great project. Thanks for sharing it with us

    Ah, i can see the confusion

    Q3D loads .obj files and three.js json files, which can be converted to from most common formats. Supporting fbx/etc. internally is a bit of a pain since they're proprietary, and it's not a trivial task to write complicated loaders for these file types. The three.js community has written various tools that do the conversion already anyway, and I think modeling software should be used to handle the conversion anyway, rather than an event sheet. Importing 3D models is always a dirty process in every engine, but i'll do my best to integrate more loaders in the future.

  • Understood. I will give this early loading a try. Also I hope you were able to reproduce the error I mentioned above...Thanks!

    It's late so i'll give it a try another day, thanks for the walk-through though!

  • QuaziGNRLnose, few updates from my side -

    1. I have followed what you said about initialization ( "created model, loaded .js file, destroy on model created" sequence for each .js file) and it worked pretty well without any lags! Though it looked funny just to create and destroy Q3Dobjects in the C2 code, I think it made sense from a threejs perspective...However, a neater way could be to have such stuff abstracted from the user, if possible...Anyway, thanks a lot for that tip.

    2. I also happened to figure out that one of my .js model file was quite big ( something like 5 MB) that was causing the FPS drop...When I optimized this .js model file, I was able to get it working on iPad!

    The js error with switching layouts still remains if I dont take care of that in the C2 code...

  • kmsravindra

    Yea its a bit wonky but its also how you initialize other objects in C2 (even the official plugins).

    When i have the time ill fix that interlayout bug. But as i suggested try making q3d master global and having only one instance instead of having multiple. This will make your application faster, because each Q3D master carries out an expensive initialization step on create/destroy

  • Sure. Thanks!

  • QuaziGNRLnose, When I am use morph animation "DO loop and do ping pong" mode - then I see that the animation once it reaches the last frame momentarily jumps back to first frame ( seen like a flicker) before it starts going back from last frame to first frame. The same DOES NOT happen when I use "DON'T loop and do ping pong". If you want to verify this, you can verify it in the .capx file that I shared with you.

  • where is manual how to use this plugin? i would like to read it before getting it, thank you

  • QuaziGNRLnose, When I am use morph animation "DO loop and do ping pong" mode - then I see that the animation once it reaches the last frame momentarily jumps back to first frame ( seen like a flicker) before it starts going back from last frame to first frame. The same DOES NOT happen when I use "DON'T loop and do ping pong". If you want to verify this, you can verify it in the .capx file that I shared with you.

    strange, i noticed that. I'll fix it. It's due to me only testing with animations that loop cyclically so i didn't notice the issue

    if you want to fix it before the next update it'll be really quick.

    look for the block of code around line 163 in the Q3D Morph Controller Behaviour runtime.js file that looks like this

    				if (a.pingpong){
    				
    					a.t = a.t+a.speed*(dt)
    					if(a.t > Ma.animlen){
    					a.t = Ma.animlen
    					a.speed = a.speed*-1
    					a.pong = -1;
    					}else if( a.t < 0){
    					a.t = 0
    					a.speed = a.speed*-1
    					};
    				
    				}[/code:36xuh9iu]
    
    and change it to this:
    
    [code:36xuh9iu]				if (a.pingpong){
    				
    					a.t = a.t+a.speed*(dt)
    					if(a.t > Ma.animlen-1){
    					a.t = Ma.animlen-1
    					a.speed = a.speed*-1
    					a.pong = -1;
    					}else if( a.t < 0){
    					a.t = 0
    					a.speed = a.speed*-1
    					};
    				
    				}[/code:36xuh9iu]
    
    i had forgotten the "-1" after Ma.animlen
    
    also a suggestion: you could store the multiple animations for the cube in a single file, and use different animation names.
    
    EDIT:
    
    I also think i know why your ipad performance is extra low. Your exported models have skinning/bones information, which they never use. When you export morph targets, you don't need to check skinning/bones/skeletal animation in blender, or else you'll get both morph targets AND bones. Bones are loaded even though they aren't properly used, and they also waste a lot of memory if you're not using them. You don't need to check that stuff if you made your animation using bones, you only need it if you want to actually use the bones with the model in real time, which isn't supported yet in Q3D anyway (it will eventually).
    
    I managed to fix both the bugs you reported so they'll be gone in the next update
  • where is manual how to use this plugin? i would like to read it before getting it, thank you

    I don't have one made yet, as the plugin is still undergoing lots of changes. a manual will likely be out in a few months after physics and skinned animation using bones are implemented.

  • QuaziGNRLnose, thanks a lot. I will change the code as you mentioned in the behavior runtime.js as I am overdue to submit the app to app store. Also thanks for the tips on performance. If any of this performance improvements help it to run smoother on iPad, I want to put "lights on" in my app for that extra effect.

  • I see many people are using this plugin without problem. How about mobile performance with lights? anyone tested it?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)