Saturday, June 30, 2012


Checking off the list:
  • Inner maps should be saved in their own file. - DONE
  • Having some way to move from one inner map to an adjacent one. - DONE
  • Inner maps should only be generated if they don't exist already. - DONE
  • The seenFOW map doesn't get rid of old things once they've been removed. - DONE
  • Item saving should know whether or not they are equipables - do this via switch on the name I guess
4/5 isn't bad. Feeling ridiculously unmotivated so probably going to do some work on adding features to terrain rather than anything else.

Added some more map generation stuff. Dead trees for desert, bushes for grass land. The world doesn't look so sparse anymore. The fifth bug above needs to be fixed ASAP: can't even use consumables because they're a different type!

Did some cellular automata smoothing on the side areas of the inner maps. Looks not so obviously half-ellipse now.

Also prevented continuing on the title screen if no save file exists. A little polish makes the draft feel a lot nicer.

Friday, June 29, 2012


Things I did:
  • World generation is hard. My plans were to use the world map to make tailored inner maps, but actually implementing it is a pain. I have a little of that, but not enough. The maps generated are ok - not especially interesting, but good enough. Write-up and map generation write-up forthcoming I guess.
  • Changed things so that the worldmap is basically a static image and a separate screen so that you can hit "m" and see it (and zoom/move the camera around in it) and then esc to return to the local map and the game. This makes things a lot nicer.
  • More bug fixes with saves and map generation and blah blah blah. 
  • Straightened out the code. Nothing interesting feature-wise, but makes things easier code-wise. Wanted to make the inventory/equipment menu a little nicer, but it turns out that is hard too!

Things I need to fix (tomorrow?) before finally getting back to feature adding:
  • Inner maps should be saved in their own file.
  • Item saving should know whether or not they are equipables - do this via switch on the name I guess.
  • Having some way to move from one inner map to an adjacent one.
  • Inner maps should only be generated if they don't exist already.
  • The seenFOW map doesn't get rid of old things once they've been removed.

Feature adding I need to get to in order of what order it should be done in:

  • Make it really dangerous at night regardless of terrain: wolf spawns only happen on forests, and aren't frequent enough to force the player to seek safety.
  • Buildable menu - to select what B builds. 
    •      fire for woods
    •      rock walls for rock
  • Hunger - to force the player to scavenge. Saving of hunger.
  • Equipped stuff should stay equipped.
  • Exp system and leveling up. Saving for player stats etc.
  • More features for each biome type. Right now only rock walls on rock tiles, grass on grass, trees on forest. Maybe a few trees on grass/soil, dead tress on desert, bloodmoss (as enemy) on swamp..etc.
  • Enemy spawning - will be interesting again because I'll get to do some thinking about goblin towers, wolf caves, and roaming ogres on plains on the worldmap.


  • More equipment types.
  • More items.
  • More enemies.
  • Go back to inner map generation and ensure that if rivers are adjacent to other rivers, they connect. Rivers adj. to seas connect. Lava to lava connects.
  • Make lava passable again, but...If you walk over lava you should take huge damage.
  • River flow. If you walk over rivers, you should move with the river flow. 

More kludging to iron out some bugs from yesterday.


Worked on better inner maps. Implemented a cellular automata algorithm for smoothing - looks decent.


Wednesday, June 27, 2012

Separated new game from game initialization in general.


Kludged through map generation!!!


There's now a 200x200 world map, and a 200x200 inner map for every 1x1 world map.


Rather than generating them all initially on world generation, the inner maps (and the surrounding inner maps) are created whenever the player enters then. The inner maps are based on their neighboring inner maps so it all should link together quite nicely. Inner maps are currently just floors and walls, but additional generation can proceed smoothly from here after some code cleanup.






From the picture you can see the world map, a zoom in, the inner map, and another zoom in. The difference in coloring is because I waited till day in the world map but took the screenshot at dawn in the second.


The inner map is a little laggy - something like 60% * 200 * 200 = 24000 wall objects to keep track of. Hopefully it'll be better when I turn fow back on and update doesn't need to draw all of that.
EDIT: And turning back fow does indeed remove the lag. Whew!

Tuesday, June 26, 2012

To clarify for yesterday - saving now incorporates item/wall hp, as well as inventories of Player and NPC; still need to add effect saving, equipped item saving.

Worked on world gen - rather than just using a single Perlin Noise array for worldgen, I've incorporated many of them and tried to get stuff generated procedurally from it. I'll write a proper post on this later because it's been a lot of fun.

Here's a picture of what I've gotten so far:


Working on river generation right now, which are in lava tiles for easier visibility. Black is "ice" tiles, but I haven't made a tile for them yet.




Monday, June 25, 2012

Friday, June 15, 2012

Mainly bugfixes and optimization - now that combat isn't the only source of damage I needed to make sure dead checks happen right on going below 1 HP - otherwise silly things like dead monsters still attacking or attacking already dead things happened. Also cleaned up some holdovers from the previous hardcoded 5-squares-around-the-player check for explored map objects and vision in general. This means that fog-of-war and explored territories are fully accurate now.

Tried to complete saving and loading - currently exploring the built-in c# serializers but I think it's likely I might just go back to plaintext and worry about encrypting it later.

Added drop tables for monsters.

Next up will be fully finishing saving/loading, playing with enemy/ogre spawning, fleshing out the world gen so that the world map represents tons and tons of smaller maps, or playing with map generation. All good things to do!

Thursday, June 14, 2012

Added knockback effect: sends effectee flying backwards a certain distance or until they hit something they can't pass - in which case they take damage unmitigated by defense.
Added berserk effect: increases speed and hp, but decreases vision and takes dp(action).
Added ogres: they berserk if they take any damage, and do increasing knockback based on their hp.

This was a lot of fun to watch and test: after the recent combat changes, the player by default can't do enough to damage to pierce the generic enemy's defense. So to kill any of them, I needed to setup an enemy between myself and a wall and then hit them into it for knockback damage.

Ogres are really, really tough. I setup berserk so that you gain an initial 50% HP, but you lose 10% every time you can act. Berserk lasts for 5 of your initial turns. So for a monster with 10 HP, you'd go to 15 HP, but rapidly lose 1 HP for 10 of your turns (as you're moving at double speed), until you end berserk at 5 HP. The problem is ogres have pretty high defense and hit hard in addition to their knockback damage - if you're stuck in a corner ogres will drop your HP incredibly quickly. Even with the player getting 10x their HP, and 2x their base attack I still died to a single ogre. Not really a monster to mess around with especially without ranged attacks.

Tuesday, June 12, 2012

Added line-of-sight via Bresenham's LA.
Added equipables (weapons, armor, accessories) and a really basic randomized loot generator!
Added equipment screen.
Added using equipment in combat/speed calculations now.

I've been using Trystan's blog (as well as Roguebasin which I think I've cited before) for examples on how to implement things.

Monday, June 11, 2012

Added general effects class (for item usage, buffs/debuffs, etc etc)
Added item use functionality (only one item has a use so far: basic healing grass item)


Sunday, June 10, 2012

Added the inventory menu.
Redid the NPC and player classes so they inherit from abstract general character class.
(Item use still not functional yet though, but almost there!)

Blogspot has changed again...

Added a title screen menu and figured out how I want to do menus in general