Play multiplayer Mazewars+ via in-browser emulation

Anything about Mac emulation that does not belong in the above categories.

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
marciot42
Inquisitive Elf
Posts: 39
Joined: Wed Feb 26, 2014 2:21 pm

Play multiplayer Mazewars+ via in-browser emulation

Post by marciot42 »

Hello everyone,

I would like to share a project I've recently finished that allows you to play multi-player Mac games in your web browser on an emulated Macintosh. Currently I have "MazeWars+" available for play:

http://retroweb.maclab.org/articles/Online-Games.html

This project involved figuring out how to capture the serial data coming out of the JavaScript emulator (this was easy), writing a Hayes smartmodem emulator and then making a WebRTC communications back-end using peerjs.

My next step is to get something similar done for LocalTalk so we can have online LAN parties with Bolo :)

-- Marcio
User avatar
adespoton
Forum All-Star
Posts: 4279
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by adespoton »

Back in the 90's, we had a patch for Bolo that let it play over TCP/IP instead of/as well as LocalTalk.

I'd love to fire up some of my old brains and see how they fare against you guys :D
marciot42
Inquisitive Elf
Posts: 39
Joined: Wed Feb 26, 2014 2:21 pm

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by marciot42 »

adespoton wrote:Back in the 90's, we had a patch for Bolo that let it play over TCP/IP instead of/as well as LocalTalk.
I should be completing a LocalTalk over WebRTC implementation fairly soon. I've reached out to Michael Fort's who did the LocalTalk encapsulation for vMac and with his code as a starting point I expect to get this done much sooner that otherwise.

That said, my understanding was that Bolo used token passing for communications and that this may not work well on a wide-area network due to packet latency.

-- Marcio
User avatar
adespoton
Forum All-Star
Posts: 4279
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by adespoton »

Yes, Bolo uses token passing. The way the patch worked back then is that each remote node would be its own localtalk network, and the nodes would talk together as quickly as possible. The local game host was the only TCP/IP enabled system in the game, and it talked to the remote hosts.

However, back then it was REALLY slow when you got a TCP/IP-linked client on the game... everything started stuttering for everyone. These days it should be much better, as long as the latency is kept to a minimum.
CharlesS
Granny Smith
Posts: 107
Joined: Thu Aug 14, 2008 9:05 am

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by CharlesS »

Are you sure you're not thinking of Marathon or something? Bolo supported UDP/IP natively, at least in the 0.99.x versions that I had, and I'm pretty sure I didn't need a patch to play over the Internet. The trouble was that most of us at the time were stuck using dial-up modems to connect to the network, and it wasn't great over a modem connection, although it was sometimes still playable. I remember that before the author gave in and eventually added modem support to the game, the documentation in the older versions had a bunch of stuff in it about how he didn't support modems because they were a gross hack, followed by a lot of bragging about how good his Ethernet connection at Stanford was. :D There was also a section in there complaining about modems' tendency to prioritize bandwidth at the expense of latency which was my young self's introduction to that particular dichotomy.
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
User avatar
adespoton
Forum All-Star
Posts: 4279
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by adespoton »

Thanks for the refresher; I was thinking about the changes between 0.98 and 0.99 -- sometime around 1994. But you're right -- the UDP was baked in from the start. The changes were to make the UDP function better on multiple subnets with latency. 0.98 just froze up until all the data was synced, which was fixed in one of the 0.99 builds. He refused to add modem support for quite some time after that -- I think I had stopped playing it at LAN parties by that point.
marciot42
Inquisitive Elf
Posts: 39
Joined: Wed Feb 26, 2014 2:21 pm

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by marciot42 »

adespoton wrote:Thanks for the refresher; I was thinking about the changes between 0.98 and 0.99 -- sometime around 1994. But you're right -- the UDP was baked in from the start. The changes were to make the UDP function better on multiple subnets with latency. 0.98 just froze up until all the data was synced, which was fixed in one of the 0.99 builds. He refused to add modem support for quite some time after that -- I think I had stopped playing it at LAN parties by that point.
I presume that on something as early as a Mac Plus, you wouldn't be able to use UDP, unless you were running something to encapsulate the packets through the serial link, maybe MacPPP?

Anyhow, if you guys know of any other early modem or AppleTalk games that I could add to my museum, let me know. I got dual-player BattleChess to run (from an emulated Mac Plus to an emulated Amiga, in fact), but since BattleChess is still being sold by Interplay I don't want to post a playable demo online.
CharlesS
Granny Smith
Posts: 107
Joined: Thu Aug 14, 2008 9:05 am

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by CharlesS »

