Simulated netboard - future of linked play in Supermodel?

Discuss Supermodel and your favorite Model 3 games. Show off your latest threads, this is the place to see and be seen.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Re: Simulated netboard - future of linked play in Supermodel

Postby Ian » Fri Mar 12, 2021 5:11 am

I could make the sending / receiving asychronous with some threading magic if that would help. Latency should be very good on LAN with tcp_no_delay which is set. Turns off buffer accumulation and just sends immediately. Sub 1ms.
The original UDP I wrote actually had some async functions. I only wrote them because we had honestly no idea how networking was functioning
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Simulated netboard - future of linked play in Supermodel

Postby gm_matthew » Fri Mar 12, 2021 6:16 am

Ian wrote:With the current code tcp sending will start to block when the socket buffer is full. It needs the receiver to receive the data to unblock. We also used a blocking receive.

How can we improve things? How does it work on the real hw? It sends 64 requests? Does it just check once a frame to see if the data has actually been received?

After initialization, the master netboard waits for IRQ5 before making a send/receive command. It then waits for another IRQ5 before checking the IRQ6 flag to see if it has received any data; if not, it loops back up and makes another send/receive command. Meanwhile, the slave netboard makes a receive command and waits for IRQ6. Once the data is received, it increments a counter. If the counter is less than 0x40 (64 in decimal), it jumps back up and makes another receive command. It also jumps back up without incrementing if the IRQ6 arrives too late after IRQ5 (meaning the netboards are not properly synchronized).

Basically, the master has to make 64 send/receive commands before the slave responds by sending its own data. To get this working properly with the emulated netboard we would have to find a way of listening for data without blocking, and we would also have to take great care to ensure the netboards are synchronized properly. (I managed to hack my way past this by modifying the counter check to 1 instead of 0x40, but I ran into other problems later on.)

I've attached my disassembly of Le Man 24's netboard code if you'd like to take a look.
Attachments
netram.zip
(7.72 KiB) Downloaded 27 times
gm_matthew
 
Posts: 224
Joined: Fri Oct 07, 2011 7:29 am
Location: Bristol, UK

Re: Simulated netboard - future of linked play in Supermodel

Postby MrThunderwing » Fri Mar 12, 2021 6:52 am

gm_matthew wrote:
When I start up both versions of the emulator (via a batch file) they both load up but I get the 'network board not present' error screen. I've tried this with the EmulateNet option in the config set to both on (1) and off (0) but the result is the same either way in both versions of Daytona 2.

That's odd. It should at least acknowledge the presence of the netboard as long as EmulateNet is set to 1 and the netboard tag in the XML file is set to true.

If it helps, I've updated the zip file; it should now have two folders, master and slave. All you have to do is add the Daytona 2 ROM to each one and it should be ready to go.

(Strictly speaking I live 10 miles away from Bristol, but it's part of my postal address so I say it counts. Almost never heard anyone say "gert lush".)


Thanks mate, that got it working for me! Absolutely outstanding work man, been hoping to be able to do some full speed networked Daytona 2 for such a long time. I'm still interested in giving the Le Mans one a try!

One weird little issue I'm having is that your build doesn't seem to want to play nice with my Xbox 360 pad. When I use the normal 'supermodel -config-inputs -input-system=xinput' option all my button presses initially map fine, but when I get to the gas and brake config setup it won't register my R or L triggers when I press them down. I tried calibrating the R and L shoulder buttons using the option to do so from the command line, then went back to configuring the buttons and this time the shoulder triggers registered. I saved my changes and exited the command line window and tried starting the games (using the batch file I'd made to start both simultaneously, which was previously working), but for some reason now the first emulator would hang at startup and the second wouldn't start at all.

