This week, I wanted to practice simple first person gameplay, and experiment with minimal graphics – so I created a first person text adventure. Gameplay is a bit like Gone Home, but without the visuals. The story is loosely based on an SCP entry, hence the name, but don’t look at it till you’ve played the game please, unless you want the end spoiled! The link’s at the bottom of this page. Screenshot of the game:
This week I wanted to make something with a minimalist look. I totally failed at that. This is Shaderball:
It’s a 2 player air hockey type game; you push your balls to the opponent’s side. You have 10 balls you can fire into the goal to get a higher score than your opponent. Player 1 has the ability to pull all balls towards the centre of the two players. Player 2 has the ability to slow down time. Only one ability can be used at any time. The number of balls left for each player is represented by the black part of the circle in the player.
Play here: https://dl.dropboxusercontent.com/u/32538545/Shaderball/WebBuild.html only 50kb!
Here’s a short gameplay video:
With Xbox 360 controller(s):
- Left thumbstick – move player 1 (left side)
- Right thumbstick – move player 2 (right side)
- Left bumper – player 1 release ball
- Right bumper – player 2 release ball
- Left trigger – player 1 ability – pull balls towards centre
- Right trigger – player 2 ability – slow down time
- WASD – move player 1
- Arrow Keys – move player 2
- Left ctrl – player 1 release ball
- Right ctrl – player 2 release ball
- Left shift/ F – player 1 ability – pull balls towards centre
- Right shift/ Comma – player 2 ability – slow down time
The game is called Shaderball because the shaders’ code comprises about twice as much as the gameplay code. There are 2 main shaders, one for the board and players, and one for the balls, sides and number of balls left. The only other things are particles and text. With lots sine and cos functions modulated by 3D simplex noise (all factoring in time), the shaders are near the maximum number of arithmetic instructions. I used a variety of these shaders for reference: https://www.shadertoy.com. Hopefully it will work in your web browser (if you have a decent GPU)!
I did most of the gameplay in one hour, which just shows how nice Unity is! I took lots of coding shortcuts this time, which didn’t have any repercussions. I should definitely spend less time on visuals and more on gameplay next week!
Woohoo! Week one over, game finished! Well, I implemented maybe 10% of what I had in mind for the game, but that 10% is roughly how I imagined it! And it is kind of rogue-like-like-esque, so I’m pretty happy overall.
Should really have counted the days from 0. Those off-by-one bugs are always hard to spot!
Added some new features this evening. As you can see, you have a hotbar GUI thing with buttons (only one of which kind of works), and can see how much jetpack fuel you have left, as well as how many turns. The camera follows you, and anything leaving the hex grid comes back on the other side.
One thing that’s really bugging me is the character physics. I’m just using a regular rigidbody2d, but I have to apply force every frame or the character doesn’t move at all! This looks ok if the astronaut is just gliding through space, but as soon as she hits an asteroid, it inherits way too much velocity and it is obvious she has a constant force pushing her. I’m not sure if this is a “feature” of the physics engine, or just something specific to my character, cause the asteroids seem to maintain their velocities.
Sad that I have so little time left to implement lots of potential features. Ah well, must call it a night at some point!
Beginning to regret how ambitious this project is for the free time I’ve had this week! I started coding sloppier today, game-jam style – who cares about performance if you’ve got nothing to show, right?
Not much progress these last 2 days really – most of my time has been spent fixing bugs in the game “board” coordinate conversions (with 3 coordinate systems, and conversions into and out of each, something was bound to go wrong).
I’ve been working a bit on turn-based gameplay. The way I envisioned before was having an amount of time for each turn, say 3 seconds, then the game would pause and you could decide to use your jetpack or continue on. Having tested this, it feels really jarring to be constantly stopping. So now, the turn continues until you click the mouse (excluding camera panning), then if you click within a certain radius of the astronaut, a force is added relative to how far away you clicked. Your turns increase and fuel decreases, relative to how much force was added.
One design problem is, what to do when the player hits the edge of the hex grid? I think bouncing off would feel wrong, and an “infinite” grid sounds hard to program. Maybe I could move the character to the other side of the screen, asteroids style. Then the camera would have to move of its own accord to keep players from being confused. I suppose the camera tracking the player during turns wouldn’t be bad.
Obligatory screenshot for the day:
Still not working on gameplay really, but enjoying adding some nice graphics polish! You can see the little animation I did yesterday. Also made a cursor on the hex grid, which the asteroids are now stuck to.
Added multiple layers of dust that parallax around when you scroll the (now scrollable) camera. The far stars stay still, as you’d expect. I did this with 3 cameras, 1 for stars, where the camera doesn’t move, and a perspective (not orthographic camera) for the parallax dust.
This was a weird effect I got trying to get the cameras to play nicely: if you set none of the cameras to have a clear colour, everything from previous frames overlaps in the buffer:
I’m excited to get going on the gameplay, but inevitably after a day’s solid programming tricky problems, the novelty of programming this stuff in the evening kind of wears off! Can’t believe I have only 3 days left!
Not much progress today, been busy. Did some simple character animation in Unity, which keeps crashing on me before I can save. I think making the collision boundaries much simpler helped the stability. Made some parallax layers of space dust in photoshop – nice to do some painting after programming all day!
Hopefully I can make everything quantised to the hex grid shortly, then start working on turn-based gameplay!