[crawl]7drl

This blog documents my 7-day roguelike project for rec.games.roguelike.development. My project is a small variant for the roguelike computer game Linley's Dungeoncrawl.

Name:
Location: Palmer, Alaska, United States

Friday, December 15, 2006

Kervin.cc

// Kervin.cc
#include "Kervin.h"

// Kervin is a librian. He likes to sort notes about various objects. He
// started out as a wizard, entered the dungeon an ran screaming when he met
// a skeleton. He's petrified of undead. So he'll make a run at the dungeon
// from time to time: for research and swag; but he spends most of his time
// sorting other people's notes.
//
// Kervin has a filing cabinet built by Grn, a furniture-making Warper
// Every file is something out there. Each page in the filing cabinet is a
// description of that thing.
//
bool Kervin::fileMyPage( page p, file f ) {
f.push_back( p );
Grns.insert( f );
return 1;
}

page Kervin::TellMeabout( topic t )
{
file inHand = . );
read inHand.pop_back();
inHand.push_back( read );
return read;
}

Kervin's Head

#ifndef KERVIN
#define KERVIN

#include
#include
#include

typedef std::string page;
typedef std::vector file;
typedef std::string topic;
typedef std::set FilingCabinet;

class Kervin {
private:
FilingCabinet Grns;
page read;
public:
// a file from me
bool fileMyPage( page, file );
page TellMeabout( topic );
};

#endif

Franco Head

#ifndef FRANCO
#define FRANCO
//
// Franco is a reporter. He likes to conduct interviews outside
// the dungeon. He reports to Kervin and to the user. He only cares
// about monsters. He would like to care about more though.
//
#include
#include
typedef std::string topic;
typedef std::string description;
typedef std::vector notepad;

// Franco talks to Kervin
#include "Kervin.h"

class Franco {
private:
notepad n;
topic t;
public:
Franco();
//get the word from the cave
bool askKervinabout( topic );
//describe a monster from input
bool record( topic, description );
};
#endif

Cast of Characters

Started some brainstormy coding. My program is like an on-the-spot dungeon interviewer:

//
//This is TheWordfromtheDungeon, a note writer for crawl stsp0.1.5.
//
//There are three members of this new reporting team so far:
//
//Franco - Your newsman by the cave. You invoke him by pressing while
//targeting a monster. He'd like to know what you have to say about that
//beast you just mercilessly slaugtered. He gives you a mike on your way in:
//no way he's getting too close to the action.
#include "Franco.h"

//
//Kervin - You don't see much of Kervin. He's a librarian; he keeps track
//of all the notes.
//
#include "Kervin.h"
//Jubilee - Franco's assistant. She handles editing for those times when a
// stalwart adventurer notices something just a little different. Jubilee needs
// a team.
//
#include "Jubilee.h"

//
// The show
//
#include
using namespace std;

int main() {
//
// Asking Kervin to do something.
Kervin please;
page MyFirstNotetoKervin = "A filthy, crusty, deformed gibberling.";
file goblin;
if( please.fileMyPage( MyFirstNotetoKervin, goblin ) )
cout << "I think he filed it." << endl;
cout << please.TellMeabout( "goblin" );

// an empty Franco
Franco F;
// Franco please( "goblin", "Filthy, ugly creature." );
// please.record( "goblin", "Filthy, filthy beasts.");
// please.askKervinabout( goblin );

}

Tuesday, November 28, 2006

Loaded some descriptions

I wrote a few descriptions for monster ideas. I also managed to load the basic crawl monster descriptions into a vector. I'm studying containers right now for Strousrup's book, _The C++ Programming Language_, St. Ed. I guess I should use a map instead.

Here's what I have right now:

//Note.cc
using namespace std;
#include
#include
#include


string describe_monsters( int );
class Note
{
friend ostream &operator<<( ostream&, const Note & );
public:
Note( string s){ description = s; }
void displayNote(){ cout << description; }
private:
string description;

};

ostream &operator<<( ostream &output, const Note &n )
{
output << n.description;
return output;
}


