Bridge Constructor Physics Simulation

SourceForge.net Logo

Current project state

Currently, only the core component of such a game is made - the physics simulation.
The simulation allows creating a 'world' out of only two components, bars and balls. Bars may be linked together to create larger structures, the links can be set stiff so they don't behave like hinges. The balls can be used to make something like gravel, or they can be attached to bars to make wheels. Using both, a train could be built and a bridge. See screenshots below.


new changes on Feb,28 are:
  • Added texture manager to the simple Direct3D graphics.
  • Added PAK file reading module.
  • changed size of textureID in WORLD to 64 bits for easy texture management.
  • removed some minor bugs.


  • new changes on Feb,26 are:
  • Added simple graphics using Direct3D and removed the GDI stuff.
  • changed and finished the 'POLY' objects, renamed them to 'TRIANGLE'.
  • added fields 'color' and 'textureID' to basic elements in sim for use with graphics.
  • removed some minor bugs.


  • changes on update on Feb,19 were:
  • Added breaking of parts when overstressed.
  • Created a modular editor and some minimum tools for it.
  • Added a limit to elastic properties according to critical resonant frequency to avoid exploding simulations.
  • Added methods to load/save the simulation state. Could be used for levels/trains/savegames.
  • removed some minor bugs.


  • The speed seems to be fast enough. The simulation in the screenshots below uses about 27% cpu time for simulation on my Athlon 750 system using 1000 steps per second. The step size could be increased some more if needed, but I believe that 500 steps per second is a minimum. Since moveing from GDI graphics to Direct3D, the time needed for graphics output shrumk from 30% to 3% and no longer steals too much time.

    Until now, the testprogram slowly grew into a simple editor which could be used as a base for the game. It can add and remove bars, has cut/copy/paste functions and an undo buffer.

    download the sample

    testprog.zip
    contains a windows sample executable (uses DirectX8) and PAK file.

    Simulation object docs

    The interface to the simulation object is briefly documented in Struct2D.html. The files itself are on the Project CVS.

    Shots

    screenshot 1
    The train is about to cross. The single bar in the middle adds the support needed.
    screenshot 1
    The bridge collapsed. Only the engine itself made it across.
    screenshot 2
    Somehow, the last three cars were lost here...


    by Achim Dahlhoff.