Online multiplayer... in theory


SP4CEBAR 2021-10-26 06:44 (Edited)

If I were to share an NX program via icloud drive or Dropbox and onother player would turn the link to that file into a shortcut to put inside NX the file could open
If something like that would work then two (or more) people could access the same NX program at the same time
This way you could try to use persistent RAM and the disk to share information
(The disk would have to be shared as well, or the disk could be the only shared file)

SP4CEBAR 2021-10-26 06:45

Either way, I got to make an exam now...

SP4CEBAR 2021-10-26 09:06 (Edited)

I returned from making the exam

Anyway, here's a test program for a shared persistent RAM

SP4CEBAR 2021-10-26 09:08 (Edited)

According to my testing, persistent RAM won't be shared across devices
Edit: or it may be slow
2nd Edit: nah it doesn't: both have their own persistent version, and the NX file only stores the program text

SP4CEBAR 2021-10-26 09:09

Next let's text the disk

SP4CEBAR 2021-10-26 09:18

The disk is being shared, but when both devices were running the program, they didn't sync the disk
When I quit and restarted the program on one device an error popped up saying that the disk currently isn't editable

SP4CEBAR 2021-10-26 09:22 (Edited)

So I think online multiplayer on mobile may be tricky...
But on a PC you can have the program folder open while the program is running, so it may work there
To test if it works I could try to modify the disk file while the program is running

If that works I we could test disk-based online multiplayer on PC with a program stored on a shared folder in dropbox, google drive, or icloud drive

SP4CEBAR 2021-10-26 09:25 (Edited)

Oof, my "uneditable" disk makes both mobile devices crash when I attempt to open it, meaning that I corrupted the disk file

SP4CEBAR 2021-10-26 09:29

So this may only work for turn-based games

SP4CEBAR 2021-10-26 09:31


SP4CEBAR 2021-10-26 09:33

So as long as you wait for icloud drive to refresh the changes it'll refresh the disk and NX will receive the updated result (I had NX open on one side of the screen and icloud drive on the other side to see the disk file, and by having icloud drive open I also triggered it to refresh)

SP4CEBAR 2021-10-26 09:35 (Edited)

Conclusion: we can have shared disks on mobile (and most likely on PC as well), but we may need some external programs to sort out conflicts that may occur and to prevent the file from corrupting

SP4CEBAR 2021-10-26 09:41

The problem is that it takes something like 22 seconds for icloud drive to refresh
And it doesn't seem to do it if I don't have the file open
So we may need to find a file hosting service that syncs files with less latency
Maybe we could also use one of the devices that play the game to host the file

SP4CEBAR 2021-10-26 09:53

Either way here's the disk share test program

was8bit 2021-10-26 11:39

The simplest form of a two player game is much like how, back in the day before electronics, is how two penpals played a game of chess via "snail-mail" (one player writes their coded move in paper, puts it in envelope, puts a stamp on the envelope, and mails it to their penpal)

Traditionally, one game of snail-mail chess may take these two penpal friends literally YEARS to finish one game! ;)

But the concept is simple.. one player sends to the other player an "encrypted" code which contains their move... then that player returns their move back... repeat until the game is concluded...

.. even if your mutiplayer experiment works, it would probably work best with a turn based style game so conflicts of timing are resolved... especially since it is rather rare for any two people here are actually "here" at the exact same time... so games here might still require players inputing one turn per day at best....

was8bit 2021-10-26 11:40

BTW, fantastic testing ! :D

SP4CEBAR 2021-10-26 12:01 (Edited)

Real time games could be possible, to prevent conflicts from happening in the first place we could develop a protocol to tell the program when the other device is going to send it's data, the two devices could modify the data in turns: after the file has been modified it'll wait for the other device to change the file (it could have a bit that tells which device has modified the data last)

Another way is to use an external program to resolve conflicts

Timo 2021-10-26 19:55

P.RAM: As you noticed, it's not saved in iCloud, every device has its own storage.

