Tuesday, 28 April 2015

Snap Crackle and Pop. The Camera.

The Camera. Arguably the most important part of any game, get the camera wrong and the game could be ruined. My camera system was heavily inspired by the Nintendo game, Super Smash Bros. I faced a few problems when I first set out to code the camera script, there is still a bug in there now! But lets ignore that.


The camera works along 2 separate axis. using the cameras local axis instead of the world axis, the camera pans across its X axis based on the average X coordinate of the players in the game. Very simple, nothing special. Just averaging some numbers.

The zoom however posed some very huge problems. Unities default 'isVisible()' function is terrible, there's no way around it, its just terrible. If a single pixel is visible EVEN from the objects shadow, so the object can be completely off the screen but if a single pixel of its shadow is being rendered, it is considered visible.

My response to tackle this problem was to attach what I call the camera tracker to each player, this is 4 small boxes with a completely transparent material attached and no shadow casts. Unity still renders these boxed and applies the material making the object invisible, but the object renderer is still enabled  meaning its being drawn. If all 4 cubes are visible then the player is visible, if a single cube isn't then the player is considered not visible meaning the camera must either pan out, or the player has fell out of the playable area and is due to respawn.


The camera zooms in if it can see every player and there is a large enough gap between all players and the edges of the camera. However, there is a cap as to how far the camera can zoom in.

The camera is also responsible for the movement of the 'audience'. The audience follows the camera's x axis to travel perpendicular to it to give the feel of a game show. Whilst it seems primitive for the audience to just stick to the camera's x coordinate, we felt that this was more than enough to make the stage feel more alive without distracting too much from the game play.

Here's a game play video just in case you wanted it:


A Menu For All Menus!

I'll start off by apologising for the really short video on this, I don't have 4 controllers at hand so I had to cut it from footage recorded earlier in the day. The way my menu works is to have them all within the same Unity scene, this makes the whole thing a lot more manageable and removes the need to have to code multiple scene changes.



For the most part the menu is very very basic in terms of code. The real beauty is in the controller manager.


The project currently only supports Xbox 360 controllers however there is third party software available to make other controllers mimic the input of a 360 controller. When its time to add controllers and chose your starting team (blue or orange), regardless of what order the controllers are registered as, they will be added to the controller manager in the order of fastest finger first on the start button. This will register the player with the next available player slot (1 to 4). The rest of the game uses this global controller manager in order to manipulate the player objects and all other controller inputs. This system allows us to have truly dynamic controller assignment to player objects in the scene so we are never restricted by "who is player 1?"

The stage and mode select screens are currently placeholders until more content is available. The controller map screen is just a splash screen displayed before a stage begins.

A Level is Not Just a Map, Its a Playground!

I know its been a while since I posted, but there has been a lot going on with this project recently! I just forgot about my blog.

                                       Now                                                                            Then

To jump right in to whats new, this post we're going to look at the interactive map. The designers and artists worked hard to make the map look nice, it was my job to come in and make it more than just a nice environment for our first playable stage!

The above video should be available in full 1080p 60fps. Lets break it down.

The Dropkick Bridge

Exactly as it sounds, a very simple game object which, when the player dropkicks it, will fall down to build a pathway that the player can progress towards the next checkpoint. As this is the first available stage we aimed to keep it very simple in order to keep the game play focused on the players whilst still including the environment.

The Piston Bridge

The piston bridge is one of the easier obstacles in the stage however through play testing it has proven to be a great section of the stage for player combat. So how does the bridge work? Just like the name describes, it uses a 'piston-like structure' in order to ensure the blocks don't travel as a solid beam, more like a telescopic radio antenna. As each block reaches its maximum extension the next follows, same on the return. By doing this it also allowed me to have a single trigger collision box that spans across the entire distance of the piston, when the player is inside any of the pistons collision trigger boxes they will be dragged in the direction the piston is travelling. Each piston has its own speed which is determined by random at the start of the stage between set variables.

The barricade is a small extension on this checkpoint I added in just to annoy the rest of the dev team when we were play testing. However we chose to keep this in. Behind the stairs on the defensive spawn is a hidden button in the wall, when punched it triggers the barricade to fly up causing the offensive team to have to take the piston bridge to get the ball across the check point.
The Stairs

Another little thing that was decided last minute. The idea behind this checkpoint in the stage is that when the offensive team enter the checkpoint, a timer is triggered which when it runs out, lifts the stairs so the offensive team can proceed to the checkpoint. This was done to have a single section purely existing for the players to fight it out. If a player just so happens to be stood on the stairs when they bolt up, they are thrown into the air into ragdoll. Ragdoll everywhere...
The Hammers!

