fuego96's Forum Posts

  • ...I have found the Oimo physics is actually faster than most of the techniques I tried - to the point where I was satisfied with the performance.

    Same experience here. Is it any wonder why we'd like everything to be physics controlled?

    Anyway, just to conclude on the rotation bits. I found that multiplying pi with any positive number, equal to or greater than 1, will rotate the Q3DModel without any problems. It's an acceptable starting point for spinning hazardous game-objects that are statically placed in the world.

    http://crxmedia.com/test/ss/rotation_problem.capx

  • ...I ended up using torques instead of setting angles for all physics objects.

    I have no idea what is going on with the uneven angles though. It was just plain bizarre.

    My last resort is to use torque (maybe), which, is rather overkill for a statically placed wind-turbine providing one among many other hazardous obstacles for the player vehicle (for a game I'm working on).

    And the effin' angles... yes. I'm still trying to figure that out. Even if i made a 3D floor tile in Blender3D, duplicated a few, rotated them and wrote down each tile's X, Y, Z rotation on a piece of paper, then input them into Q3DModel as values for rotations, they don't visually appear the same either.

  • ...I ended up just ignoring it and working around it.

    It's "workaround-able" for some games but can introduce far-reaching inefficiencies for others. I think the real question is, is rotating by a local axis -- which should have been a problem-free instruction -- even "advised" or not.

    By "advised" i really mean robust, or should I just treat it simply as a non-existent function and move on?. There are a few things I'm seeing but don't have an IQ of a thousand or more.

    So, if anyone can correlate why the rotations are only okay at angles 3, 6, 9, 12 etc., as can be seen here, then you're a genius (maybe). Basically values in multiples of 3 (integer) or pi multiplied by another integer.

  • Eh... I'm trying to rotate a collider mesh (no model) but am getting strange results. Is it just me?

    Does this (video below) happen to anyone else?

    Would appreciate any explanations as to why this happens.

  • cjbruce I say keep the wheels, create a new vehicle version and write a function to switch between the two. First reason is for performance (if slow), the other is for different vehicle-looks after consuming power-ups if the game has such an intention. A little bit of product differentiation goes a long way.

    ... has to do with positioning/rotation of the visual elements. I should be able to parent them to the body and do rotation about a local axis, shouldn't I?

    Gosh. Imagine designing a wide variety of vehicles like this as opposed to having a 3D modeller design and rig it, you use a single Object3D and have it's children transformable whenever needed. The division of labor is also clear cut.

    But I digress, parenting not working for you?

    BTW. Nice game!

  • QuaziGNRLnose

    I hear you. And understand where you're coming from.

    Just know that, nobody buys a sports car that is speed-limited because the manufacturer knows it's dangerous for you. It has always been up to the content author / developer to avoid bad practices that would ruin game performance. Just my two cents.

    Still, I appreciate the coding efforts and the choices (sacrifices) that were made to make it work as solidly as it does today. Would have loved to hear some of your development anectdotes.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Being able to do instances of objects...

    I've just tested with ThreeJS/JavaScript and it is possible to do so -- absolutely.

    In fact, the name of the mesh (obj's 'o' key) is retained, where, you can access it by the child's .name property. From there you can then translate, rotate, scale etc...

    The caveat in going that route is, of course, the missing "IDE" but other than that, the plumbing work in ThreeJS is already there.

    EDIT:

    Just noticed that .PickChildren is also available for Q3DModel plugin (that loaded .obj files) but doesn't expose the .name property. Why?!

    EDIT 2:

    I see why. The OBJLoader.js included in Q3D is actually a different implementation than Three.js and only accounts for vertices, normals, uvs and disregards the rest [strike](including object names).[/strike] Perhaps this was done to allow certain use cases in the C2 editor that, over time, was never meant to be.

    EDIT 3:

    Oops. Not true, the object name supposedly looks like it is saved... Now curious as to why it isn't available.

    EDIT 4:

    Aha... it's because it was a design decision. Okay, question answered.

    cjbruce

    I don't think we'll ever get that feature in the current Q3D -- despite it being perfectly doable in actual ThreeJS + JavaScript. That is, unless some major work is done to the OBJLoader (and some other implementation files).

    *sigh* what a downer.

  • Hi, it's been a while. To anyone who knows the answer to this question (I've searched). But to setup the context, lets say we have an .obj with three cubes.

    I see the "SYSTEM --> For Each child" and upon iteration, the .idPicked property shows unique numbers. Great.

    But applying something like "Q3DMaster --> Set object visible" to false doesn't seem to have any effect.

    QUESTION:

    Does the "System --> For Each child" work for loaded .obj that has children (the three cubes in this case) at all?

    Or is it only useable for Q3DModels instantiated/created in C2?

    WHY:

    ThreeJS's Object3D.traverse(callback) seems to fit the bill for this type of useage. Just asking

    https://threejs.org/docs/#api/core/Object3D

  • Just thought I'd post this thing here since it uses Q3D.

    https://www.scirra.com/arcade/other-gam ... gain-15356

    Long story short, I found a rather simple way to mod the Scirra audio plugin to play MP3's from another site. For folks who are interested, the long story is in this forum thread.

    https://www.scirra.com/forum/viewtopic.php?f=146&t=80373&start=10

    Enojy.

    Now to the question at hand. How to call an audio file from a web server.

    , the WebAudio API goodies aren't available to video unfortunately.

    mchulet, Animate, Carbincopy, I recently needed to do this and came up with a workaround (albeit hackish). So if you want to try, here goes.

    This involves modding the Scirra audio plugin with a small change to the runtime.js and edittime.js

    In my case, i just needed to reference .mp3's managed by a CMS exposed as a static site directory from a remote domain (ie. a web server). To keep things simple let's assume only using the Chrome browser and that mobile devices are out of the picture (I didn't need it in my case).

    Let's say that our MP3 files are at http://www.yourdomain.com:8080/tracks/

    1. Backup Scirra's audio plugin in case it gets messed up.

    2. Edit the runtime.js and add a line after 3401 like so.

    3. Edit the edittime.js and change line 71 to the following.

    BUT... and here's the complicated bit.

    4. You'll need to be the administrator of said server and be able to configure the appropriate Cross-Origin Resource Sharing (CORS) to ensure that your C2 application is allowed to GET those mp3's from wherever origin (domain) you're getting it from. Also note that when configuring CORS, you need to include the origin's port number as well (if any).

    That's basically it.

    During authoring time, just enter the URL (where the Folder property used to be). After a successful test, you can then think about reading an external JSON, iterating over an MP3 playlist and feeding the filenames to the (modified) audio plugin as a next step (see demo below).

    Here's the modified plugin dialog for Play (by name) action. Notice the empty Sounds/Music folder:

    Finally, doing it this way would allow the continued use of the WebAudio API, filters and stuff. You get the idea.

    EDIT:

    How about an app that's hosted in Scirra Arcade which gets its audio from another site? Perfect example.

    https://www.scirra.com/arcade/other-games/q3d-c2-webaudio-api-demo-again-15356

    EDIT 2:

    If you have previous C2 projects using "PlayByName", beware that the above "hack" will break your previous project. However, the proper (less hackish) way that doesn't break previous C2 projects would be to extend the existing audio plugin with a new action, say "PlayFromURL", instead of modifying "PlayByName". But this requires a bit of plugin development know-how from your side to get done correctly (but is relatively easy).

    I tried to looking for a Select All command to select all instances of an object in the editor, but I was surprised that there isn't this ability. Can we get this in C3 if not C2?

    CTRL+A doesn't work for you?

    What about this?

  • Thanks for the link! I've been through the examples, and don't see how this helps. I've tried all of the expressions and haven't been able to find any expressions that map 3D screen space (x,y,z, with a perspective camera) to the 2D screen (x,y in flat screen space)....

    cjbruce Ah... I just realized that the example didn't actually return any screen space coordinates. It uses "container" to "pin" the text to the Q3D Model. Sorry, but you're right. Getting the screen coordinates for a Q3D object would be pretty useful indeed. Will let you know if i find anything as well.

    EDIT: Correction, the example does return screen space coordinates. Try adding an extra action to the existing example as shown here.

    Shows the screen space per Q3DModel by the .xw and .yw properties

    The only problem is that, it works if your Q3DMaster camera position is static. You'll have to account/calculate the new screen space manually when the camera moves, which I guess you're probably already aware of

  • If you're wondering why your Q3D app isn't displaying properly on your smartphone (LG V10 in my case), try setting "Use high-DPI display" to "No".

    Also, don't use Chrome Beta for Android, touch controls are buggy for some strange reason.

    Now I can check Q3D performance on my smartphone (actual screenshot here).

    Feel free to post your phone's make/model and how many FPS you had.

    https://www.scirra.com/arcade/other-games/q3d-the-baked-room-scene-with-mobile-controls-13979

    LG V10

    Fullscreen = 43-46fps

    Non fullscreen = 53-60fps

    (lowest-highest fps)

    EDIT: Hmm... performance seem to vary according to the device's power management, such as when you drive around for 5 minutes and the smartphone start to heat up, thereby reducing thermal margin and the PM throttle's down the CPU/GPU. It's better when deployed as an Android (.apk) app.

    On the first try with Android OS 4+ (Lolliepop) (Webview), the app ran at 60fps like the Chrome browser app but running entirely in fullscreen with very little heat dissipation for more than 10 minutes. About 30 minutes later and it got only fairly-hot but not as extreme as when it was running in the actual Chrome browser app, however the FPS remained at 60FPS. After quitting and re-launching a few more test builds, it never went back to 60FPS (just around 39-45FPS). Strange.

    EDIT2: Found the main culprit that downgraded the speed. Now the .apk works PERFECTLY like I initially experienced. And the culprit in Intel XDK was this setting.

    Just uncheck it. The app will still run in fullscreen anyway -- but way faster (screenshot below).

    Feasibility test complete.

  • ...Collider Fit is independent of physics... ...Oimo Physics bodies have their own independent collider...

    QuaziGNRLnose

    Ah, indeed they ought to be different. Was fooled and couldn't immediately see the difference between the two, sorry.

    I can understand that the Oimo Physics collider shape is initially bound to DefaultShape0 and that one could simply create a separately-sized box (collider) shape for Oimo Physics, but shouldn't the physics behavior initially have its own separate box collider adhering to the size calculated by "Collider Fit: Model"? It only seems natural.

    QUESTION: Is there a Q3D Model expression so I could query the Collider Fit calculated width, depth and height -- so i could then automate the resizing of DefaultShape0 ?

    It's about automatically creating (physics-based) multi-level grounds and walls that have been sized and pre-positioned in Blender. Personally, it's hard for me to pretend that it's better to scale/position them in C2 when clearly, external 3D editors are purpose-built for these things -- depending on the game type of course

    Many thanks for the previous response, and nice work on the manual -- helps a lot!

  • My very first Q3D test scene

    https://www.scirra.com/arcade/other-games/q3d-the-baked-room-scene-13979

    QuaziGNRLnose dear sir, would there be any way of accessing a mesh from the 3D scene?

    It would be nice if I could simply reference the walls that are already in a scene (not necessarily from another individual model) to add box colliders. Like maybe...

    ...so the "Model Meshname", if not empty (nor misspelled) *and* exists in the scene, would get used. Would be nice not having to recreate/re-position separate box colliders (for the floor and walls). Maybe a new "Q3D MeshBinder" plugin perhaps?

    Speaking of colliders, "Collider Fit: Model" doesn't seem to work.

    The boxes and the first platform (left) are primitives made by Q3D, the second platform (right) is from Blender whose (Q3D Model) collider fit property is set to "Model". The collider debug shows the correct size, but the box still falls through.

    Here is the .capx file (with the blender file in the Files Folder).

    http://crxmedia.com/test/ss/BoxColliderFitModelTest.capx

    EDIT: Changing the values here...

    ... to larger XYZ values would increase the BBox and solve the collision issue, at the cost of changing the size of the model and negating the intention for "Collider Fit: Model". Sadly this would mean that I have to key-in the dimensions for every wall (and endure the tedium of object placements).

    Here's hoping it's an easy fix.