Today was my first day back at university! So it was time to start working once again on my Games Engines assignment. I’ve fixed a good couple of bugs today including an annoying little problem I had with the PhysX cloth occasionally becoming too still and therefore not updating with the rest of the scene – I tried adding a constant force to it… but it didn’t seem to work at all – then I found a really nifty little function:
That pretty much fixed one of the biggest problems I’ve been having without much fuss at all. Occam’s razor eat your heart out! So now the cloth ‘wakes up’ every frame and no longer stops working properly if left alone for too long. I’ve also changed the colours in the game and made the blocks explode into a shower of debris when the ball collides with them… just to make the game a little juicier.
Another important part of this assignment is the collection and analysis of user data. One of the ways I’ve decided to implement this is by getting the computer to do most of the work and record my data into several files at run-time. The first piece of data I’ve decided to record is the location of the ball in space… this allows me to see where players mostly die and where the ball travels most often. I played a single game and then made the data I collected into a graph… here are the results:
This graph could also be considered as a really dodgy version of a heat-map. I can see where the ball tends to be often by looking at the concentration of points in certain areas – this could be useful to see if players have trouble getting the ball to land on the bat in a certain place or (as the case above suggests…) where they have used a strategy to destroy blocks vertically without risk of angles interfering!
Today I managed to get back into the computer labs to continue work on my PhysX assignment. The plan right now is to have about 90-100% of the implementation done before I leave for home on Thursday – when I get home I won’t be able to work on the code properly as I don’t have the right set up on my laptop. Today I implemented a scoring system now and physics feedback for when the ball hits a block. I’ve also added rotating motor joint objects on either side of the screen to enhance gameplay.
Tomorrow I hope to add in lives and an end-game mechanic. Then do some cool stuff to make the bricks explosively shatter everywhere when they’re hit. (Not sure how I’m going to implement that yet… probably with an array – but we’ll see how much time I have to do it!)
I implemented the basics of my breakout trampoline idea today in our Game Engines workshop, it works reasonably well. I’ve added a ‘shoot’ mechanic which stretches the cloth into a bouncy trampoline, launching the ball into the air! I’ll probably have to make the ball bounce higher in the final version, as it doesn’t go too far right now… might have something to do with its weight or the gravity in the scene.
One thing I need to work on is the collision detection between the ball and the cloth below – even after having increased the thickness of both the cloth and the collision skins, it will occasionally fall through when the cloth is subjected to high powered forces. But this is a prototype after-all so it’ll be fine in the long run!
So I really wanted to use cloth in my Game Engines assignment. Our task is to re-create the basic idea of breakout but with interesting PhysX mechanics added into it. I’ve come up with the following idea to implement cloth into the game:
A piece of cloth is attached to two boxes by its edges like a suspended parachute. The games ball then lands in the centre and then rolls into the centre. When the player holds down the space bar, the two boxes move away from each other, making the cloth pull upwards quickly – the resultant force should propel the sphere up into the air!
The player then has to control the two boxes in order to re-capture the ball and then fire it off in different directions (depending on where it is on the piece of cloth…) in order to destroy the blocks above. Of course the cloth will be un-tearable so that the ball won’t crash through and ruin the game.
I’m going to try and implement this over the next few days depending on how much work I can get done on my dissertation project. I am not sure if the sphere will actually collide correctly with the cloth, so this will be an experiment to see if the idea is actually viable as a method of gameplay.