Custom Library and Deep Modification

Hi!

I really love TADS 3, especially the AdvLite version. The problem is I kinda have a really similar idea for mechanics in all of the adventures I author, and they lean more towards blatant RPG mechanics than seamless immersive fiction. This means I find myself ripping out chunks of AdvLite quite a bit, and I’m noticing I keep making the same changes.

I just tried making my own text adventure engine in Java to facilitate these frequent, sweeping preferences and mechanics that I would like to reliably use, but making the engine is becoming a complete and total nightmare with no end in sight. My wife has reminded me not to reinvent the wheel, so now I’m wondering if I can return to TADS 3, and make my personal text adventure mechanic system here instead.

I’m wondering how far exactly I can modify the underlying code of TADS 3, and perhaps make my own variant of AdvLite, with my own standardized systems put in place. Is the entirety of TADS 3 completely open to modification? Is there anything I need to be aware of ahead of time before making my own standard library? What’s the limit I might have for modification before interpreters/runners might start having issues?

I’ve done a huge amount of coding in TADS 3 before, as well as many other coding languages. I feel like I have the skillset for the job. I’m just concerned that I might get blindsided by limitations, mostly.

Mostly what I have in mind is a standardized combat system, the ability to take free actions without other NPCs and world events taking a turn, progression of time per action, a simplified NPC dialog system, and the ability to sort actions into “groups” where some groups are enabled or disabled according to the situation, both so the player can compartmentalize the actions they use, and so that actions don’t need to be universally handled at all times by everything. For example, the ability to sort “go starboard” and “go aft” into an “internal vehicle navigation group”, and leave that group disabled when the player is not aboard a vehicle like a ship. That way, I don’t need to handle those actions for all circumstances, and can even cue the player on what action groups are being enabled and disabled, and also reduce the complexity of a help or lookup menu for these actions. If you’re not on a ship, the help menu won’t bother you with explaining the “go starboard” command. (This will also be useful so I can have these actions and action group handy for all games, but selectively keep some enabled or disabled on a protagonist skillset basis. If the player character isn’t equipped for combat, then I keep the combat action group disabled without yanking it out of my library entirely. Additionally, should the player change characters to one who CAN fight, then the combat action group gets re-enabled.)

Anyways, I don’t want to bother you with extensive details, but this is a bit of what I have in mind.

All tips and wisdom is welcome!

5 Likes

That sounds like a fun project. I use adv3, not Lite, so I can’t say how much exactly you’ll need to rip apart. But if you’re determined, I would expect you can find a way to accomplish your objectives with the language…

2 Likes

Have you tried organizing your frequently-used customizations into libraries/modules?

I don’t know how extensive what you’re trying to do is, but personally what I do is break out any discrete chunks of code into their own modules instead of trying architect everything together into one giant adv3 replacement. Basically any time I’ve got a distinct feature that involves its own classes, special purpose singletons, or just a bunch of related utility functions, boom fork that out of the game-specific code and roll it into its own module. Then I put together a couple of trivial test cases for whatever features the module implements, and ta-da I have unit testing and regression testing.

Building things this way also has a tendency to cajole you into better coding practices—if everything is all part of one great big blob there’s a tendency to just sorta kludge together whatever special cases you need in order to make things work instead of keeping things modular. This can bite you later on in development when you discover that making some “small” change in fact involves touching hundreds of lines of code because the code responsible for some behavior ended up getting dispersed into every individual caller instead of getting isolated off in one place behind a common API.

Anyway, building lots of modules instead of writing a standalone adv3 replacement is what I’d recommend unless you were really convinced the bigger project is what you want to do (which I guess presumably you’re not, or you wouldn’t be asking). Because if that’s what you decide to do then that’s what you’re doing—whatever game or games you may be trying to write are now locked behind however many hundreds of hours of library-writing. And, you know, if that’s what you want that’s what you should do. Not trying to talk you out of it. But in game design I think you always need to be asking yourself what you’re actually after, what you’re trying to achieve. Because it’s reeeeaaaaaallllly easy to talk yourself into repeatedly redesigning the wheel because wheel design seems cool and interesting and it seems like it would be fun to play with all the new wheels for awhile. But unless that’s what the project’s about, then it can just be time-eating a trap you’re laying for yourself that’ll keep you from accomplishing whatever it is you’re actually trying to accomplish.

That said, if you do want to roll your own adv3/adv3lite replacement, I think your best sources for how to do that are the things themselves. I haven’t done any deep dives into adv3lite, but adv3 is fairly well commented, so digging into it is probably the best resource for how to build a replacement.

2 Likes

I applaud your intention to advance TADS 3. It is an exceptional system. I would like to see it continue.

As you probably know, Eric Eve is the author of adv3lie (liter). It is most involved. His website and blog are still functional. It hasn’t been changed in many years. The blog has interesting insight as well as his github repository.

You can find the website here:

Please let me know if I can help.

PS. I don’t believe the TADS 3 code itself is open source. Adv3Lite also needs to be determined.

2 Likes

Oh yeah, I use the modular practice a lot. The problem is the current modules use a lot of “modify” statements and you gotta keep layering them in an exact way in the include statements. Also I keep using the exact same ones every single time, so that’s why I’m wondering if maybe digging deeper and creating a deeper modification of the AdvLite library might be in order, to make it feel like less of a bodge, and hopefully make the changes behave a bit more predictably.

