About Monkey 2 › Forums › Monkey 2 Development › Bust! Some physics requests…
Tagged: ****ing camera, bust, collider, collision groups, collision masks, constraint, damping, orb, physics, point2pointconstraint, thrust
This topic contains 56 replies, has 8 voices, and was last updated by
DruggedBunny
9 months ago.
-
AuthorPosts
-
May 23, 2018 at 1:22 am #14688
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]Monkey12345[crayon-5cb99da3d24be067032157 inline="true" ]power = 5.0ptri.body.ApplyImpulse (body.LinearVelocity + (model.Basis * New Vec3f (Rnd (-1.0, 1.0), Rnd (-1.0, 1.0), Rnd (-1.0, 1.0))).Normalize () * power)I only have the loosest grasp of what I’m doing here, but it’s fun seeing it work anyway!
May 24, 2018 at 11:18 pm #14693Further 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)?
Windows 64-bit executable (Have an Xbox controller plugged-in before running.)
Source code (Still to be massively re-arranged and cleaned up!)
May 25, 2018 at 12:41 pm #14695Too 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!
May 25, 2018 at 6:34 pm #14698Thanks for having a look, hope it’s better for you on Windows!
Interesting that you don’t get the glitching on WebGL…
May 26, 2018 at 3:54 am #14700Got 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
May 26, 2018 at 6:04 am #14701I 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.BlackIt would be cooler to find a nice ‘starry’ skybox/envmap though, or to perhaps even generate one randomly.
May 27, 2018 at 12:47 am #14705With 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.
May 27, 2018 at 9:39 pm #14708Hmm, 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.
May 28, 2018 at 4:05 am #14709Nope, no graphical errors with the Toy plane! But, as I’ve speculated before, the frame rate drops exponentially with increasing rendering sizes.
May 28, 2018 at 7:17 am #14712What were the graphical errors in “Bust”?
July 19, 2018 at 3:41 am #15081Thanks for posting the source, it was really helpful!
Cheers.July 19, 2018 at 12:28 pm #15085No 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…
-
AuthorPosts
You must be logged in to reply to this topic.