//cwde
int main()
{
vector monsterDescriptions;

monsterDescriptions.push_back("Rats are rats. This rat's fat.");
monsterDescriptions.push_back("No bats are good bats.");
monsterDescriptions.push_back("\"Yip! yip!yip! Yip! yip!yip! Yip! yip!yip!.....Rar!Rar!Rar!Rar!rar!" );
monsterDescriptions.push_back("\"I give your head to Blork. He eat your brain for breakfast. Maybe me get an eyeball. No....I eat your brain.");
monsterDescriptions.push_back("\"Mead tastes good! So do Dwarfs! I soak my Dwarf's corpse in mead, of course!\"" );

monsterDescriptions.push_back( "A filthy, dirty creature." );
monsterDescriptions.push_back( "\"Eves? Giv' me a break. Eve's don't botta us. I dunno why; maybe we too tough. Heh.\"");
/* eves
eves are psychic beings that mutate by stealing players skills and abilities. Some, like wichoreveda, are completely or mostly unformed; while others, like raceevelst, are created from a spiritual seed. For the raceevelst, the seed is the spirit of a centaur that is lost from it's body.
*/
monsterDescriptions.push_back( "Your mentor; no, your enemy; no, your lover; no, you can't remember. Everytime you think about this creature, it changes in your mind. Should you kill it? Is it your ally? Is it beautiful, hideous, or bland? You can't remember." ); //unformed eve
monsterDescriptions.push_back( "A pregnant woman with heavy eyes." ); //angry pregnant human eve
monsterDescriptions.push_back("The centaur glances about frenetically. 'Til he sees you of course." ); // lost centaur eve

//crawl descriptions
for ( int i = 0; i < 440; ++i )
{
monsterDescriptions.push_back( describe_monsters( i ) );
}
for ( int i = 0; i < monsterDescriptions.size(); i++ )
cout << i << monsterDescriptions[i] << endl;

return 0;
}


// From enum.h

