Bust! Some physics requests…

About Monkey 2 Forums Monkey 2 Development Bust! Some physics requests…

This topic contains 56 replies, has 8 voices, and was last updated by  DruggedBunny 1 month ago.

Viewing 12 posts - 46 through 57 (of 57 total)
  • Author
    Posts
  • #14688

    DruggedBunny
    Participant

    Oh, Normalize just made my explosions way better! See what you mean now. I’ve dabbled with it, but when you said it makes things spherical, that was exactly what I needed…

    [/crayon]

    I only have the loosest grasp of what I’m doing here, but it’s fun seeing it work anyway!

    #14693

    DruggedBunny
    Participant

    Further to last update, latest version adds the beginnings of a reason to exist — collect the gems!

    Land on pads to refuel. Find the mysterious Shadow Gem! Can land on terrain at low speed. Lots of tweaking done (and to-do). Gems don’t currently respawn.

    Basic ‘gameplay’ for this thing will simply be collect the gems, pick up the orb (which is still currently spawnable) and head for the stars. Game Over.

    Still got my problem with not being able to detect when I’m no longer colliding with an object (eg. lifting off pad). Also, is there a way to use Colliders without a RigidBody, just to detect collisions (no response)?

    Bust! Web version (Booooo! Get the Windows 64-bit version below and play with Xbox pad’s analogue controls!)

    Windows 64-bit executable (Have an Xbox controller plugged-in before running.)

    Source code (Still to be massively re-arranged and cleaned up!)

    #14695

    abakobo
    Participant

    Too bad, I get some glitchy gfx with my Mac Book Air Mid 2013… (IntelHD 5000)
    The emscriptem works (at 7FPS) on the same machine though.

    Looks nice, will try to play on my W10 machine!

    #14698

    DruggedBunny
    Participant

    Thanks for having a look, hope it’s better for you on Windows!

    Interesting that you don’t get the glitching on WebGL…

    #14700

    Abe _King_
    Participant

    Got 2-5 FPS on Chrome, Firefox, and Native. Native also seems to have some big problems with the rendering causing a whole bunch of tearing and extreme noise. Looks like it could be a fun demo/game if I could only play it!

    Windows 10, i7, GTX960m

    #14701

    Mark Sibly
    Keymaster

    I couldn’t figure out how to make it night-time…

    With black ambient light and no lights in the scene, all you’ll be able to see is specular reflections. By default, mojo3d uses a built in environment map for this, so this is what you’ll be seeing.

    The fix here is to use a suitable night-time environment map, but there’s also a Scene.EnvColor hacked in for pretty much this purpose – set this to black to ‘turn off’ specular reflections, ie:

    scene.AmbientLight=Color.Black
    scene.EnvColor=Color.Black

    It would be cooler to find a nice ‘starry’ skybox/envmap though, or to perhaps even generate one randomly.

    #14705

    DruggedBunny
    Participant

    With black ambient light and no lights in the scene, all you’ll be able to see is specular reflections

    Hmm, I’ve done AmbientLight = 0 and all other lights 0, to no avail. Will try again… and do the specular thing too…

    Got 2-5 FPS on Chrome, Firefox, and Native. Native also seems to have some big problems with the rendering causing a whole bunch of tearing and extreme noise. Looks like it could be a fun demo/game if I could only play it!

    Does bananas/toy-plane work? If not, I would suggest a bug report, with as much detail as possible (inc gfx card spec and screenshots); if it does run OK, I’ve no idea, unfortunately, as this thing doesn’t use anything beyond the basic 3D engine!

    That said, I do occasionally get a weird situation where any Monkey2 app (including Ted) runs at like 5 FPS until I reboot, while other stuff runs OK, so I’m wondering if there’s some weird bug with drivers and SDL2/Angle (or whatever MX2 is using now). That said (again), I’m on Nvidia, so probably not a driver thing.

    #14708

    Mark Sibly
    Keymaster

    Hmm, I’ve done AmbientLight = 0 and all other lights 0, to no avail.

    You need to set scene.EnvColor=Color.Black too, or you’ll still be able to see specular reflections.

    #14709

    Abe _King_
    Participant

    Nope, no graphical errors with the Toy plane! But, as I’ve speculated before, the frame rate drops exponentially with increasing rendering sizes.

    #14712

    DruggedBunny
    Participant

    What were the graphical errors in “Bust”?

    #15081

    Ethernaut
    Participant

    Thanks for posting the source, it was really helpful!
    Cheers.

    #15085

    DruggedBunny
    Participant

    No problem, just had a quick look and it’s very out of date, though I’m currently having some problems (noted on Github), having converted to using Components to control my entities.

    One thing I would say if you’re looking at the physics:

    DON’T use ApplyImpulse/ApplyTorqueImpulse for real-time control like this version does!

    Use ApplyForce/ApplyTorque, as you’ll otherwise run into problems with different framerates and other quirky stuff.

    ONLY use the *Impulse versions to apply changes that should be instant, eg. I now use them only to start my SpaceGems (which now use the physics engine) spinning at a fixed rate when created — otherwise they would be slow to spool up — or you might use them to start a bullet firing instantly, for example.

    With impulses, the force is applied instantly, unlike in reality, where its effect takes place over time.

    (If you’ve started using them, convert to ApplyForce/Torque right away — you’ll need to increase the values significantly.)

    That’s my top tip for now! (Also, I had to remove the lights attached to SpaceGems, as they were causing slowdown.)

    I’ll post the source once it’s working again…

Viewing 12 posts - 46 through 57 (of 57 total)

You must be logged in to reply to this topic.