• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Network Games for Apple II?

Dog Cow

Well-known member
I'm curious to know if there are any network games for the 8-bit Apple II? Such as where you'd connect two Apples together with a serial cable (or, heaven forbid, cassette ports) to play a 2-player game over the wire.

I did some searching around, and can't seem to find any evidence of such games having been written, so I'd like to try it for myself. The best I have in terms of hardware at the moment are 2 IIgs's, so I'd be using the emulated Super Serial Card functionality.

Here's my newbie plan, without having tried any of it, for a "game" where two dots appear on screen, one being moved by the user via his joystick, and the other being sent over the wire by player 2's movement:

Load the game on to both Apples, and make sure they are connected by cable. Both Apples will assign themselves an ID number, which should be random, or we could have the user decide who is master and who is slave. The main event loop would then go something like this:

- listen to serial port, and see if any data is being sent. In this case, it would be new coordinates for the dot. The sending Apple would send the new X,Y coordinates and a random value.

- The receiving Apple, if it got the data, would update the screen with these new coordinates, and send the random value back to confirm it has received it OK.

- Local Apple allows the user sitting there to move his joystick. It then sends these new coordinates back over to the other Apple, and the cycle continues.

All of this should happen very quickly, so it's a constant cycle of send, receive, and allow the user to move his dot. If anyone more experienced than I sees a problem with this plan, or has some ideas, I'd be glad to hear.

I expect that a slow, rough demo of this could be done in Applesoft, so I'll be working in that language for the mean time.

 

luddite

Host of RetroChallenge
Michael Mahon did a pong demo over NadaNet recently... just start googling ;-)

But I have heard of something similar being done in the '80s, though I'm not sure what interface was used... something tells me it was the cassette port. I don't see any real problems with what you're proposing. The only thing I would suggest is that if you made it a text-based game rather than graphical it would be easier to port to other 8-bit platforms... 24x80 is probably a decent enough area to bounce a * around in.

 

Dog Cow

Well-known member
Yeah, I remembered NadaNet a few hours after I typed the original post. Since then, I got out my 2 IIgs's and my trusty Super Serial Card Installation and Operating Manual, and set to work.

I set the two GS's together, and put an Apple StyleWriter cable going from both modem ports. At first, I was just using the SSC terminal mode on one GS, and essentially "mirroring" everything I was typing on the other GS, from using IN#2 and PR#2 on the appropriate machines. Pretty neat.

The next step was to write an AppleSoft program on the one GS which output endless random numbers to the modem port. This also echoed on screen.

The second GS had a similar AppleSoft program, except it was accepting input from the modem port, then using INPUT A: PRINT A. So I was getting everything output by the first GS into an AppleSoft variable.

Good so far, but I think some assembly language will have to come in to play. Also, I need to make sure this is not a free-for-all. That is, I need to make sure these GS's take turns and are not both trying to send or receive at the same time.

Tricky, but I've gotten past the first stage so far! :)

 

luddite

Host of RetroChallenge
Cool! I imagine the taking turns issue would depend largely on what sort of game you're planning. Any kind of real time action game is going to be problematic because you're almost guaranteed to have both players bashing keys at the same time. Something along the lines of chess or battleship would be much easier to implement and not be so dependent on speed... still, I guess that wouldn't be as much fun.

 

Dog Cow

Well-known member
As a crazy idea yesterday, I also wondered about the feasibility of hooking another wire to the printer port of both GS's. Since the modem port wire is definitely going to have to be half-duplex, if I have two physical wires, I could theoretically have the GS's send/receive twice the amount of data.

However, realistically, this is not so good to design a program this way, because while the IIGS can emulate to Super Serial Cards without a problem, users of a //e or II+ would need to have two physical SSC's.

I'm going to start making more of a stab at a simple "game" now that I know the most basic theory works. Going to use GR so I get a few lines of text at the bottom to see what's going on. I'll probably just make it a free-for-all for now, then I can work on timing/negotiating issues in version 2. :)

Actually, I only need to send a one or zero for incrementing the dot on the other Apple's screen, so if I use X,Y, I could send a 01 indicating the dot moves up one square in the same X value. A 10 would indicate moving to the right, and maintaining the Y coordinate.

This is going to be fun.

 

Nathan

Well-known member
I see this is about a year old, anything new on this front? Sounds like you need software flow control written into it.

 

Dog Cow

Well-known member
It's taking a pause. Keeping real-time games in sync on modern hardware with full networking protocols is hard enough.