My favourite section of the stage! The hammers have a simple lerp responsible of keeping the swinging motion correct. When a player collides with one of the hammers they are instantly triggered into ragdoll and a ridiculous force is applied to them to launch them straight out of the playing area. With 4 players this section is by far the best in the stage in my own opinion, its just carnage.
The Piston Pushers

Another interesting section with the ball spawning inside the ring of pistons on the top layer and the 3 pistons on the outer edge. The pistons along the outer edge are on a simple timer based script to keep them in sync with each other, if one catches you, you're gone. The pistons along the top work differently, they use awake/dormant-like structure, at the start of the stage each piston is given a 40% chance to be enabled, so every time you play you don't know which ones are lethal! It is possible to jump over them without triggering them, they only get triggered if the player walks directly ontop of an active piston.

Tuesday, 20 January 2015

Squishing the bugs!

HEY GUYS!

So it's been a few weeks since I last posted, well give or take a full month! I hope you all had a good holiday season whichever it may be that you celebrate!

A quick update on the progress of our AGD project, the team had a meeting earlier today and we decided it was about time we got back on top of this thing and pushed the development! As of today, Tuesdays are now programming days for this project for me.

So, what have I done today, fixed bugs. All the bugs. well no quite all of them but still, in the prototype build we pushed at the start of December, there were several catastrophic bugs with the systems i had built that needed fixing so I've spent the most part of today doing so.

Bug Fixes:


  • Camera Movement Bug, the camera no longer snaps to individual players when one goes in o rag-doll.
  • The players now move with the moving platforms.
  • The players no longer fall through the floor on a part of the course.
  • A bug with controller selection allowing the game to be started with a single player when out of debug mode.
  • a few other minor tweaks that I can't remember right now. They were probably important.

And just incase you wanted to see these in action, nothing new, just fixed. Here you go:


Stay frosty guys, winter will be over soon!


Thursday, 20 November 2014

A Prototype Fit For A King! (a king of babies)

With the prototype deadline coming up fast, the team have put their best efforts in to collaborating the work from each other, and handed it all over to me for the final sprinkles. We had a few hiccups here and there but overall I'd consider it to be a stable build.

A short and sweet post is all that's in order today, It's been a long day and I'm just about ready for bed, so here you have it, I asked two random people to test play our demo, the points system is currently just a place holder so please pay no attention, the game is meant to be for fun after all as a couch multiplayer game.

Here is the video:



And when things just go wrong...



That's all from me tonight guys, it's been a very long day in the office (campus). Goodnight guys, Hope you like what we have to show so far!

Kris.

Tuesday, 18 November 2014

The Good, The Bad, and Unity!


Yup... we broke everything.

So here we are again! Week 2 into the AGD blog! Some exciting things this week folks! After trailing through pages and pages of google searches fixing the most ridiculous of bugs, i can proudly show off some of this weeks work! For a start, I finally finished the controller select screen, where the players will take turns adding controllers to the game and picking which team they want to play on, once all players have locked their controllers in, anybody can press start to start the game. (turn your headphones down, i accidentally recorded my pc's audio)


I also got a lot of work done towards our first playable level! With thanks to our 3D modelers and designer for putting together a modular building pack and putting together the pieces, I was given this and sent in to make things move, look pretty, and generally just work! Here's a few tasters! 





Hopefully we may have a playable demo by Friday! However you will need at least 2 players and 2 wired controllers to play. And to finish things off on a high note, out lovely animator Luke Bryan went and fucked up a center point, making it impossible to rotate this god dang thing for a while.



And with that I bid all of thee farewell! Until next time guys! Stay Peachy!

Kris.
The Wizard.

PS. Sorry for the poor video quality, it'll get better!



Monday, 10 November 2014

A tiny step down a long road

Well, here goes my first post on my AGD (Advanced Games Development) blog.

I'm Kris, member of the DogBox team at the University of Teesside. We are a small group of 8 students working together on "Run 'n' Punch" (working title). According to the group I am A Wizard... Because nobody understands what programmers actually do, so, I have chosen to embrace my calling as the Wizard of DogBox.

Our project is to be made in Unity, we did consider Unreal 4 however we ran in to several complications.

Now, if any of you have ever used Unity before, you'll know how terrible its input manager is. For the best part of the last week I have been in a constant battle with Unity to get it to even acknowledge the difference between 4 different controllers. And I have finally done it. So, the biggest hurdle is now over, and here is a nice little clip to show how the team selection page will look.

It will be a maximum of a four player couch game, however I only had 2 controllers handy for the moment of testing. I've taken inspiration from sports games and how they handle controller decision amongst players.

Each player presses start to register their controller and then using the left analogue stick, decides whether they are to be on blue team or orange team.


And with that I wrap up my first post. When our other programmer Craig finally creates his blog I will cross reference his work with mine to help show our progress. Stay tuned folks! We're going big!