// note this order is very sensitive... look at mons_is_unique()
enum monster_type // (int) menv[].type
{
MONS_GIANT_ANT, // 0
MONS_GIANT_BAT,
MONS_CENTAUR,
MONS_RED_DEVIL,
MONS_ETTIN,
MONS_FUNGUS, // 5

...


// from describe.cc

//---------------------------------------------------------------
//
// describe_monsters
//
// Contains sketchy descriptions of every monster in the game.
//
//---------------------------------------------------------------
string describe_monsters(int class_described )
{
std::string description;

description.reserve(200);
/*
#ifdef DOS_TERM
char buffer[4000];
gettext(1, 1, 80, 25, buffer);
// window(25, 1, 80, 25);
#endif
*/
/* I don't understand this part yet.
clrscr();

description = ptr_monam( &(menv[ which_mons ]), DESC_CAP_A );
description += "$$";
*/
switch (class_described)
{
// (missing) case 423 - MONS_ANOTHER_LAVA_THING ??? 15jan2000 {dlb}
// no entry in m_list.h 17jan200 {dlb}
// monster has no stats!
// mv: changed ANOTHER_LAVA_THING to SALAMANDER, added stats and
// description
// (missing) case 250 - MONS_PROGRAM_BUG ??? 16jan2000 {dlb}
case MONS_KILLER_BEE_LARVA:
description += "A small, powerless larva of killer bee.";
break;

case MONS_QUASIT:
description += "A small twisted demon with long sharply pointed tail.";
break;

case MONS_ANGEL:
description += "A winged holy being of unnatural beauty. "
"It's surrounded by aura of brilliant golden light. ";
break;

case MONS_HUMAN:
// These should only be possible from polymorphing or shapeshifting.
description += "A remarkably nondescript person. How odd!";
break;

...

Monday, October 23, 2006

The 7drl in this project has officially changed from "7 day roguelike" to "7 decade roguelike".

Wednesday, October 18, 2006

I busted my compiler Sunday night. I've finally got crawl building again. I think I sabotaged myself. Procrastinated starting my project. I setup too many cygwin, mingw, and gnu tools and got my paths mixed up. Suddenly nothing worked right. Instead of trying to figure out what I did, I got frustrated and begin setting up Debian. (I have Procrastination: >= Level 8) Anyway, I've finally resetup cygwin and have crawl makefile.lnx compiling! Whoo hoo. Hopefully I'll be ending my procrastination subroutine soon.
Now I will try to figure out how Haran's notes* files work. I'll mimic to begin making my database objects.
In the meantime, I'm crawling now and again in order to build up a description database. For now, I am using Haran's notes and chardump's to build description content.

Thursday, October 12, 2006

Wanderer Branch Concept

You begin as a wanderer, unsure of your past. Much of your memory has evaporated; you're in a cave. Blood is in the air, danger crackles about you. You want to go down...deep. You need to. You have a smattering of equipment and a case. Inside is a writing set and a plain, empty book. Compulsively, you begin to write:

//player writes any background or story so far information here:

You put away your writing set and briefly flip through the strange journal. New pages have appeared! The new pages are of a slightly different color from the the ones you've written on. And there is one new page for each used page. Enough musings, it's time to wander...

So, this concept is really a showcase for new journalling features. I'm a big fan of Haran's notetaking patch for the following reasons:
1. I sometimes like to play "in character", writing my characters thoughts as I go.

2. Writing my actions down helps me reenforce new tactical ideas.

3. The notetaker is nice for tracking bugs and learning about the game's features because it tracks the turn number with the note. Thus, I can calculate how long it takes to get hungry, or to heal, or how long a spell lasts very easily, and, more importantly, while playing.

Now, I want to be able to describe my environment while I'm playing as well. Name the rats. Describe each one. Make jokes about them. But I don't want to leave the dungeoncrawl game in order to do these things. No Alt-tabbing to an editor program, or chardumping then Ctrl-Xing to a prompt. I want to stay "in" dungeoncrawl as much as possible.

And I want to import other people's writings as well. Assuming there are like-minded individuals out there.

So in the future, when I <'x','?'> a giant bat I might see:
A huge black bat.
Or I might see,
A huge, angry black bat.
A huge, red bat.
Or even,
"It's impossible to find this black bat's eyes through it's handsome head fur. It keeps making piercing shrieks at you. Is it talking? I'm getting a headache, I must smash it with my hammer."

Or whatever.

I then want to be able to edit, append to, or replace the description and I want the original description to be available.

So that's the basic idea behind the note processor I'm building. A few people have mentioned Nethack to me. I haven't played this game much because I don't like starting with an animal. It gives me mixed feelings. 8) Anyway, I'm planning a raid on nethack source files tonight.

The note processor is the focal point of my 7drl. I'm creating a low-level branch from D1 to the Ecumenical Temple as a minigame to test the note processor. Hopefully, I'll complete the noteprocessor first, then use it to help make the branch. My point here, is that a lot of my 7drl may end up being a lot of description input into crawl.

As others have written, I am taking on this project for personal reasons: my fun, tools I'd like to use, to gain some programming experience. Hopefully I'll make something others can use.

Thanks for reading,
Christopher Evenstar

Wednesday, October 11, 2006

Wanderer's 7drl project

This is the first, rough draft of my branch concept:
It's very sketchy at this point.
*****************************************************************************
Content Addition
New branch to the Ecumenical Temple (6-10 levels)
This branch will be available to all players, but is designed with wanderers in mind.

Amnesiac monsters
A set of new low-level monsters with amnesia attacks. These are dreamlike monsters that confuse the player and "steal || destroy" skill points. The more powerful creatures will be able to "steal || destroy" spent skill points, thereby removing skills from the player and adding skills to themselves.
These monsters will be added heavily to my branch, and sprinkled into the vanilla D:1-10 levels.

Amnesiac traps
Same effects as monsters. Some monsters will attempt to lead the player into
the traps.

Flashbacks
Flashbacks are rushes of memory the player experiences.
A brief, 2-3 paragraph, description of the flashback will be displayed.
The player will recieve skill points (spent and unspent).
Flashbacks are rewards for defeating NPCS and Amnesiac Monsters or Traps.

NPC Set
10 new npcs with amnesiac attacks and other new abilities. (Haven't put much
thought into these yet.) Npcs can occur on any of the levels. I'd like to
vary they're power level or abilitity set according to the level they're
generated on.

Ending - Entrance to the Ecumenical Temple
If the player is a wanderer, he or she gets to switch to a new class, or
remain a wanderer. Basically this will scan the player's stats/skills/inventory
then preform appropriate (and random) skill-switching, ability switching,
random magickal and divine effects and things like that. The code here will be
very spaghetti-ish, for fun (mine).

Feature Addition
Object note processor
Object note
Object notes can be created in a seperate notes file, or created/accessed
through the 'x' command in game.
An object note is used to allow players to create descriptions for things in
the crawl dungeon. It allows a player to describe the setting while playing.
It also can be used with other peoples notes, thereby sharing the experience
or creating random, conglomerate experiences.

Player can make a note on a given object.
Notes will be added to a note database and shared with others.

Object is created during grid generation // say a worm, a potion, the wall, etc.
Object is assigned a note from the database that corresponds with the objects type
Player can repeatedly add a note to the database
Note may be appended to existing object
Note may replace existing object
Original note and new note both exist in the database
Player can display the note // view the object

Other users can add to database

Wanderer's Journal
A book that may be found in the dungeon. The book will detail past adventurer's journeys, or at least, their scrawlings.
Database object like note. Notes files written in book.

Pregame Store
*bandish store. Options for random and set inventories.

Java Web Start for the application

Minor changes
manuals will have a higher generation frequency
walls will change to #
color theme: i'm thinking yellow and purple
reaver style characters with a random or choice of starting schooltype allowed

I'll not be worring about portablity or clean patch design for this challenge. I don't have much of a grasp on either of these technologies yet. I hope to use the 7drl as a furious trial-by-fire and sort out portablity and how-to-make-a-patch afterwords. That said, I plan to document within my code well. And I aim for as much modularity as possible. I'll put most of my code in new
.cc and .h files; then make minor changes to the original code. (hopefully)

Thanks, a lot, for looking at this,
Christopher Evenstar

PS On using a crawl variant as a roguelike project Generally, this seems to be an accepted practice for the roguelike contest. Contest is a bit of a misnomer. There is no prize, and not much in the way of rules. I am expected to make all appropriate acknowledgements of and to document what is copied content/code, and what is original content/code. The point of the contest is not to make a new roguelike from scratch, but to complete a game or concept within 7days. Sort of a communal creation frenzy. It's all very subjective.