FBS DevLab
User Functions
Username:

Password:

Don't have an account yet? Sign up as a New User

Events
There are no upcoming events

Older Stories
Wednesday 03-Dec
  • Blob Redux (26)

  • Tuesday 04-Nov
  • Virtools P5 Glove Building Block (28)

  • Thursday 16-Oct
  • Ragdoll Bull Riding (29)

  • Saturday 11-Oct
  • Fun With Limits (30)
  • Object Precaching Techniques (32)
  • Spring Toolkit (23)

  • Sunday 28-Sep
  • 50th Post, Been Busy (Yet Again) (24)

  • Saturday 20-Sep
  • Game of Life, First Optimizations (19)
  • IGDA Slides - Music Games (23)

  • Sunday 14-Sep
  • Conway's Game of Life (24)


  • Object Precaching Techniques
    Saturday, October 11 2003 @ 05:43 PM EDT, Matthew
    The Object Manager in Virtools is notoriously slow; constantly creating/deleting objects at a fast pace--for instance, projectiles in a shooting game--can quickly make it your performance bottleneck. Compound this with dynamic physics, and you're likely to see physics stability problems as well.

    One solution to the problem is to introduce an object precaching system. At the beginning of your composition's execution you create as many copies as you expect to simultaneously need. You then reference this pre-created objects, instead of dynamically copying/deleting them.

    I'm working this technique into one of our IGF projects, as it has a large amount of both physics projectiles and compound particle effects. I started with a simple proof-of-concept example; check out the web version here. I did a quick test to simulate destruction, too; shots that hit the back two cubes are removed. Notice that the oldest objects disappear when you hit the object limit (100). The source .CMO is fairly well-documented, if you're interested in using the technique in your own project.

        


    What's Related
  • web version
  • simulate destruction
  • source .CMO

  • Story Options
  • Printable Story Format