After this I overwrote my config folders in the Master and Slave with the info from the ZIP and that got everything working again. So next up I tried manually altering the info in the master ini file and added in the controller mapping info from a previous version of Supermodel that worked fine with my 360 pad and looked like this:
InputAccelerator = JOY1_RZAXIS_POS
InputBrake = JOY1_ZAXIS_POS
But for some reason that seemed to invert the axis on the shoulder triggers, so that when I released the gas it would act like I was pressing it down and vice versa. I tried changing the POS to NEG to seem if that would do it, but no dice, the game went back to acting like neither shoulder trigger worked. Weird. I was eventually able to get controls working using a PS3 pad and DS3 tool and setting up the config inputs using dinput.

I have encountered this weird behaviour with Supermodel not recognising my Xbox shoulder buttons once or twice before when I've swapped between using my racing wheel and Xbox 360 pad in the same version and tried re-configuring, but normally in those instances, if the controls were acting screwy, I'd just start afresh with a new build. Has anyone else had this issue and found a solution to it?
User avatar
MrThunderwing
 
Posts: 702
Joined: Fri Sep 02, 2011 11:31 am
Location: Bristol, UK

Re: Simulated netboard - future of linked play in Supermodel

Postby gm_matthew » Fri Mar 12, 2021 7:10 am

MrThunderwing wrote:Thanks mate, that got it working for me! Absolutely outstanding work man, been hoping to be able to do some full speed networked Daytona 2 for such a long time. I'm still interested in giving the Le Mans one a try!

One weird little issue I'm having is that your build doesn't seem to want to play nice with my Xbox 360 pad. When I use the normal 'supermodel -config-inputs -input-system=xinput' option all my button presses initially map fine, but when I get to the gas and brake config setup it won't register my R or L triggers when I press them down. I tried calibrating the R and L shoulder buttons using the option to do so from the command line, then went back to configuring the buttons and this time the shoulder triggers registered. I saved my changes and exited the command line window and tried starting the games (using the batch file I'd made to start both simultaneously, which was previously working), but for some reason now the first emulator would hang at startup and the second wouldn't start at all.

After this I overwrote my config folders in the Master and Slave with the info from the ZIP and that got everything working again. So next up I tried manually altering the info in the master ini file and added in the controller mapping info from a previous version of Supermodel that worked fine with my 360 pad and looked like this:
InputAccelerator = JOY1_RZAXIS_POS
InputBrake = JOY1_ZAXIS_POS
But for some reason that seemed to invert the axis on the shoulder triggers, so that when I released the gas it would act like I was pressing it down and vice versa. I tried changing the POS to NEG to seem if that would do it, but no dice, the game went back to acting like neither shoulder trigger worked. Weird. I was eventually able to get controls working using a PS3 pad and DS3 tool and setting up the config inputs using dinput.

I have encountered this weird behaviour with Supermodel not recognising my Xbox shoulder buttons once or twice before when I've swapped between using my racing wheel and Xbox 360 pad in the same version and tried re-configuring, but normally in those instances, if the controls were acting screwy, I'd just start afresh with a new build. Has anyone else had this issue and found a solution to it?


Glad to hear it's working!

Try getting rid of all the MinVal, MaxVal, OffVal and DeadZone values in both ini files, and then try calibrating and mapping the controls again. Those are probably leftover values from my wheel.

I've uploaded a build that should enable Le Mans 24 to work here (filebin isn't working at the moment). Just replace the executables in both the master and slave folders with the one in the zip. I'm currently working on getting the simulated netboard to be able to adapt to each game, which should allow the same build to run both games in linked mode and will also make it easier to add new games.
gm_matthew
 
Posts: 224
Joined: Fri Oct 07, 2011 7:29 am
Location: Bristol, UK

Re: Simulated netboard - future of linked play in Supermodel

Postby Ian » Fri Mar 12, 2021 7:30 am

To get this working properly with the emulated netboard we would have to find a way of listening for data without blocking, and we would also have to take great care to ensure the netboards are synchronized properly. (I managed to hack my way past this by modifying the counter check to 1 instead of 0x40, but I ran into other problems later on.)


