Tuesday, June 27, 2006

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.

Labels: ,

Friday, June 09, 2006

The Agency: Get email updates

Now, there is a new way to find out when information is posted to our blog. Just sign up for our new mailing list by clicking here or the new link under "Syndication" labeled "Get Email Updates." Subscribers get the latest post sent directly to their inboxes automatically. Since the list is moderated, there is no risk of spam, and they can choose to stop receiving updates at any time.

Of course, you are still welcome to use RSS/Atom feeders such as Google Reader to get automatic updates with our feed, but we hope many of you enjoy this new option!

Labels:

Friday, June 02, 2006

Change Agent: The amazing technicolor OBJ shapes

While StarLogo TNG stays true to its roots by providing several turtle shapes, including one that is the default shape for agents when TNG first loads, it also provides dozens of other shapes to help the user differentiate agents in a visually appealing way.

StarLogo TNG supports two different formats for 3D shapes. One is the MD3 format used by the Quake III engine. The MD3 shapes provide vividly rendered creatures to enhance your TNG models, featuring multicolored skins such as the clown fish's orange and white stripes. However, you cannot (yet) change their color to suit your model. The other format is called OBJ, first developed by Silicon Graphics, for which TNG does support changing colors.

Granted, you can always set an agent's internal pen color, but StarLogo TNG's MD3 shapes do not express these colors on their skin, fur, clothing, or even turtle shell. That is where TNG's OBJ shapes really shine. Though they only appear as one color at a time, their color changes to match the color of their pen.

Unfortunately, we do not (yet) provide an easy way to tell from the Shapes category whether a particular shape is MD3 or OBJ. One trick to figure it out is that if the image on the shape block has more than one color, then it is probably an MD3 model, and if it is all a solid color, then it is probably an OBJ model. If you want to be absolutely certain, you can test a shape by setting your agents to be that shape and then calling set color. If the agent visibly changes color, then it is an OBJ shape. In the example below, the OBJ turtle shape turns bright magenta:


StarLogo TNG Preview 2 includes several OBJ shapes. All of the letter and number shapes, as well as all of the geometric shapes (the cone, cube, cylinder, diamond, pyramid, sphere, and tetrahedron) are OBJs. We also have several creatures that come in both MD3 and OBJ format, including the clown fish and one of the turtle shapes, and future releases will include more still.

So, if your model relies on color to convey information in Spaceland, the OBJ models are there to help.

Labels: ,