Disks: They don't access the "Disk.nx" file "in realtime". A program loads it once when it's accessed the first time and then it saves it when requested by the program. If something else modifies "Disk.nx" meanwhile, it will result in conflicts or changes get lost.

I guess sharing some kind of codes for turn based games is probably the only solution at the moment.

SP4CEBAR 2021-10-27 09:38 (Edited)

@Timo, thanks for the reply!
My test programs load a byte from the disk each loop
According to my testing there seems to be not that much latency between iCloud receiving a new version of the Disk.nx file and NX applying the change in the program
The main limiting factor is the update speed of icloud
Also, could loading the file while icloud is updating it cause problems?

SP4CEBAR 2021-10-27 09:41 (Edited)

I just made a program that has a protocol where each device waits for an update from the other device before updating (each device has an ID)
The program shows the local data and ID and the cloud data and the ID of the last device that loaded data to the cloud
Note: updating may take 30 seconds
If it looks like it's stuck then you could press the force re-send button (I could add timeout in a future version)
The program may need some more work though

SP4CEBAR 2021-10-27 09:49 (Edited)

iCloud doesn't update fast enough for real time multiplayer. To make realtime multiplayer possible, we'd need to use another server (edit: I don't mean in general I mean just for online multiplayer). So what server could we use? Could we use a game hosting service like server.pro, or aternos.org or should we use local filehosting programs like hfs or maybe usb network gate (with a USB stick)?

If we were to use a game hosting service, could we access and write the hosted disk.nx file or should we all connect trough FTP, and if we would, would that still be as fast?

Edit: To connect to those servers a shortcut could be used with the name "Disk.nx" that redirects to a cloud location

was8bit 2021-10-27 11:35 (Edited)

... also take into consideration different devices and levels of operating systems... my older ipad mini, which can NOT upload files to this board (they must be brought up to the board from the board...) can take DAYS for icloud to catch up to it....

My experience of simplier is better, at least at the start, seems to apply here...

i would figure out how to set up a turn based game of STRATEGO... easier than chess yet still turn based... whoever captures the enemy flag first wins...

Then have some of us test it out... rembering that we are not all awake and/or here at the same time...


was8bit 2021-10-27 11:40

Or to keep things VERY simple, a simple game of standard checkers...

SP4CEBAR 2021-10-27 13:29

Yeah, that would work too
We could also make a chat program in NX, I think that would be interesting

SP4CEBAR 2021-10-27 13:45

I have an old iPad mini too! I've used it to test these online multiplayer test programs, but mine seems to sync fine with iCloud

was8bit 2021-10-27 15:10 (Edited)

Prolly because my mini is still using IOS10.3.3. ... i could upgrade it, but there are at least 3 old games that are my absoluote favorites, and they are no longer available on the apple store, and they wont be playable if i get the upgrade.... each time i play them, apple reminds me that "this program needs upgraded, as it wont be playable on the next system upgrade" ... so my mini is forever stuck on its IOS level ;)

was8bit 2021-10-27 15:16

I almost always use my regular ipad, which is using IOS 11.4.1 (i havent upgraded it as i tend to think apple upgrades will secretly slow my pad and mess its battery ;) )

On the rare event i want to continue working on something with my mini, if it was just worked on that day with my main pad, my mini will NOT show the current version (or not show it at all if it was a new game i just started) ... it takes at least a few days for my mini to decide to catch up...

SP4CEBAR 2021-10-27 18:38

Why couldn't apple make its api backwards compatible like windows
Programs from windows 95 still run fine on windows 10

I usually also avoided updating IOS as much as possible because the newer versions would take more and more resources to run, greatly reducing the performance of the device
But now with iPad OS I like the new features (which are just basic PC features that have been around for decades...) and my device doesn't seem to slow down as much as devices used to, so my main iPad is running iPad OS 14.4

was8bit 2021-10-27 23:50

