i7 / kerkerkruip

Kerkerkruip - the interactive fiction roguelike game
kerkerkruip.org
84 stars 13 forks source link

Decentralisation #71

Closed VictorGijsbers closed 11 years ago

VictorGijsbers commented 11 years ago

All code should be local. If I write a new monster, I should only have to update Kerkerkruip Monsters, for instance. Not having this be the case is asking for bugs. Here is some stuff that needs to be decentralised:

VictorGijsbers commented 11 years ago

I'm putting a comment here because I'd like to stress that decentralisation is absolutely necessary to keep Kerkerkruip maintainable. If I copy-paste the code of one monster and edit it to become a new monster, it should be the case that I automatically do everything that needs to be done. If I also have to change stuff in six other files, things will go wrong.

ektemple commented 11 years ago

A difficulty with decentralization is that, if we want the Glimmr stuff to be easily removable from the game by just flipping a compile switch (as it were), we have to keep it separable from the other content. There are issues with inclusion order--all figure names have to be declared to exist before they can be assigned to their game counterparts for example. Probably none of this is insuperable, but we'll want to proceed with caution before moving code all around, only to find that the game no longer compiles.

We will likely need to have a subsection with each monster or room for figure names, for example:

Section - Figure declaration for the armadillo

The avatar of the armadillo is Figure of map_avatar_armadillo.
The legend-label of the armadillo is Figure of map_legend_label_armadillo.

But it probably won't be as simple as just doing that!

The Table of Soul Descriptions could be atomized into separate properties for each enemy, and I suppose the Enemy Powers could be as well (though the latter would be pretty awkward). Really, the help material on powers ought to draw on the data in the Table of Enemy Powers--in fact, the help material is also probably in general something that should also be decentralized. Unfortunately, that's pretty much impossible due to the limitations of the implementation of menus using tables.

I'm not sure how the short status rules can reasonably be decentralized, except to put them in the Actions and UI file, in the same way as the standard status rules.

curiousdannii commented 11 years ago

It's easy enough to build menus at run time. Alternatively, each monster could use (continued) on the tables.

curiousdannii commented 11 years ago

The short status rules are decentralised now, but I won't guarantee that they will be ideal. You may want to reorder the rules.

ektemple commented 11 years ago

Yeah, this needs some cleanup and may be pretty far from ideal. It will also make it impossible to implement this:

Victor:

  1. The short status line can show up like: "You are human, stunned." Of course, "You are human and stunned." would be preferable, right? But also pretty difficult -- or at least a lot of work -- to implement. How do we feel about that?

Erik: Thought of a relatively simple solution to this one, with output like:

You are human. You are stunned. You are undead. You are flying, enraged.

This requires an extra "if" statement before each item in the second part (to test whether we have or have not printed "you are" yet), but it shouldn't present much in the way of a performance hit, and doesn't require indexed text. I also think it's better than the option previously discussed.

curiousdannii commented 11 years ago

No, it will still be possible. If the rules won't do that now another option would be to fill a list with the statuses and then output that.

ektemple commented 11 years ago

I'm working on a new version that hopefully will work better. It will split the status rules into two rulebooks, one for combat bonus reports (e.g., "Concentration: +2 to this, +1 to that") and one for attributes of the player (e.g., greedy, winged, etc.) This will allow the regular status rules to have a bit more order to them: all of the directly stat-based buffs will be shown in one place, other buffs next, and powers last.

curiousdannii commented 11 years ago

Okay, thanks Erik :)

mciul commented 11 years ago

I think I could handle soul descriptions if nobody else is working on that.

VictorGijsbers commented 11 years ago

Sounds good!

mciul commented 11 years ago

I've already started. I noticed that several monsters don't have soul descriptions so I'm writing them in.

mciul commented 11 years ago

All right, I think I'm done, but I don't seem to have permission to push.

mciul commented 11 years ago

By the way, is there a test suite I should run? Forgive me if I missed some documentation I should have read.

VictorGijsbers commented 11 years ago

Great! Nope, there's no test suite. Permission of github ... hm, I think Dannii might know how that works?

curiousdannii commented 11 years ago

I've given you access. And there's no test suite, but you could always add one! I wrote a unit test extension that could be used.

mciul commented 11 years ago

