Jump to content

April 2017 »

23 242526272829
- - - - -

7 games in 7 days, day 6 finished

ld ludumdare programming 7games7days
4: Adsense

7 games in 7 days, day 6 finished I had terrible problems with logging in to GameDev, so I had to post my Day 6 update on my Ludum Dare blog. But since the wonderful staff of the GDNET fixed the problem ( <3 ), I can post it here Posted Image


So, day 6. Only ONE DAY LEFT! I’m nearly there, even though I have again been awake for over 24 hours, I’m only now getting tired. Today I’ve been working on what partially inspired me to start this challenge – a dungeon crawler. My goal was to create something akin to Moraff’s World, which was kind of a roguelike, but from first person perspective. to deal with lack of peripheral vision, it displayed the world through four cameras – one for each direction.

I started by creating couple textures: for Thong Goblin, Gold, Ladder Down, ceiling, floor and walls. Yeah, I know that programming is more important than art, and I should stick to temporary graphics till I’m done, but I’ve enjoyed working in C64′s 16 colour palette so much yesterday, that I wanted more of it. Being limited really does make you think more carefully about which colour to use to achieve what effect. Also, because of that, I created name for the game: DITHER CASTLE . I wrote a quick billboard class, so that 2D sprites in the world would always be looking at the camera. (speaking of camera, I’ve learned how to use split/multiscreen)

So, after wasting some time on making myself feel better, I’ve started working on the game. Firstly, I needed some kind of level generation. I have already been working on procedural dungeon generators, but it was mostly for Diablo-like levels (which, as far as level generation was considered, had zero thickness walls). After several failed attempts, I have managed to write something decent, here’s the algorithm, maybe it’ll be useful:

1) Generate X rooms (X is most likely some random number between minRooms and maxRooms). The rooms can overlap, actually, if they do, it sometimes looks better. So your only worry is to create them in a way that makes them fit on the screen.

2) Create a list (vector in C++ most likely) ‘unvisited’, and put all rooms on it.

3) Create a list ‘visited’. Put first element of ‘unvisited’ list on it

4) Find closest to it room on the ‘unvisited’.

5) iterate over all rooms on visited (1 so far), and check which one is closest to the new room.

6) connect the rooms (here’s my algorithm)

6a) pick a random tile within both rooms (as defined by Room class – origin.x/origin.z (y is up), width/height, or something to those extents)
6b) from one of the tiles, check difference between X an Z coordinates of two tiles (y is up still).
6c) if vertical difference is greater than 0, move one square in that direction, mark the tile as clean/empty/floor/whatever
6d) if vertical difference is still greater than 0, go back to 6d)
6e) once you’ve created vertical route, do the same (one by one ‘eat’ tiles)

There. Really simple, and looks quite nice:

Posted Image

After the levels were created, I’ve started adding features:

First was ladder to a new level, which just picked random room (but not player starting room), and when you collide with it, it generates the next level.

Second came AI. This was really simple, just a bunch of ‘move towards player, check for collisions’ routines, and it was good enough for the demo.

Then came player stats. I decided to make a scene with player creation, and I had to learn how to share variables between different scenes (turns out it’s incredibly simple in Unity – just use PlayerPref.Set/Get Int/String/Float(), and you’re done. I decided to create 3 classes for the player, and following mechanics:

Character consists of: HP/MaxHP, Strength, Dexterity, Constitution, Minimum Damage, Maximum Damage, Gold carried. Base stats were calculated by rolling six sided die (or, to be precise, Random.Range(1,6) ), and adding 6 to the result. Also, each class has one ‘strong’ stat, and one ‘weak’ stat.

Berserker gets +3 to Strength, -1 to Constitution
Warrior gets +3 to Constitution, -1 to Dexterity
Monk gets +3 to Dexterity, -1 to Strength

Combat is calculated by comparing attacker’s Strength score + result of rolling a six sided die, and defender’s Dexterity + result of rolling a six sided die. If attacker wins that, he then subtracts from defender’s HP random score between his min and max damage. If player dies, well then, he dies and is taken to results window, which shows how much gold he managed to collect, but if he wins, then monster dies and drops the gold he’s been carrying (determined by kind of monster, dungeon level, and – as always – chance).

Speaking of monsters, we have 3 of them, from common Thong Goblins, through strong Cookie Monsters, to incredibly powerful Christmas Elementals. More powerful monsters start appearing the lower in the dungeon you are.

So, what else? I sprinkle the dungeon with gold, but obviously would like to add more enemies, items (currently we only have gold as pickable. there is even no inventory).

What more would I want to fix? Well, there’s a problem with converting floats to integers, and since I use sometimes floats, sometimes ints (because I was lazy), then at times you encounter invisible wall where you should be able to pass freely. That’s the reasong [D]ie shortcut was added :/. Also, since I didn’t have any place left on screen, I didn’t put any output telling you what you pick up, or how much damage you do. Same is the reason why [L]ook command doesn’t work, and it’s a damn shame, because i put funny descriptions there .

Since it’s already 13:40 on Sunday as I’m writing it, I don’t think that I’ll be finishing 7th game today – I need to prepare some code for owrk on Monday as well. I will try however, and as always – keep you posted. Before I go, let’s look at our the game list again

- Shoot’em’up - done
- Platformer – done
- Puzzle game – done
- Racing game – done
- Adventure game – done
- Dungeon crawler – done
- Strategy game.


And here is a list of the entries in the series:

Last Day summary and Challenge Post Mortem
Ludum Dare preparation
Day 6 summary
Day 5 summary
Day 4 summary
Day 3 summary
Day 2 summary
Day 1 summary
Series kick off

Ta ta for now!

Dec 10 2012 10:01 AM
I hope saying this is awesome, again, doesn't get repetitive! Also, great to bring back memories from a few of the Moraff games!
Dec 10 2012 01:15 PM
this was pretty fun to play, i died the first playthough because i was placed in front of a wall and didn't realize it, but on the second playthough, i understood what was going on much better and was enjoying it for a good bit.
Dec 10 2012 06:09 PM
thanks guys. although I had been recalled to my office job, and couldn't find a day to make game 7, I managed to squeeze couple minutes to fix couple annoying things with the game and added a simple map (just press M :) ), not viewed-only restricted yet, but at least it's helpful.

also, you can now kill monsters by pressing forward against them, running starts after shorter holding of keyboard.

As for day 7, I started working, and even have couple progress shots:


Shame I couldn't finish it. I haven't yet decided if I'll finish this one, or is it cheating and I should create a totally new one. But there will be a strategy game tomorrow one way or another :)
Dec 11 2012 12:13 AM
Very cool!
Dec 13 2012 02:55 AM
I been checking out your games since day one. At first i though it would be impossible to build 1 game in 1 day. But as i can see it is possible and after the first few games you can see that your developing skills.

I just really like this journal for somereason. It makes me show how games are easier to make if your are planned and know what to do.

Keep up the great work Mate! :)
Dec 13 2012 10:57 AM
I keep looking for game 7.....sounds like your comment ^^ says you aren't going to be building game 7? That's too bad I have been eagerly waiting to see it as I have all the rest.
Dec 13 2012 03:28 PM
I will be doing the game 7, but I have a deadline that I have to do on Friday, and this is a BIG ONE, and today I had the lecture that I was giving on indie game development. On weekend is Ludum Dare, so I'll be creating a 2-day game then.

I want to do the 7th game, but I have to have 8 free consecutive hours, which isn't possible before next week. I will be posting about my Ludum Dare game here though :)
Dec 14 2012 07:59 AM
Alright well best of luck in the competition

Note: GameDev.net moderates comments.