Game in 7 Days, Day 1: Still alive!

Published December 12, 2013
Advertisement
Holy shit, was it really half a year since I last posted here? Time flew fast.

My son was born (woo!), and I've had no time for absolutely anything at all, no sleep, no rest. Go figure. I have, as always, hanged out on #gamedev on afternet, but didn't code anything at home. These days, I'm finally setting into the role of parent and finally have time to resume programming for fun. I put a hold on my previous project, as it is bit big, but I was looking for some inspiration. I looked for it where I usually look - Ludum Dare website. I was lucky enough to find that it's happening this weekend. Time to warm-up then, right?

Last time I did 7 games in 7 days and it was a wild trip. I really enjoyed myself, but I don't think that I'll be repeating that when my kid is this young; I have some time, but not that much any more. So, new project would be 1 game in 7 days. I'm already way behind, with having only thursday and friday left for work, so it'll have to spill to next week, skipping for LD on the weekend (unless I feel like working on this game instead).

So, what's the warm-up theme? Take the first game you've ever created on your own (not by copy-pasting some tutorial) and remake it using the skills you learned along the way. First game? Woah, that takes me back.

First game I have ever created was Artillery (Scorched Earth for those of you that are bit younger, Worms for the ones that are even younger) clone written in BASIC. Funnily enough, I didn't realise back then that there was a QBASIC game that was exactly that: GORILLAS.BAS. I put it together in 45 minutes, during CS class in my primary school (I had a rich, for postcommunist Poland standards, school that could afford PCs in 1993), using a highschool physics book and throw equation for the shots. I didn't understand how parabolas were drawn, so I cheated: I calculated 'throw' distance (which was calculated using force of the throw minus the wind strength), max height of the throw, and drawn line from origin of the shot, to half the throw distance/max throw height, and then second one to max distance/ground level. It looked something like this:

0.png

Sweet game that, eh? ;)

Anyways, this meant that I'd be making artillery game again. Seven days gives me plenty of time to do very simple game. Let's see what's needed

1) Level generation
2) Character movement/physics
3) Weapons, Level Objects and Tools
4) Gameplay (as in, turn based stuff, killing, menus, GUI, etc)
5) Graphics
6) Audio
7) Polishing, cute stuff like crate drops with additional weapons
8) Multiplayer over net
9) AI

Seems like I've got my work cut out for me. I've written them in the order I'll be working on them. I want to make at least one point a day, so that I'll have functioning game by the end of the week (though it would be cool if I could fit in network play and AI). If nothing else pops out (I'm probably forgetting something), this should be doable. I'm trying to keep features/weapons/etc to bare minimum, to do the game on time.

Did I say that first dev day is done already? No? Well, it is biggrin.png

I knew that I want something more than just straight line. For a while I was wondering about using 1D Perlin noise to just have wavy surface, but decided against it. I wanted overhangs, like in Worms series. So, 2D Perlin noise it was. But first, I had to choose technology. I picked Unity3D, because I like it, and wanted to do some 2D game development in it, to test the sweet Unity3D 4.3 features. First thing I did was creating a Sprite from a hand-crafted texture. Poking and peeking like it's 1982! After some problems, I've had first result - white noise that changed based on height:

1.png

Once I had the technology down, I could start working on level itself. It took a 2D Perlin noise, added value between 0 and 1 (depending on height of the pixel on screen), clamped it to 1, and then added it to texture depending on a threshold value I picked, here's the very simple and unoptimised code: spriteRenderer = (SpriteRenderer)transform.GetComponent(); seedX = Random.Range(0,rangeMax); seedY = Random.Range(0,rangeMax); spriteTexture = new Texture2D(sizeX, sizeY); for (int x = 0; x < sizeX; x++) { for (int y = 0; y < sizeY; y++) { float color = Mathf.PerlinNoise((x+seedX)/resolution, (y+seedY)/resolution); color -= y/(float)sizeY; if (color < treshold) color = 0; else color = 1; spriteTexture.SetPixel(x, y, new Color(color, color, color, color)); } } spriteTexture.filterMode = FilterMode.Point; spriteTexture.Apply(); Sprite sprite = new Sprite(); sprite = Sprite.Create(spriteTexture, new Rect(0, 0, sizeX, sizeY), new Vector2(0,0),1); spriteRenderer.sprite = sprite; transform.position = new Vector3(-sizeX/2.0f, -sizeY/2.0f, 0);
And here's the result I got:

3.png

Now that I had level with overhangs, islands and floaty bits (not shown on this screenshot, basically blobs of ground hanging in the air) generated, it was time to add some texture to it. I have iterated over every pixel, and did a modulo of its position vs ground tile and some random offset. Then I iterated over every pixel that didn't have anything above it (surface pixel), and added grass tile line underneath, based on modulo of pixel's x position vs grass tile. And here's the effect:

4.png

And that was it for first day of development. I'll add some bottom layer (something on overhangs, analogue to grass on top of ground), and some simple customisability, and I'll be off to physics and movement code. See you then!

Day 1 summary finished, mantis out.

Story so far:

Day 7
Day 6
Day 5
Day 4
Day 3
Day 2
Day 1
6 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement