dpeg wrote:I think what the "just rewrite it" folks miss, apart from the sheer workload, is the core problem: so you want clean combat formulas (for example, to give specific damage feedback like in Brogue). On the other hand, you want to replicate, or at least closely imitate, the current gameplay of Crawl. These two goals are very much conflicting, and I think this is where Brent got stuck. There are very many interacting systems (in codepaths and for e.g. damage distributions), and the complexity probably just exploded in his face.
As part of the last release cycle I contributed a fix for a fairly tiny bug to do with Qazlal's elemental protection not triggering in a lot of cases, and dpeg's point here really resonates with me. To fix it I had to understand how elemental damage actually gets applied, which turns out to be
extremely complicated. This is just a tiny slice of the picture, relative to the whole codebase. The scope of what would need to be done on a rewrite is way more massive than the people here who haven't actually dealt with crawlcode realize, and "1 year" in particular is wildly unrealistic (unless perhaps you have a paid team with good management).
Now that diagram probably does indicate that
something should be rewritten, and it isn't as if devs haven't talked about it before (e.g. devs who aren't even active any more were considering rewriting the staff code represented there years ago). But to seriously rewrite even this little bit of crawl, you'd have to (i) understand what everything does do, (ii) understand what everything is or was intended to do, which can differ from (i), (iii) decide if it
should do that, which if it involves a team would require consensus, (iv) figure out what an actual improvement in code organization/structure would entail (many people making the rewrite suggestion seem to assume it would always be obvious), and then finally (v) actually do the rewriting. But we're not done, because (vi) is making sure it actually does what you intended (especially in terms of interactions with other systems). If you skip (i-ii) you might as well just write your own game (IMO), and (i-ii) are a
huge amount of work in crawl. In a large game where there's a lot of interacting systems in place (vi) is quite overwhelming for an all-at-once rewrite.
But, you say, the devs already go through something like this process and know the codebase, can't they just rewrite the whole game from scratch? In fact that's maybe sort of what they're doing, but piecemeal over a realistic timescale for a volunteer large open-source project, not an instantaneous timescale. But even given this, while several devs helped me when I was working on this patch and knew something about how elemental damage worked, the only dev who was really an expert on it was inactive; I think the code base is large enough that there are many parts that no one is currently an expert on. I got the impression that the devs I was talking to (esp. neil) would've been
happy with a rewrite of the elemental damage system, but someone would have to actually do that (it's fairly non-trivial, I estimated a month of solid free-time work for me, knowing this part of the code but not being especially good with crawlcode or c++, and that's not counting testing or getting consensus; in the end I just moved on with my life). So if you want to accelerate the rewriting process IMO your best bet is to actually make a positive contribution by rewriting pieces of crawlcode that need it. Of course this means you can't just impose your own will and need to actually communicate productively with the devs to reach consensus, which doesn't always go over well in tavern.
Also, maybe it's that I'm old, but when I hear "why don't you rewrite your open-source project from scratch", I think about
GNU Hurd, which doesn't yet exist in any meaningful sense.