Archive for March, 2013

A corpse. The first of many. They will never catch me.

Finally! This is the first ever corpse in Splitter, and the very first item drop.

Baby’s first corpse!


Splitter: End of Day 5

1 Fixed Progress bar – was broken (Used for hp/mp/xp).
2 Fixed a nasty message log bug that’s been on my todo list almost since the start.
3 Wrote a combat system. tried hard to make it fair and balanced but to be honest a few
hours isn’t enough to work it out. I should have worked it out before the week started.
4 Now the player can die! I added a game over screen involving real-time dithering even
though I could just pre-dither it! Thousands of cpus will spend a tiny extra bit of
energy dithering it! Actually though, the delay helps the screen not get insta-skipped by
key press, which is a problem which should be easy to fix but blah blah blah I can’t hear
5 Probably the wrong time to do this, but implemented 3 different resolutions and choice
of fullscreen or windowed: 640×360, 1280×720, 1920×1080. The screen is always 80×45 chars
in all resolutions, and never blurrily scaled; it’s either 1x 2x or 3x pixel zooming.
On my particular setup the 640×360 fullscreen doesn’t fill the screen and does something
nasty with blurry rescaling, but I can’t help that.
6 Player can now fight back. Since most of the combat is now done, in fact all of it that
matters at that start (e.g. you have no armour and cool items) it’s become clear the game
is SRSLY, SRSLY HARD. I’ve taken out the monsters I had, which were things like giant
rats with 2 claw attacks per round (that is seriously OP for level 1!) and put in tame
zoo animals like bats and beetles and stuff. Even so it’s freakin’ hard still.
7 Resting is in. You get 10% of your hp and mp back per turn. It’s still viciously hard.
8 Fixed formatting of numbers on interface.
9 I put in code for objects- at least seeing them on the floor, and a routine to drop a corpse
when a mob dies, but it doesn’t seem to work yet. If that had worked and I had also got the mobs
in fov noted in the little visible stuff window then I would have achieved all of today’s goals.
It was certainly close.


Game over screen.

Splitter: End of day 4

1 Added mobs. They draw when in FOV but they don’t move and you can’t attack them
and they don’t attack you. Basically they are attractive “mob statues” available
in three sleek designs: giant rat brackets gasp, Orc, Orc Mage brackets exclamation
mark and kobold. You can tell I’m typing this so I don’t have to code. HELP ME, FUTUR
2 Added flag so mobs become “aware of player”. So now they are freakishly held-in-place
but they become AWARE OF YOUR PRESENCE. All that’s holding that giant rat back from
jumping at your face with his two claw attacks per-round is a hundred lines of code or so.
Are you afraid yet?!?!! I am!
3 Monsters weren’t being cleared when you changed levels which lead to rats in the walls.
They were literarily (sic) in the walls! Tough crowd
4 Mobs have finally found their legs and move about. They ignore the player, although
they do, as mentioned set a flag when they notice him. (“I’ve got my eye on you, buddy”)
5. You can now rest. This makes it easier to watch the mobs moving around randomly; you no
longer have to run repeatedly into a wall.
6 Realized by writing nullptrs into where mobs used to be in a certain data structure I
was wiping things like stairs, open doors etc off the map:
>kobold walks across staircase.
>now no way off level
7 Implemented the world’s worst pathfinding routine for mobs. (They go left if you are
left of them, up if you are above them, etc.) Messed up even this routine, so mobs were
able to go diagonally while I couldn’t.
8 Upgraded to second worst pathfinding routine: now the mobs randomly check either vertical
position relative to you first, or horizontal. This stops the silly dance when you go
alternately up and down and the mob copies you instead of moving horizontally towards you.
9 Mobs now respect other mobs and don’t move on top of them. Mobs still don’t attack you
so it’s kind of fun to “train” them round the dungeon. They tend to get stuck on things
though. If I had more time, I would do better pathfinding, but I need to try to get this
done in time! Almost end of day 4! PANIC!
10 Player is now treated as a mob. This is to make combat easier. Mobs now attack you but
don’t actually do damage yet, plus you can’t fight back. How unfair!

