Wednesday, 26 November 2014

Finalizing Prototype Code for the Tutorial and Boss


Now that everything was in place it was time to finalize the prototype code. This task didn't involve making all the code efficient and organised, though of course I tried to do this as much as possible whilst working. This task involved ironing out all of the bugs, to bring the game from something playable to something that always works.

For the push and bridge area there wasn't too much to do. For this part I made the bridge disappear as a place holder, and set up a re-spawn, so when you fall down the pit it gives the effect of killing you. We wanted to turn the block that you push from being physics based to being animation based, however I ended up focusing on other things, but it still worked.


The sand area involved a little more work. First of all I changed the sand plane rising to a single trigger, rather than have to hold a button down, using a bool. This also meant that I could set it up, so that if you hit the interact-able object with the grappling hook, the sand would rise. The bool came in handy for sorting out the death and re-spawn, if the sand rise hadn't been triggered it would kill you, otherwise you can walk across it to the other side.

The climb area did not need much work, there was still a teleport that took you to the top of the climbing section, it was mostly waiting for the climbing mechanic to be implemented in the game.

Similarly the spiral area did not take much work, I just set up a death a respawn if you fall down to the bottom.

The first section of the bird boss was not even there at this point, so of course I needed to get it in, and it was very simple to create. I copied some of the code I used for one of the other boss stages, edited it slightly and positioned any new spawn points as I wanted in order to create the effect of the bird swooping and flying in to the roof. For the roof getting destroyed I used a collider and had 2 different object which I set active/inactive, making the roof collapse and fall along with the player, taking them to the next section of the level.


For each of the bird section, I grabbed a Kiwi bird model off of turbo squid, and used its mesh to make the bird face toward the player. This made the next two areas mush more readable. I also smoothed the eggs, created a model for the bell and made some rough rubble, just to bring the scene to life a bit.

The second section did not need many tweaks in the code, aside from making the bird face the player. I made the bird faster so it was harder to run past it, made sure that the bird did not get stuck chasing the egg off of the edge of the stage and that was about it.


The last stage of the boss fight was where it got buggy. I made it so that the bird only looked at the player when it was distracted, and then faced a little nightmare of getting it to trip over in the right direction whenever it fell over the rope. Of course to make this happen I needed to fix the collision, the bird did not always accept that the rope was there, making the boss hard to play but I managed to fix this. I realized that I needed to constrain it's movement to only the X and Z axis, otherwise it would float in the air or go into the floor. After I had done this was stop it from killing you whenever you went up to hit to hit it, make sure it stands up again every time and put a hit counter on the head up display, so I did each of those.



The travel between each area, with the teleport and fade worked differently with the new controller. I didn't understand why, so Joe and I sat down and figured out the problem, ultimately creating a code that would be more guaranteed to work smoothly no matter what the character controller was doing. I also made sure each area was mapped to a hot key, so that you could quickly move between them. Travel between each area was done using colliders, the player must get to each collider (usually at the end of an area) to progress, and of course at times they can go back the way they came.

On the left is the controller about to reach the collider, and on the right is the controller spawning in the next area.


I am very happy with the result I ended up with through doing this and the amount that I managed to get done, both in terms of designing and coding. Though the code is rough being prototype code, and there probably where easier way to to some tasks. I feel like I got stuck in a bit of a rut with coding where I was mostly using what I knew worked and had used recently, rather than reaching into my own knowledge banks, previous scripts and online resources to really make the best decision, I think this was part of that mental fog and struggle to think clearly that I mentioned earlier. I think that when I carry on doing coding from here, even if it is only prototype, I will put my best into finding the most efficient and fast methods,

0 comments:

Post a Comment