Tuesday, February 26, 2008
4E6 Engine First Gameplay Test : Febuary Progress Log
Over the last month since my last update I’ve been looking into testing out some of the functionality i have spent all this time developing and putting it into practise with some simple game play elements, not too much in the way of functionality has been added except for the addition of an emitter which is capable of being scripted to emit objects at timed intervals, it is possible to create / destroy these via commands. added functionality for the use of a interface plug-in called CEGUI which allows for easy binding of functions to interface elements, and allows me to display game data to the user very easily.
The video shows 2 half finished levels with place holder artwork, the very first level involves the player getting over 2 moving platforms using dexterity, with a very simple puzzle in which the user must push a block up to a platform with a button on it that triggers the moving platform to the exit. I had to overcome a number of problems to achieve this. first of all being the jumping system for the game:
jumping was easy enough, just applying an impulse to the players physics body when the user presses jump. but one problem with this is detecting whether the player is in contact with the ground. i thought of a couple of ways to do this. one of which is casting a ray below the player a specified amount in order to determine if the ground is underneath the player, and another whereby I use the physics material callback between “player” and “floor” so when they collide a flag in the player object is set to “on ground” and every frame is set by the player to not on ground, allowing accurate ground detection every frame. this also presented another problem. when the player is on a object defined as “floor” i.e anything you can walk / jump on it sets the flag to true, all well and good, but if this same object is something the player can stand touching such as a wall it means the player is still able to jump, even if they are in the air, allowing the player to jump multiple times up and over walls. i used a little bit of maths to solve this issue in the material callback. so upon collision i obtain the contact position and normal of the collision, normalise it get the dot product of the resultant vector and the players normal (0,1,0) and then get the inverse cos of this, after this it is simply a matter of determining if the angle obtained is the right angle for a player to jump from.
another small issue that was fairly easy to resolve was if the player is standing next to a platform / block that they wanted to jump on and they where not moving to begin with it meant that there was no velocity applied to jump on top of it. i resolved this by adding a small amount of forward force to the character if they are in this situation.
the second level in the video entails the user getting to the top of the ramp in order to progress, but i have set up a number of emitters to emit spheres with a really high mass that can knock the player off the level hence forcing them to start again. to begin with it didn’t knock the player off of the platform due to the way that stopping force is applied to the character when on floor in order to correctly stop (as opposed to using friction to stop which is unrealistic). this meant that i had to add a call to the characters jump function on collision with one of these spheres, allowing for more of a challenge mode of play.
i was also presented with a design problem in this level, with lots of spheres if you do the level the first time it is an appropriate level of difficulty as the balls hadn’t yet got onto the bottom platforms by the time you where passed that, but if you got knocked off on the way up the ramp it was near enough impossible to complete (as you can see from the video) , i resolved this by extending the bottom section of the level by a significant amount and reducing the emit rate of the spheres, this made it a constant difficulty for the whole level.