Maze Wars+ would have been the big one. I'd actually been planning to port that to OS X for years—grabbed all the sound and graphic resources, but never actually coded it up. Kudos to you for actually doing it.

Other than Bolo, hmm. Is Spectre out of scope? Strategic Conquest maybe?
There's no earthly way of knowing, which direction we are going, for the rowers keep on rowing, and they're certainly not showing any signs that they are slowing.
marciot42
Inquisitive Elf
Posts: 39
Joined: Wed Feb 26, 2014 2:21 pm

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by marciot42 »

CharlesS wrote:Maze Wars+ would have been the big one. I'd actually been planning to port that to OS X for years—grabbed all the sound and graphic resources, but never actually coded it up. Kudos to you for actually doing it.

Other than Bolo, hmm. Is Spectre out of scope? Strategic Conquest maybe?
Just to clarify, I did not port MazeWars, it's actually the original running on an emulated Macintosh. I didn't write the emulator either. I just cross-compiled one to JavaScript and then wrote all the stuff that makes it useable: the website user interface, the documentation browser, the disk management for the emulator and the back-end communications code for the online games.

Peninsula Gameworks still sells Spectre (it's called Spectre3D), but they had a demo version that I might be able to put online. It appears to support AppleTalk play. Not sure exactly what makes it a demo, however. It must have some limitations otherwise they would not call it a demo.
User avatar
adespoton
Forum All-Star
Posts: 4279
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by adespoton »

I wasted hours on Strategic Conquest; there were a number of knockoffs of it if that one can't be done for one reason or another.

Another one that would be fun (but not have the challenge of Bolo with its Brains) is NetTrek. That one may also have licensing issues since the Star Trek universe is still very much a thing.

I also stumbled across NetRisk! in the 90's, although never took it to a LAN party.
User avatar
adespoton
Forum All-Star
Posts: 4279
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by adespoton »

marciot42 wrote:I presume that on something as early as a Mac Plus, you wouldn't be able to use UDP, unless you were running something to encapsulate the packets through the serial link, maybe MacPPP?
Yes, we were using an early version of MacPPP; but the local LAN of Mac Pluses was networked to an SE/30, and that's the one that connected to labs at other universities for intermural fun :)
marciot42
Inquisitive Elf
Posts: 39
Joined: Wed Feb 26, 2014 2:21 pm

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by marciot42 »

Okay! I finally got LocalTalk emulation working:

http://retroweb.maclab.org/articles/Online-Games.html

I'd be interested in finding someone to play Pararena with me, so I can see how laggy it is over TCP/IP.
User avatar
adespoton
Forum All-Star
Posts: 4279
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by adespoton »

Hmm... I got this error:
TypeError: Uint8Array.from is not a function. (In 'Uint8Array.from([ dstNodeId, srcNodeId, type ])', 'Uint8Array.from' is undefined)
marciot42
Inquisitive Elf
Posts: 39
Joined: Wed Feb 26, 2014 2:21 pm

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by marciot42 »

adespoton wrote:Hmm... I got this error:
TypeError: Uint8Array.from is not a function. (In 'Uint8Array.from([ dstNodeId, srcNodeId, type ])', 'Uint8Array.from' is undefined)
That's very odd. What browser are you using? I suggest using the latest version of Chrome, since it is the best about keeping up with latest web standards, plus it's the browser I do all my testing on.
User avatar
adespoton
Forum All-Star
Posts: 4279
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by adespoton »

Interesting; I was going to try in Chrome, but went for the latest Safari instead, as I figured it would be more likely to be stable :)

I also noticed that the sound samples in Pararena were off; the announcer's voice is not just choppy, but playing too fast/high pitched. But that's not really your issue :)
marciot42
Inquisitive Elf
Posts: 39
Joined: Wed Feb 26, 2014 2:21 pm

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by marciot42 »

adespoton wrote:Interesting; I was going to try in Chrome, but went for the latest Safari instead, as I figured it would be more likely to be stable :)
Actually, Safari is a no go until Apple fully embraces WebRTC. Sadly Apple isn't fully committed to open web app standards as they fear it might take business away from the App Store, so Safari is probably the least well supported right now. I probably need to add a warning that Chrome is the preferred browser and the one most likely to work.

Anyhow, in other news, I added a Google calendar widget to the page this morning -- first ever Internet MazeWars+ tournament this Saturday! :mrgreen:

-- Marcio
User avatar
adespoton
Forum All-Star
Posts: 4279
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Play multiplayer Mazewars+ via in-browser emulation

Post by adespoton »

Got it. Chrome it is.

Meanwhile, here's a link for NetRisk!
Post Reply