Creating RIA Interpreter for TADS 3

When I started working on a TADS3 VM, I initially thought “yeah cool, a Smalltalk-like VM for IF”.

Having put quite a bit of work into the implementation, I have learned to appreciate what the Z-Machine and Glulx offer to a VM implementor: awesome, comprehensive technical documentation, simple elegant designs and reference implementations that are easy to understand. You are actually able to write a VM by reading the specifications alone, that’s how good the specifications are.

The T3 documentation is huge - yet I would say it is impossible to write a VM by reading the specification alone, you do need to look at the reference implementation, which is not nearly as easy to understand as e.g. Glulxe. There are also some aspects of TADS3 which make it hard to simply reuse what your implementation language already offers, e.g. containers and regular expressions.

TADS3 has a lot of stuff built-in so it has potentially less runtime overhead than Inform where a lot is implemented in Inform itself. Yet, by making it easier for VM implementors, you can actually see more people successfully implementing a Glulx VM or Z-Machine. People who work on IF VMs in their spare time (which in my wild guess is the majority) can only spend so much time on it. So while ZMPP implements quite a bit of T3, there’s still quite a bit of way to go.

As for Java vs .NET, it’s like we germans say “the choice between plague and cholera”. Pick your favorite Evil Empire™, there are plenty to choose from these days. The folks who use pure Javascript are probably the luckiest in this respect.

ZMPP currently does use Swing as a frontend technology, but one of the reasons I have picked Scala was Lift, which has good Ajax and Comet integration. So this is ZMPP’s RIA strategy.

This is good news indeed. I had more or less lost hope as the months slid by.

The thing I still don’t understand is, who will be hosting the server? Will it be part of Mike’s web setup? The reason I’m asking is because I’m just a poor dumb game author. I have a website, but I lack the technical background I would need to even ask my site host the right questions about setting up a virtual T3 server within my site.

I have a vague recollection that there was also some question about whether existing games will run on the new machine, or whether they will need to be recompiled, or what. Am I totally off-base about this?

Games will need to be rebuilt. As for which people will be hosting servers, I’ve no idea :stuck_out_tongue:

Usually they say “you lose some, you gain some”, but in this case it’s more like “you lose a hell of a lot, you gain a hell of a lot”. Meaning that network services at the language level is something totally awesome, but not being able to simply post a game somewhere and have it run on the browser in Javascript is totally not-awesome.

It’s a standard-issue Mike Roberts solution, in other words. :stuck_out_tongue:

Seriously, I have enormous respect for Mike’s prowess as a code designer, and I’m sure once this solution is available, it will be amazingly slick. But as with T3 itself, there will be barriers to entry that new authors may find a bit daunting.

If he provides a virtual server himself, that will help a lot. I’m just hoping I can still find the source code for Lydia’s Heart so I can recompile it…

My sense is that Mike plans to host a server, perhaps even the server, but he’s understandably reluctant to make a stronger commitment in the absence of actual metrics for VM performance, game quantity, and player count.

I don’t think you need to worry. If you don’t care about the plumbing, you’ll be able to upload a game file somewhere, publish a hyperlink, and have it all work. If you want to host a server, someone will help you figure out your options once the software is released.

Good news. The system is pretty much feature-complete. Ironing out the last rough edges should hopefully not take that long. Mike Roberts also provided the modifications to make frobtads able to serve games through HTTP, so I was able to give this a go on my Linux box.

The result is quite nice. The system is able to support multimedia TADS through the web :smiley: As far as I know, the below are the first screenshots to demonstrate TADS on the web:

foss.math.aegean.gr/~realnc/pics/tadsweb1.png
foss.math.aegean.gr/~realnc/pics/tadsweb2.png

Speed feels very nice, since the game itself runs on the server, not on the player’s machine.

Although it’s possible to try out this stuff yourself (by building frobtads yourself from its Git repository), it’s a bit of manual work as there’s zero documentation for this right now (MJR is writing it, along with the needed PHP code so that people will be able to host their own game servers.)

This is quite exciting :mrgreen:

This rocks. (I’ve totally given up on I7, but this is not the place for a rant.) If I ever write another game, it will be in T3. Thanks for keeping us updated, and thanks to MJR for the hard work!

Totally awesome. :smiley:

Can you offer some modest guidance on getting this up and running? :slight_smile:

I’ve rebuilt the sample game with the new t3make and tried this command line:

The resulting process shows the first screen in the game and then exits immediately.

(It prints a warning about tadsweb.config but as far as I can tell from the source code, this is only used to connect to the optional storage server.)

Does it have to be started by Apache in order to stay running?

EDIT: it looks like all the web functionality is contained in new library modules like webui.t and browser.t, which weren’t included in the sample build. So I guess I have to include those somehow.

Yes indeed! I’m still going to wait for the newer, smaller library* before giving T3 a serious look, but it’s great to see so many decisive moves out of the Windows ghetto over the past year!

–Erik

  • and, realistically, a nice Mac-native IDE solution as well…

Oops, there are some needed files missing (adv3web). I’ve got the ready-made t3 file of Return to Ditch Day for testing purposes and ran it, and didn’t notice that you actually can’t build web-enabled games yet :stuck_out_tongue: I’ll be waiting for the next update from MJR, as I don’t have those files.

Nope, it can be launched stand-alone. For example, Gargoyle would run the VM like that, and then launch a browser window on localhost. Voila, there’s your HTML TADS 'terp :mrgreen:, at least for games build with WebUI.

Btw, I’d recommend poking MJR about getting the updated porting kit sources, because the TADS 3.1 compiler breaks backwards compatibility, meaning games won’t run in existing terps (WebUI or not doesn’t matter). That way you’ll have a chance in updating Gargoyle by the time 3.1 is officially released.

OK, if you pull from Git again, t3make should now work correctly.

To build a WebUI game, add the following to its Makefile.t3m:

-D TADS_INCLUDE_NET -lib adv3/adv3web -lib webui -source tadsnet
(Use only “adv3web”, not “adv3”.)

To run it, use “frob -i plain -N 44 sample.t3”. You don’t need to specify the hostname, unless it doesn’t detect it on its own. It will then print an address on stdout. Simply open that in a browser.

There’s a catch in this. If you have a game that uses the banner API (other than just using the default statusline), those parts need to be rewritten to use the new web API. Direct I/O calls will also need to be rewritten in games that use them, but that should be easy since Adv3 now provides equivalents functions.

Great, thanks! Now I have a new toy to occupy me this weekend.

I’ve rebuilt a small game and it worked just fine. I have another one that uses banners so I need to dig deeper to find the web API equivalent.

Network performance is decent. I spun up an Amazon EC2 micro instance which handles a single session with no apparent difficulty. It’ll be interesting to see how many sessions it can handle once the PHP scripts are ready.

When I tried it, it didn’t detect my wehost, I had to specify it and then it finally worked. Took me a while before I figured this :slight_smile: But now everything is running smoothly and I don’t have any problems.

Does the version in git allow any form of multiplayer facilities for TADS3?
Or is it more to allow multiple players each in their own independent instance of a game?

TIA,

Phil.

The latter; it’s not multiplayer in the usual sense.

I believe it would be possible to put together a library that used the VM server functions to host a multiplayer-aware game. Doing that with adv3 would take a lot of effort.

I’m not sure what the plans are for the minimalist TADS 3 library, code-named “quicksilver”. If it ever sees a release, I plan to tackle a multiplayer version.

The language gives you server and client sockets, so you can implement multiplayer servers. The game world would then be hosted by the game running as a server, while players connect as clients.

You could write the clients in some other language if you wish, doesn’t have to be in TADS.

Edit: Of course doing this requires programming; adv3 doesn’t come with out-of-the-box support for it :mrgreen:

Apart from multiple players each in their own independent instance of a game current prerelease is also capable of hosting one game for cooperative playing by multiple players together. Although there is no interface for it yet, you can make a request to “/webui/guestConnect” and receive an url for guest to join. (Of course, this is not a real “multiplayer”.)

Sorry if I’m being obtuse or not looking in the right place, but what Git repo are you all pulling from?