Tuesday, 30 July 2013

Tuesday Got Physical

Box, Meet Sphere

I have a sphere which falls to a static box and slowly rolls away. I know it was not the most ground breaking start to my physics system masterpiece but it's a start :)  Most of the day in fact was spent re factoring the terrain prototype so it would integrate much more easily with the engine, which in real terms means an almost complete rewrite.

The data structures and subroutines had to be separated out, cleaned up and commented, the resources such as objects, images, shaders and cameras had to be accounted for and externally controllable (as it would integrate with an engine which already uses many DBP resource indices) and finally I had to move the files around and remove old ones, and place new ones in clever places for future proofing.  Test the whole thing to make sure nothing got broke in the conversion too!

Finally, I moved the media files and the newly created source files to the main engine, in such a way that I can still load and compile the terrain prototype as a standalone, but the types and main module can now be used in the main engine compile as well.

I stopped short of integrating the IDE (that is, seeing the terrain in the map editor window and linking in the controls) as I had an appointment with physics I did not want to delay.

Integration Delay

It might be a mistake postponing integration in favor of starting the physics module but there are many more integration modules to come and it might make sense to do them all at once.  The task is also quite involved and I should really treat it as a project in itself and give it the proper amount of time, not squeeze it in between modules. 

I have done my re-factoring correctly, which is the main thing, and I can still compile and run the terrain module proto as a standalone which means the new art which Mark is burning overtime on can be tested and dropped in when they are ready.

Signing Off

As you may have read from yesterday's blog comments, it appears Rick discovered a secret version of the terrain module on dropbox I was using to work with Mark on the final terrain texture sets.  Seems he liked it.  You might think that means you get a screen shot but I rather like the idea of a big reveal through the newsletter and the Friday blog. Something to start your weekend with a little bang.

Who knows, maybe it will get better in the next few days and you do want some WOW factor out of this project right?  I just hope I've not built the suspense too much, worst thing you can do that!

Wednesday's plan is a bit scatter gun, with some art integration's, more physics module work, new FPSC animated sprite pack to create an installer around, get rid of some office clutter so I can see the chairs again, create some GITHUB repositories and see if they all compile for me, prepare presentation notes for Thursday AM and who knows what else.  All in all, pretty happy with today's run of work.


  1. Does this mean barrels if they happen to be tipped over say near a staircase... would roll down the stairs? :o

  2. If Bullet physics supports cylinders, and I think it does, then yes the barrels will no longer be boxes :)

  3. in theory this could be used for vehicles

    nah dont throw stones at me for speaking it out loud
    however am really glad that Reloaded is using Bullet
    especially since looking at the improvements that Bullet 3 is gonna have/ @Lee hope you plan to update bullet when Bullet3 is out

  4. Yes, Bullet supports cylinder. It also supports box, sphere, cone, capsule, convex hull and triangle mesh. Because triangle mesh should only be used for static geometry (though I think it CAN be used for dynamic stuff), you can use the compound shape and the automatic convex decomposition method described in one of the demos to make a far better substitute for a dynamic triangle mesh.

    I am currently upgrading my Bullet wrapper which involves rewriting most systems due to poor initial implementation, but I know Bullet fairly well so if you need any help I'd be glad to be of assistance :)

  5. Oops forgot to mention Bullet also supports a dedicated terrain shape for heightfield terrains, and an infinite static plane which is mostly pointless.

  6. Thanks for the Bullet expertise, I will surely need it :) I have a Bullet demo I cobbled together which combines terrain and character controller so should be okay to get it all working in DBP by the end of the week. How did you find the multi-core stuff, was it automatic or required lots of code work?

  7. To be honest I've never taken the dive into the world of multi-threading. It's just a bit on the scary side to debug and so far I've not needed it. Even so, I understand most of the concepts involved and I HAVE researched multi-threading in Bullet previously.

    I've just opened the threading demo included in the Bullet distro, and as far as I can see it requires very little setup work and while it's not entirely automatic, the multi-threading systems look easy enough to use. The interface is mostly cross-platform which means some/most of the work in getting threading set up is done for you.

    Just the fact that it only has to work on Windows makes it immediately easier for you.

    Oh ok, I just opened the other threading demo (MultiThreadedDemo) and I can actually assure you that unless you're using threads for your own custom work (as in ThreadingDemo), it's pretty much entirely automatic. It's easy to set up and gives you parallel solving.

    I'd be happy to research more stuff for you if you like :)