Not sure why... maybe it’s a security thing....

Timo 2021-10-28 12:25

Yes, Apple removes old things from the operating system when they are old and have security issues. And sometimes also when there are newer and better alternatives. Removing old stuff can make things faster, more secure or improve memory usage.

But of course it can break old apps... Apple expects developers to maintain their software.

was8bit 2021-10-28 12:52

1 of my games is M.U.L.E. ...I love that game SOOO much.. i still own the nintendo cartridge, as well as i bought a very expensive board game version while i could..

My apple version includes 4 remixes of the theme song, written by different fans... it is now something i treasure... i am glad i got it when i could :)


CubicleHead 2021-10-28 14:43

I use an iPad mini with iOS 9.3.5 and iCloud seems to work fine on it
I actually didn't know there was a higher iOS until iOS 13

CubicleHead 2021-10-28 14:43

Online multiplayer sounds very cool btw

was8bit 2021-10-28 15:38

Maybe my ios version has icloud issues...

Timo 2021-10-29 09:25

I sometimes thought about online multiplayer already. There were different ideas:

1. The best for real time games I think would be to use normal GAMEPAD 2 games, but connect two players online. All old multiplayer games would automatically work. Technically both LowRes NX instances would have to wait for each other, so both can execute the same commands with the same user input at the same time.

2. Adding a simulated serial port. This would be in the end similar to 1, but much more work for the programmer. Also it's really hard to handle internet lag/delay. Super complicated for realtime games.

3. Now I'm thinking about turn-based games: Yes, there could be a system to share a disk.nx file or the persitent RAM between players. The forum could send notifications when it's your turn.

In any case, it would be a lot of work and I don't have time for it, sorry :/ But we can still share some ideas ;)

I also think realtime multiplayer wouldn't be used a lot, because usually we are not online at the same time. Turn based could be cool. You could invite someone to play on this website, play one turn, the data will be stored online, the other player would get a notification, plays their turn, and so on. Probably I would use the persitent RAM data for this. And the user ID needs to be injected into LowRes NX, so the program knows who is playing.
I like this. And I really have more important things to do. Argh.

was8bit 2021-10-29 10:51 (Edited)

@sp4cbar, if you are willing, i can set up a Fox-n-Hounds game played by posting move codes to each other.. this game is super easy to play, and a winner is declared rather quickly, say maybe 20 moves each.... even at that then, if each player takes 1 day per move, total time to complete one game will be 40 days...

SP4CEBAR 2021-10-30 14:34 (Edited)

That's an interesting idea, maybe we could make more complicated turn based games by (manually) sharing the disk file on this forum each turn

was8bit 2021-10-30 16:41

The total length of the game will most likely be ruled by the same constraints... a min. of 1 day per one person's turn... or 15 game turns per month... a more complicated game may take a year to finish...

SP4CEBAR 2021-10-31 23:29


was8bit 2021-11-01 02:18

In mailed turns for a chess game, these can take YEARS to complete one game.... generally done between separated friends who used to play Chess together in real life but moved apart.... so they continue playing chess via mail...

I am thinking of a game that may be as simple as checkers but with a fantasy warrior twist ;)

I will have to make a single player version against a computer to test its playability...

SP4CEBAR 2021-11-01 07:18

Good luck

was8bit 2021-11-01 08:19

Thnaks :) ... I am working on a hexboard system, as my game idea requires one...

G-9 2021-11-07 15:52

hello :)
ill send my thoughts.
actually, online multiplayer exists ! not really using the original LowRes Console though... Timo and Greenpilloz made a retroarch port of lowres nx ...
retroarch does have netplay if i rember !

Timo 2021-11-07 21:01

Retroarch netplay is not supported in LowRes NX :/ It's not an out-of-the-box feature, the port has to support it. And it's not so easy with LowRes NX.

G-9 2021-11-16 15:25

ow, i didnt knew it wasn't an out-of-the-box feature :(

Log in to reply.