The whole game needs to be rewritten in assembly language and wait on interrupts from the Super Serial Card as each new byte comes in from the other Apple.

That being said, it's rather low-priority at the moment.

 

Nathan

Well-known member
Okay, that's not much of a surprise. It should be somewhat less difficult than modern games because you're screen is very low resolution and has limited color. So that's a lot less data to send. IF you design in features for earlier Apple II machines, maybe you could write a protocol to get interrupts from the cassette port on Apple II and use the serial card exclusively to send data. Granted that the cassette port is only 108bps and there might be issues doing sudo simultaneous reads from different hardware, but it should be plenty fast for an interrupt. It would only support 2 computers though. Perhaps a NadaNet (http://home.comcast.net/~mjmahon/) connection might serve you well for an interrupt or additional game data? Granted you'd have to find a way for it to co-exist with a joystick, but it seems reasonably viable.

P.S.

Do you have a game written right now? Is it like the one you were describing?

 

Nathan

Well-known member
I was proposing something along the lines of a software interrupt based on the input on the cassette line. I don't know much about the computer or whether it can handle that quickly enough, it's just an idea.

 

Dog Cow

Well-known member
The Apple IIe doesn't have software interrupts, unfortunately, and that's my target platform. The newer models, the IIc and IIgs, do have software interrupts.

I'd want to get an interrupt every time that there's network activity.

 

Nathan

Well-known member
Is there a reason you can't write a program that will check the cassette port and signal the SSC? Maybe the program could send data to cassette line that were indicative of the network activity. Your trying to prevent collisions during serial communications, right?

 

Nathan

Well-known member
I don't know if you noticed my post earlier, but I recently purchased an apple IIe so hopefully in a little more than a week (I wish it were less) that should reach me. Really looking forward to it, I'll have to try out your single player snake game. :)

 

Dog Cow

Well-known member
Your trying to prevent collisions during serial communications, right?
Right. I don't want both Apples to be trying to "talk" at the same time, or conversely, trying to listen for incoming communication simultaneously, thus creating a deadlock.
 

Nathan

Well-known member
If you use a software/hardware clock, you could keep track of time. Using that you could handle the following scenario:

T=Time, C=Computer (1/2), A=Action Taken

R=Receive new coordinates,S=Send new coordinates,WA=Wait defined number of seconds

T C A

0 1 S(0,1) -- at time 0, computer 1, send coordinate change to 0,1

0 2 S(0,1) -- at time 0, computer 2, send coordinate change to 0,1

ERROR: Collision in sending data

1 1 WA(5 + random number) -- at time 1,computer 1, wait 5 + random number of seconds then send (ex. random=1 seconds=6)

1 2 WA(5 + random number) -- at time 1,computer 2,wait 5 + random number of seconds then send (ex. random=2 seconds=7)

2 1 S(0,1) -- at time 2,computer 1, send coordinate change to 0,1

2 2 R(0,1) -- at time 2,computer 2, still waiting for 1 second to pass recieves change to 0,1 by computer1

This idea could repeat endlessly if necessary, it's messy, but it would take some of the collisions away. It would mean the program would have a standard wait time between send and recieve to start with and then maybe after the first time it would keep using those different wait times unless it encountered another collision. It would need a way to detect a collision though. If you could make whatever circuit necessary to allow two paddles/joysticks you could use the second paddle/joystick in as a way for each side to indicate a collision to the other. So, if the sender didn't recieve an acknowledge message it would toggle the other would then toggle it back to indicate that it understood there had been a collision. You might also be able to use the cassette port for that.

 

Nathan

Well-known member
This is kind of unrelated to the network part, but I can't get your single-player snake game to run. Anything I should know that I might not about getting it to work? I don't have any paddle controllers, is it possible that that is the problem?

 

ChristTrekker

Well-known member
How common was networking in the Apple II days? I remember our school lab had about 10 Apples sharing a printer, but other than that I didn't even know the term "networking" back then.

 

glf

Well-known member
I think it was relatively common in most school environs with at least a certain amount of cash to have an apple II network. The school district here had Corvus stuff. Google "Corvus Omninet" Ah.. Backup to VCR tape.. :)

 

Dog Cow

Well-known member
I usually use a joystick. It doesn't use arrow keys, though.

Networing on the II is rare. Lack of support both in terms of hardware and softwAre made it so. The Mac was unique in that it had built-in network support.

 
Top