Thanks, Dannii! I've pushed up a branch called souldesc. I'm not sure how kerkerkruip is managed, if I should let someone else do the merge/pull? I'm not quite familiar enough with git to know exactly what to do from here.

curiousdannii commented 11 years ago

You can just push to master, but maybe it's well you didn't, because your commit only included 2 files, which are 2 files that shouldn't really be changed! At the moment you have to manually copy across the extension files into your git repo. The next I7 version will make it easy so hopefully that won't be needed.

mciul commented 11 years ago

Oh, you're right, I totally forgot to copy the live extensions back into the project. I had a script to handle that for svn, maybe I can make it work for git too.

I'll try reverting those two files and see if my project still works.

curiousdannii commented 11 years ago

You could consider setting up symlinks too. I think some of the other guys have done that.

mciul commented 11 years ago

Which way do they point - from Inform extensions to git repository?

curiousdannii commented 11 years ago

That would be simplest I think.

mciul commented 11 years ago

Can I just rant here a little bit? I hate dealing with filenames that contain spaces. Why doesn't this work?

$ cd ~/Library/Inform/Extensions/Victor\ Gijsbers $ find ~/i/kerkerkruip/Extensions/Victor\ Gijsbers/ -print0 | xargs -0 -n 1 ln -f -s ln: ./: Invalid argument

Maybe it's just BSD's fault. I don't have as many of this kind of problems on my Linux machine at work.

mciul commented 11 years ago

Thank God for my colleague Dave Graff. shloop to the rescue:

http://www.perlmonks.org/?node_id=154018 ls ~/i/kerkerkruip/Extensions/Victor\ Gijsbers/* | shloop -e "ln -fs '\i'"

mciul commented 11 years ago

Okay, now I'm having a bad day. I forgot to back up my changes before I did that! :(

I re-checked out master and tried opening Inform, now I get a runtime error P48 "Error handling external file"

mciul commented 11 years ago

Okay, I've pushed my changes to master on the assumption that I did them right and the runtime problem is just an issue with my system. I hope I haven't caused trouble for anyone else.

My system keeps changing Kerkerkruip.inform/Settings.plist - I fought it off this time but I may have to take steps to avoid the hassle in the future. This is the only change:

-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

curiousdannii commented 11 years ago

If you run the tools/setup script it will now ignore further changes to Settings.plist :)

ektemple commented 11 years ago

What should I do about this? I tried to pull the latest changes and got this error; I assume it's related to the changes you recently made, Dannii? From the log of SourceTree, my git client:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree fetch origin git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree pull --no-commit origin master From https://github.com/i7/kerkerkruip

  • branch master -> FETCH_HEAD error: The following untracked working tree files would be overwritten by merge: Projects/Kerkerkruip.inform/Index/Headings.xml Please move or remove them before you can merge. Aborting Updating 24b9fff..9fd13b9 Completed with errors, see above

Does this just mean that we've started tracking Headings.xml for some reason?

curiousdannii commented 11 years ago

Yep, it's just complaining that the file already exists. You'll have to delete it, but you'll only have to delete it once. We're tracking it so that new clones won't complain about it not being there. You'll all need to run the setup script too. Hopefully it's cross platform.

ektemple commented 11 years ago

OK, great. Hopefully this will prevent having to create a new project on OSX before you can compile for the first time (and the cascade of problems that doing so creates).

mciul commented 11 years ago

setup was not owner-executable when I checked it out. I added permissions and pushed it back up.

I'm still getting the same runtime error, though - I have no idea what file it's trying to read. Should I look into it? I'm not even sure how to tell, but maybe somebody could give me a quick summary of what files Kerkerkruip tries to read, and from what extensions.

mciul commented 11 years ago

I cut and pasted the Table of Enemy Powers into Kerkerkruip Monsters. Is that good enough? If authors want to put their monster stats with their own monster code, they'll still have to extend the table. Otherwise I think we're talking about confusing property assignments or creating a various powers to various faculties relation.

https://github.com/i7/kerkerkruip/commit/0a1b8b2488a8d65c8e457d8b944d0348a6c20697

VictorGijsbers commented 11 years ago

I distributed the Table of Enemy Powers further. Closing this issue for now, reopen if you find something that needs to be decentralised.