mWall games/code/stuff

17Aug/13Off

Useful shell alias – Display all lines containing TODO, FIX or XXX

As I often use comments to point me to particular parts of the code, and like to use common [TODO] [FIX] [XXX] tags, I've figured out this handy alias that will list all the lines within the current directory and below, along with the line numbers.

alias whattodo='grep -rn "TODO\|FIX\|XXX" . \
                           --exclude=".git*" --exclude-dir={.git} --color'

Place that in your ~/.bashrc or ~/.zshrc or whatever config file your shell is using. By default it ignores all git related directories (by exclude options).
Just type whattodo in your work folder to use.

Tagged as: , , , , , 3 Comments
30Jul/13Off

Stabby 7DRL Challenge 2013 Post-Mortem & What’s going on

Hello everyone,

Long time no post, as some like to say. And the last post was announcing my 7DRL, which may look like it was a runaway project.
I did however change the project status to "Failure" when the time was up, a gesture that - by folks at RLR - meant I cared. And I did. I still do.

This article is ment to be the usual post-mortem of a software project, highlighting both good and bad things tha happened. By the end I want to announce some other stuff I've been working on, but I'll include more info in another post, or posts.

Timeline

Without actual timestamps, because I can hardly remember what's been happening day-to-day back then now.

  1. Made the basic map display + sprite walking around with key input
  2. Created a rudimentary UI frame that still does nothing except looks kinda nice
  3. I started on the map gen, figured I can use 'thin walls' due to having sprites instead of single character ASCII grid
  4. All goes to shit. (read 'what went wrong' below)
  5. Joshua Day [huge thanks here] helped a damn lot with adapting his spiral shadowcasting FOV for the thin walls
  6. After getting pummeled by the FOV and dungeon generation problems I finally give up
  7. Guilt fueled game binge, I think I played modded Minecraft for a month or two

What went right

  • I do belive I had a small enough scale planned, well laid down in my mind
  • I had a small, simple base game in mind with a lot of extra content I could have cut if needed
  • I have prepared some basic tiles before the challenge - I have decided that since I have almost no graphics experience I can excuse myself
  • I chose tools I already had experience with - making of the base boilerplate - the map, the display, sprites walking around was done in few hours
  • I have a great resource in guys hanging around #rgrd, always helpful even when sacrificing their own 7drl time [Thank you!]

What went wrong

  • Very quickly I've decided to use 'thin walls' (see below for screenshots) - a cool concept, but as turns out the source of all bad
  • Standard FOV algorithms were almost unusable due to thin walls
  • I refused to use standard raycasting fearing it would be bug-prone and slow (as experienced in Spaced) - probably would solve the FOV problem faster than what I went for
  • The basic dungeon generator (the same I used in Warden and knew from the libtcod tutorial) had to undergo many tweaks due to how the rooms were carved into the level, I had even more trouble with corridors
  • Basically, I should have backed away from thin walls, but I was in too deep
  • It didn't come to this, but I wanted to implement a simple Djikstra Map for the AI. As of week ago (from today) I didn't know how to do that. Learning new things by chance while trying to finish something on a clock is great, but don't count on succeeding in the learning process or finishing for that matter.

What I've learned

  • Choosing an unorthodox feature may take up more time than just implementing it directly took
  • When in a swamp, don't wade in further, get back and change what is pulling you down
  • A lot of C, and I'm even more proficient working with SFML
  • How to write a rudimentary makefile instead of just copy-pasting it from someone elses project, along with some simple build/run fast iteration bash scripts that will (and already were) useful in other projects.

So that's that. Don't ever go full thin walls. Or do, but think about what it means for the FOV, collision detection (that was actually pretty easy compared to other things), dungeon generation and other parts of the game.
I've played myself into a corner with this, not entirely sure what I was doing and going deeper and deeper into problems that I could have solved by taking few steps back, and changing the game back to using the usual 'full tile' walls.

Stabby now - notice the thin walls, especially to the 'west' of the player (the arrow). The FOV algorithm is still a little wonky. Image links to it's full version.

What has happened since

As stated above I haven't done much of anything up to around June.
I went to IRDC2013 in PoznaƄ which turned out to be a good idea. With meeting great people, having a lot of great discussions about roguelikes and other games pushed my brain into the familiar 'working' mode I've been thrown out from by the failures of the early year.

Directly after returning home from IRDC I've created a new game project, which I also wanted to have in 'basic game' state in around a week or two. Sadly I got distracted/annoyed/lazy and it's still just displaying a scrolling map. Which is still a small success, I haven't done anything like that before. I consider the project on my TODO list, and I'm looking forward to it's challenges. Don't want to announce it or share the code yet, or even talk about it much. Talking never gets me doing anything.

Two weeks ago or so, 'on borrowed time' I've created a small organizational tool intended for integration into my dynamic message of the day script on the server (maybe I should write something about that one too?). I wrote it in python since I prefer its text and file parsing more sane for the task than, say, C. I've managed to write it start to finish in few hours and right now it's in it's 1.0.1 form on GitHub and AUR. I have not gotten any feedback on it yet, so if you feel like testing a small CLI application, send your opinions my way.

Recently I've been working on Stabby again. I hope to release the basic, at least, game for the upcoming International Roguelike Release Party 2013 in September. I'm doing some stable progress, recently managing to break the bubble of mystery that is Djikstra Maps with help of Derrick Creamer from #rgrd. You can follow the developement of Stabby on GitHub if you like, but I'll try to keep updating this blog in following weeks.

Djikstra Maps Prototype, two points of interest; -5 value one in the middle upper room, and 0 by the bottom right of the map. Image links to it's full version.

Expect soon-ish posts about:

  • stodo
  • the dijkstra maps prototype
  • server move and setup

Thanks for reading and take care,
MW