Believe it or not, but coding in TADS 3 tends to be a lot less of a project that anything coded in Java. I at least will have the interface, parser, and some other basics already handled.

Either way, thank you for the coding wisdom; I have very few people with coding experience to talk to. I’ve been doing all my programming in the last 13 years all alone, and it’s made me kinda paranoid about if my practices are bad or not.

I haven’t really been active in the community too much even though I’ve been playing interactive fiction since I was a child; mostly just really shy. However I keep seeing these big names popping up everywhere. Eric Eve really does a lot of huge stuff, it seems!

Also I appreciate the note on the open source status. That’s also something I need to look into. I feel like I at least want to keep the language parser of Adv3Lite, as well as basics like rooms, decorations, and objects that can be taken and such. Most of my rewrite is focused on actions, characters, dialog, turn taking, combat encounters, specific non-combat protections, and flushed-out vehicle support for easier player control.

I feel like this won’t make me hit the actual code that interprets the files written in TADS 3 language at all. Just woke up, so I have yet to investigate this.

Thank you for the info.

1 Like

Whoof…long update. Buckle in.

So I’ve been digging around the adv3lite library files, and uh…a few things I was looking to alter are apparently deeply-embedded in stuff as deep as the primary header file.

Also, a lot of these code files seem to be deeply-connected and function with a high level of awareness of what’s in other code files.

I’m not sure what kind of big-brain mastermind Eric Eve is, but he seems to be able to contain a much larger functional picture in his head than I can. I’m very good at analyzing systems (and usually don’t need a debugger for most problems), but I also need to be able to break systems down into smaller pieces first. A lot of what’s in adv3lite seems to be this sprawling, highly-tuned, magnum-opus-style of clockwork, where changes occurring on one side of the landscape are clearly felt on the other side.

So the main problem I’m having is I would need to gain the correct level of understanding and awareness before I can start cracking into anything. However, I think that would require me to have a functional-unified-object imagination on the scale of Eric Eve himself, because while I understand what the majority of these components do (and how they work), I cannot quite contain it all in my brain at once.

I’m really considering returning to my Java project, honestly. It’s looking like the problem of two effort measurements: Digging 1.5 meters down and building 2 meters back up, versus digging nothing and building 2.5 meters up.

I feel like it would be a lot more doable if I wasn’t trying to completely change the structure and functionality of the Thing object, Room object, Action object, the whole conversation system, vehicle functionality, the foundational action-checking system, and turn systems.

Also, if/when I reach the point where my Java-based engine is done, I have another problem: Java is not a very good language for creating interactive fiction worlds in, even though it’s good at general application development. I rather like TADS 3 for how easy-breezy it is to write up detailed environments with little effort.

Now, the deepest abyss I could look down right now comes from the idea of making a whole TADS 3 library from scratch, and not forked from the adv3lite library. Y’know: dig nothing and build instead. The problem here is: while I have a competent understanding of adv3lite (again, cannot contain its entirety in my head, though), I know next-to-nothing about what is found at the very bottom foundation, where adv3lite makes contact with the TADS 3 bedrock, and I know very little about how the English language is handled in TADS 3 and/or adv3lite.

Also, I’m not sure how in-depth I can afford to make my library, because I tried something really complex and daring once in adv3lite, and wound up lagging the valiant QTads to a crawl, despite using every single garbage collection trick I knew in my coding handbooks.

So I’m stuck making a decision here: continue with Java (which I can use professionally) or do something crazy in TADS 3 (which I can use like an experienced hobbyist in one specific library).

I guess I’m posting this as a sort of follow-up. I’m gonna be making the decision myself, but also this might be a valuable experience to archive lol.

On the positive side: I’m not coding this Java-based engine or looking into deep-TADS because I’m chomping at the bit to write fiction. I have story ideas I would like to do, but I’ll get excited for those again once this mechanics problem is solved. Right now, I’m chomping at the bit for an interactive fiction system I can reliably use for the kinds of stories I seem to prefer writing. It’s hard to get excited about stories when all of your attempts to make them hit mechanical roadblocks in a lot of the current IF platforms out there.

Hope you all have a great day!

3 Likes

Take a look at Dialog. It is a relatively new system, open source and still in active development. The parser / library are well documented and appear to be well suited for developer modification.

2 Likes

It’s true that adv3Lite, in common with adv3, Inform, and some other systems, presupposes a particular world model, one in which rooms are basically self-contained, a turn counter advances, and so on. Trying to modify that may not be easy!

Have you looked at the adv3Lite Doer class? It may be able to handle your need for grouping of actions.

Another option is of course Twine. You can code anything in Twine using Javascript, and Twine has no world model at all. As a bonus, you get the ability to create a really pretty user interface. The downside is that in Twine you can’t hide opportunities/commands from your users. If a command isn’t visible as a clickable link, it doesn’t exist at all.

2 Likes

Also Alan has no world model, and has a rather easy model-building (I’m actually experimenting/fooling around about the idea of a mix between Cosmoserve and Portal (the 1987 vintage activision game, not the more recent action game !) the general narrative idea being the PC doing forensic investigation on old CP/M or early mess-dos diskette) so can be a valid alternative, but in general I find easier modifying or finding a way around standard libraries’s world model definition (and the modify/replace mechanism another major forte of TADS 2 and 3)

my 0.02 €, of course…

Best regards from Italy,
dott. Piergiorgio.

1 Like