Devil's Dungeon

17 views
Skip to first unread message
Message has been deleted

Queen of the Capes

unread,
Sep 10, 2010, 5:23:18 PM9/10/10
to Open Source projects for Tads3
So here it is: Devil's Dungeon. All of the files are posted in the
Pages section.

It's sort of a game-within-a-game, modeled on basic fantasy RPGs. My
goal was mainly to make it detailed, complex, and easily expandable.

You may note that alot of the objects are what should be, in a normal
game, PreinitObjects or InitObjects. However, due to the set up of
Devil's Dungeon as a game-within-a-game (which was done purely to
handle character creation), most of these are simply custom objects
with exectue() methods that are explicitly called by a separate
beginGame() method in the main file.

Here's a run-through of the files. If you like, I'll be happy to
discuss any of them in greater depth.

DD Clothing: This is a versatile piece of code that can be used in
other projects with minimal adaptation. It's based on a setup from
the Quest IF-building software, which was about having clothes that
layer realistically. (e.g.: You cannot remove your shirt when you
have a coat on over it.) ActorManager and ClothingManager work to
tally up all the actors in the game and what they are wearing when the
game starts; this prevents a woman in an elaborate ballgown from
triggering flags that test for nudity or skimpy clothing values.

DD Armor: Again, this should be fairly versatile, though for reasons I
now forget, I made Armor inherit from my custom Clothing class. I've
also been working with making weapons that have "effect" methods which
can be called in combat, e.g., a sword that has a risk of stunning
with every blow.

DD Managers File: Excluding noted exceptions such as clothing and
armor management, this file has all the abstract objects that keep
track of things in the game. My personal favorite here is the Time
Management section. I wanted DD to keep track of DAYS instead of
turns; if you sleep in the inn to recover, you wake up the next day
and find the world has changed accordingly. I also wanted the game to
be easily expandable map-wise, so I came up with the TimeKeeper
system. In theory, any location file can have its own object of the
TimeKeeper class, which keeps track of any flags for that location
such as local holidays, birthdays, etc. A master object in the
management file hunts for and calls any TimeKeeper items throughout
the game, so locations can be added and dropped with minimal
consequence.

DD Verbs: Custom verbs used in the game.

DD Combat: This code is hooked up to the Armor code mentioned above.
Bare-handed fighting and fighting with a weapon are handled in
separate methods. The reason for separating them, instead of just
adding a weapon bonus to the basic attack, is that something like a
giant golem with boulders for hands might be less effective with a
sword than if he just punched you. Also, every blow in weaponized
combat will give the weapon a chance to do any Effects it may have,
such as stun, poison, or health-leeching. Um...I didn't actually get
around to *making* these effects, but the *possibility* is still
there! It also checks for Critical Hits.

DD Main File: This is the main game file; it contains the setting for
the meta-game, as well as information on the races. The three basic
races are Human, Fairy, and Beastling, but again, I tried to allow for
easy expandability to this list.

DD Topics: Abstract Topics for conversations with NPCs. There's not
a lot here yet.

DD Village: The first, and so far, only location in this game. It
has an inn, a garden, a stable, and a smithy. Not much else yet,
although I had a bit more planned.

DD GM Character: This guy's main purpose is to be the vehicle for you
creating a character. After a while, I toyed with the idea of him
being the antagonist and ultimate boss fight, but that hasn't really
come up.

DD Innkeeper: An innkeeper, and possible love interest. I wanted to
make more complex interactions possible with NPCs in this game, up to
and including getting married and starting a family (like that one
videogame on Penny Arcade). How I was going to manage that when I
can't write romance and won't write smut, I have no idea.

DD Inkeeper's Brother: Another NPC. I didn't really get around to
fleshing anyone out very well, partly since I have a hard time
thinking like a writer and a programmer at the same time.

DD Smith: Another NPC, meant to also be a merchant you can buy
equipment from. Not fully implemented, for which I am sorry.

DD Horse: Okay, here's something interesting again; I tried to make
it so that at least one of the races can talk to animals as
compensation for not being able to read. However, there's a bug here
which I can't fix; exiting a conversation with the horse shuts down
the entire game. I don't know why.

DD Breeding: This is the file that shut down my entire project. I
wanted to come up with a system that could handle everything from a
couple choosing to have children, to animals and monsters
automatically spawning. I tried to start very simply and work from
there: conception() initially just figured out the theoretical due-
date and flagged pregnant to true. Then I told it to run breedCheck()
to test for fertility, and suddenly it shut down. Even when I emptied
the method completely, it wouldn't run, even though I was basically
saying "Do nothing, and then do the script that was working before."
The problem areas the editor pointed to changed with every tweak I
made, finally settling on code on another page that had been working
fine before this file was ever added. I finally disconnected this
file, the game crashed completely, and now here we are.

strask

unread,
Sep 23, 2010, 4:42:12 PM9/23/10
to Open Source projects for Tads3
On Sep 10, 2:23 pm, Queen of the Capes <queenoftheca...@gmail.com>
wrote:

> DD Breeding:  This is the file that shut down my entire project.  I
...
> Then I told it to run breedCheck()
> to test for fertility, and suddenly it shut down.  Even when I emptied
> the method completely, it wouldn't run, even though I was basically
> saying "Do nothing, and then do the script that was working before."
> The problem areas the editor pointed to changed with every tweak I
> made, finally settling on code on another page that had been working
> fine before this file was ever added.  I finally disconnected this
> file, the game crashed completely, and now here we are.

If you were using a version control system of some sort, this problem
never could have killed your project; you could always revert to a
previous good version.

Probably the best free version control system is Mercurial. If you use
windows, there is a version of Mercurial called TortoiseHG that you
can get from here: http://tortoisehg.bitbucket.org/

To learn how it works, you could start with the tutorial here:
http://tortoisehg.bitbucket.org/manual/1.1/quick.html

But if you are working by yourself, it's even simpler than it looks
because you never have to share your repository with anyone else, it's
just for you to keep track of your own changes.

I'll make you a deal, if you want. If you wish to continue work on
this project, I'll figure out what went wrong and get it back to a
compile-able state, then you use some kind of version control from now
on so this won't happen again, sound good?

-Chris

Queen of the Capes

unread,
Sep 26, 2010, 10:53:50 AM9/26/10
to Open Source projects for Tads3
Hmm, sounds like it could be worth a shot. All right, thanks. =D

strask

unread,
Sep 27, 2010, 8:08:49 AM9/27/10
to Open Source projects for Tads3
> Hmm, sounds like it could be worth a shot.  All right, thanks. =D

Ok I didn't make many changes, just cleaned up a couple of lines
really, and it compiles and seems to run fine. You can get a copy of
the code by using Mercurial/TortoiseHG to clone https://devilsdungeon.googlecode.com/hg/

I didn't test extensively, but I was able to create a male human
character, wander around the village, kill the red devil. I couldn't
figure out how to get a room at the inn, maybe that's not implemented
yet.

The breeding stuff was compiled into the game, but I didn't check to
see if it was actually being executed so there might be lurking bugs
there still.

Clone the repository and try to compile/run, and let me know what
happens. :)

-Chris
Reply all
Reply to author
Forward
0 new messages