Is it “OK” if we attack you? (oops it says day 3 but it was day 4)

Splitter: Day 3

Today was a lot more disappointing than yesterday.

1 Added stairs down. Can’t find them!
2 Added full screen map so I can find stairs.
3 You can actually use the stairs to descend. (No up stairs as per normal for
laziness of coding).
4 Different colour schemes for different levels. Not all of them defined yet
because it takes a while to pick good colours and I’m feeling the time pressure.
5 Changed how my map was drawing because it was inefficient. Fixed a bug in the
redrawing too.
6 Spent far too long messing around with different colour combinations, most of
which burn your retinas out horribly.
7 Wasted vast amounts of time writing classes for items and monsters that were
way too sophisticated and complicated to get working in the time available.
I mean things like monsters with inventories and they can pick up and use items
and weapons and so on.

Tomorrow I’ll try to be more realistic. I can always add more detail to things later.

Below: Colour scheme variant that won’t be staying, and the new map screen:

Nasty colour scheme

The new map screen

Splitter 7DRL: End of day 2

Day 2 went well.
1 I adjusted the size of the map area to be odd number of columns and rows so the @ could sit in the middle when not at the edge of the map.
2 I refactored yesterday’s ugly code which did everything twice with copy and paste and made a nice game class.
3 Fixed position of visual origin of map when you are near the edge so the player
moves but the screen doesn’t scroll.
4 You can now only move in corridors and rooms rather than ploughing through
solid rock shouting “I’m the juggernaut, bitch!”
5 Researched FOV to find a nice concept to code up. Panicked about time. Decided to steal someone else’s FOV. Tried libfov. Too complex. Stole libtcod’s. Pretty easy to stick in. (I didn’t want to have to use all of libtcod- just wanted to steal the fov parts).
6 Drew walls round rooms and corridors. Looks better but also a little more crowded.
7 Fixed a crashing bug on vector index
8 Messed about with colours and characters for dungeon. Now better but not perfect.
9 Now supports numpad, cursor keys, wasd and vi keys. Made the keys autorepeat. Decided not to allow diagonal movement because my maze has gaps you could exploit.
10 Finally found out why close button wasn’t closing the app- you need to handle
the SDL_QUIT event in the event handler. I’ll still leave my own custom X button
on the screen though- you’ll need it when the app is full screen.
11 Doors placed and drawn- horizontal or vertical as appropriate! Doors can be openerized. Different door open character depending on whether it was horiz or vert door. Had to resist urge to take note of all 4 door pos and draw door open on correct side each time (so door is always open to the right). Sigh. Resist.
12 Made it so unseen areas are total blackness and previously seen areas that
are currently out of fov are the grey stuff

Tomorrow: Stuff that can kill you. Stuff you can pick up.


FOV! Moobment! Doors!

7DRL: Splitter: End of Day 1

Well I didn’t make the @s move. I came close but oh well.

Day 1 “I drew stuff on the screen”.

I found myself getting into a bad sort of tired state though where I couldn’t relax to go to sleep but I was taking forever to write anything and it was very bad code. I need to get refreshed before starting again.


State of play

7DRL: Splitter: BSP Dungeons

I’m using my old BSP dun­geon gen­er­at­ing rou­tine. I really should have dusted it off and checked it out because it’s some­times mess­ing up now I’m using a dif­fer­ent size and split depth.

I’m also unsure how big to make each dun­geon. The screen here is 90×90 and it looks absolutely enor­mous. I do like it, but I got mostly bad responses from the irc chan­nel when I first showed it. It seems a lot of peo­ple are mil­i­tantly against BSP dun­geons in all their forms. It took me a week to write it orig­i­nally though so I don’t want to not use it.