Turtle Speed: Faster simulations with OBJ shapes
In a recent post I demonstrated how to set the visible color of OBJ shapes. Today, I will highlight another benefit of OBJ shapes over their MD3 counterparts: they are often faster.
Recall that you can always monitor the rendered FPS and the VMPS by pressing the "H" key twice. If a model with many agents that are represented with MD3 shapes seems to be running slowly, even with the Speed Slider set to Max Speed, you may achieve better frame rates by switching to OBJ shapes.
Consider the sample project Epidemic (epidemic.sltng), found in the Projects folder in the StarLogo TNG installation directory. Epidemic uses simple OBJ spheres to represent agents that may become infected as they move around and interact with other agents. The use of OBJ shapes in Epidemic is primarily to be able to use color to differentiate between sick and healthy agents. However, you may find that Epidemic runs much more quickly thanks to the use of OBJ shapes instead of MD3s, especially on older computers.
To see the effect, try changing the shape of the agents from the sphere to an MD3, such as Mario or one of the animals. You will no longer be able to visualize sick and healthy agents with color, and you may also notice that the model runs much more slowly when many agents appear on the screen at once.
If we ever find a way to improve the performance of MD3s significantly, blog readers will be the first to know! In the meantime, if you find that your model is running sluggishly, consider changing some of the breeds to OBJ shapes.
Recall that you can always monitor the rendered FPS and the VMPS by pressing the "H" key twice. If a model with many agents that are represented with MD3 shapes seems to be running slowly, even with the Speed Slider set to Max Speed, you may achieve better frame rates by switching to OBJ shapes.
Consider the sample project Epidemic (epidemic.sltng), found in the Projects folder in the StarLogo TNG installation directory. Epidemic uses simple OBJ spheres to represent agents that may become infected as they move around and interact with other agents. The use of OBJ shapes in Epidemic is primarily to be able to use color to differentiate between sick and healthy agents. However, you may find that Epidemic runs much more quickly thanks to the use of OBJ shapes instead of MD3s, especially on older computers.
To see the effect, try changing the shape of the agents from the sphere to an MD3, such as Mario or one of the animals. You will no longer be able to visualize sick and healthy agents with color, and you may also notice that the model runs much more slowly when many agents appear on the screen at once.
If we ever find a way to improve the performance of MD3s significantly, blog readers will be the first to know! In the meantime, if you find that your model is running sluggishly, consider changing some of the breeds to OBJ shapes.
Labels: spaceland, turtle speed
2 Comments:
remarkable program, but i seem to be having some issues w/ running the projects. specifically, on windows xp platform, i can step through the programs but they will not run continuously. so, if i open the bouncy-balls demo and click the "setup" and then click the "Forever" button it will not display any updates in the spaceland window. if i click pause and then continuously press "step" the balls will move and VPMS values other than 0.0 are displayed.
Hi. It may be a hardware configuration issue. If you send us the details of your system (graphics card, RAM, processor speed, etc.), we would be happy to help you further if you e-mail us at bug-starlogo@education.mit.edu
Post a Comment
<< Home