PGD Home

P-152: Virtual World Concept Update 2

by on Sep.21, 2014, under Concepts, Software and Games

This week I have worked almost exclusively on the physics concept test for the virtual world.

I think I have done quite well. I have come up with a design that should allow the player to create a structure which can be moved, lifted, and controlled similiar to a vehicle. This is all done in real time.

I have experimented with several T3D and custom object types for the dynamic objects. The requirements of the individual shapes are that they must have collision (between the shape and the player, and the shape and the environment) and they must support physics.

Most of the default classes, (Item, TSStatic, etc) do not have support for some or all of the requirements.I had initially used a custom shape based on the RigidShape class for this project. RigidShapes have collision, and have support for physics. I was attempting to use T3D’s build in physics (and the applyimpulse() command) to move the shape. This did work, but the applyimpulse command applies a force with respect to the mass of the object, which means applying the same force to a player and the platform they are standing on with move the player a lot more than the platform, which is not what I want.

It is also not possible to apply an impulse to the platform and have it move a player standing on said platform, the player will act as an immovable object.

I eventually decided to use a simple TSSTatic object and implement the physics myself. This gives me far greater control over the functionality of the system, as well as allowing me to apply the same physics forces to all objects in a group, moving them all to the same position. This works well, however, I am using setTransform() at the moment to move the objects. SetTransform() ignores collision, so, it would be possible for a moving platform to pass right through another structure, or the terrain. I have created a custom solution to prevent the player from falling through the platform, but I will need to manually implement collision detection shortly. This will likely be a difficult challenge.

The next issue is one of efficiency. I have noticed that when I add a lot of objects to the same structure, and move them at once, there is a lot of “jitter”, due to the objects positions updating at slightly different times. The collision is not affected, however, the player can still walk on the platform.

Currently, the code is in script, for rapid testing and prototyping. It will be moved to C++ shortly, which will make it much faster, however, I suspect it will still not be fast enough to allow for simultaneous movement of many objects at once. I will also need to come up with a way to rapidly syncronise object movement with many players over a network. This will require further testing.

 

 

 

PhoenixGameDevelopment06 Sep. 21 16.33 PhoenixGameDevelopment05 Sep. 21 16.33 PhoenixGameDevelopment02 Sep. 21 16.31 PhoenixGameDevelopment01 Sep. 21 16.31 PhoenixGameDevelopment12 Sep. 17 17.12

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Reply

You must be logged in to post a comment.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!