Yeah that's not too hard. I can just spin up a separate thread for receiving. Then you can sync the data whenever. Or we could just have it write in a separate thread with a critical section or something :)
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Simulated netboard - future of linked play in Supermodel

Postby MrThunderwing » Fri Mar 12, 2021 8:17 am

gm_matthew wrote:Glad to hear it's working!

Try getting rid of all the MinVal, MaxVal, OffVal and DeadZone values in both ini files, and then try calibrating and mapping the controls again. Those are probably leftover values from my wheel.

I've uploaded a build that should enable Le Mans 24 to work here (filebin isn't working at the moment). Just replace the executables in both the master and slave folders with the one in the zip. I'm currently working on getting the simulated netboard to be able to adapt to each game, which should allow the same build to run both games in linked mode and will also make it easier to add new games.


Nice one dude. I'll give that a try and see if it does the trick. I normally play with a wheel myself, but for a bit of quick testing I always like to use the Xbox pad.Thanks for sharing the Le Mans exe.
User avatar
MrThunderwing
 
Posts: 702
Joined: Fri Sep 02, 2011 11:31 am
Location: Bristol, UK

Re: Simulated netboard - future of linked play in Supermodel

Postby MrThunderwing » Fri Mar 12, 2021 10:00 am

I got the Le Mans network working with no issues, thanks!

One thing - I've noticed for both Daytona and Le Mans, in a single PC set-up, only the emulator that's 'in focus' responds to joypad or keyboard inputs, meaning you can't actually have a proper 2 player game at present because the P2 pad won't work unless you click on the P2 version of Supermodel - which in turn then makes the P1 pad stop working. In the old network it didn't matter which emulator was the one in focus. For example, I'd previously managed to get some actual 3P games running between me and 2 other mates, with all three of using separate pads on the one PC. Is there any way you can fix the input issue to be like the old network, please? (Sorry dude, I don't mean to be that one guy who's bombarding you with questions and requests to change stuff when you've only just debuted your work yesterday...)
User avatar
MrThunderwing
 
Posts: 702
Joined: Fri Sep 02, 2011 11:31 am
Location: Bristol, UK

Re: Simulated netboard - future of linked play in Supermodel

Postby orimarc » Fri Mar 12, 2021 11:33 am

Dude...DUDE...DUDEEEEEEEEEE!

Once this is implemented, I think the next release should be 0.4 at least. Maybe update the website, since in 3 weeks it will be Supermodel's 10th anniversary...
User avatar
orimarc
 
Posts: 115
Joined: Tue Sep 27, 2011 9:17 am

Re: Simulated netboard - future of linked play in Supermodel

Postby Enri » Fri Mar 12, 2021 12:36 pm

Great breakthrough, thanks matthew. I wish it works for Spikeout too. I wish I could understand coding to help in the forum, but I can only to be grateful for their efforts.
User avatar
Enri
 
Posts: 23
Joined: Sun Sep 25, 2011 1:29 am

Re: Simulated netboard - future of linked play in Supermodel

Postby nadkadd1981 » Fri Mar 12, 2021 1:01 pm

Amazing and spectacular progress.

Amazing Job.

I prepared Mr. Mathew's setup on both Daytona's. I even placed boomslangz ffb plugin in the game folders. At the beginning it was kind of frustrating getting the accelerator and brake to work (same issue as Mr. Thunderwing) . Alas, after deleting the propitiatory 3rd party values in the ini, everything works as mint.

Waiting for the Scud race project. I would love to listen to the Scud race selection screen music looping tone and i would love to assign different colors to the models.


Cheers

Nader Kaddoura
nadkadd1981
 
Posts: 6
Joined: Fri Mar 12, 2021 10:45 am

PreviousNext

Return to The Catwalk

Who is online

Users browsing this forum: No registered users and 1 guest

cron