Queen of the Capes
unread,Sep 10, 2010, 5:23:18 PM9/10/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.