Every once in a while, it’s nice to take a day off to do very little. Well, I actually did a lot today, but not very much of it was development related. In terms of development, there were only a few new things I added to MMORPG Tycoon 2:
- Added a utility interface to the VectorStorm bounding box classes to set themselves up from an array of vertices. (Previously, code using these classes had to pass in each individual vertex one at a time). This change will eventually be migrated back into the public VectorStorm trunk code.
- Added a function to the VectorStorm bounding box classes to collide a ray against the box, returning the precise point of impact, and the distance along the line at which the impact occurred. This was really just returning some extra data from the existing “ContainsPoint” check. This change will also eventually be migrated back into the public VectorStorm trunk code.
- Using these new interfaces, the game’s cursor can now detect and move over buildings; I haven’t yet done this for toons or monsters, but adding those will now be trivial. This system will eventually be used to allow the player to select, move, and adjust the properties of entities and objects within the world.
Colliding the cursor against a bounding box around the building doesn’t seem quite satisfactory, particularly for non-square buildings. (The buildings you’ve seen in screenshots thus far are actually not square; they’re diamond-shaped. So their bounding boxes are much larger than their visible geometry). Sometime soon I’ll be improving the collision test to be done against the actual visible triangles, instead of (or in addition to) against the bounding boxes.