English Amiga Board


Go Back   English Amiga Board > Support > support.FS-UAE

 
 
Thread Tools
Old 03 March 2012, 21:49   #61
AmigaOnline
Online Amiga Gaming
 
AmigaOnline's Avatar
 
Join Date: Jun 2010
Location: Paris/France
Posts: 280
Smile

Quote:
Originally Posted by FrodeSolheim View Post
* Save state saving and restoring is now synchronized in net play mode.
Really thanks for this update! (It works )
AmigaOnline is offline  
Old 04 March 2012, 15:23   #62
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
I have discovered a race condition in the net play server where input events could (occasionally) be sent to players interleaved differently with frames. This will almost certainly cause a desync. A proper thread synchronization primitive (mutex) is added, and the fix is forthcoming

I have also replaced a busy loop in FS-UAE net play code with a condition primitive, which means that FS-UAE will use a lot less (unecessary) CPU in net play mode.
FrodeSolheim is offline  
Old 04 March 2012, 16:19   #63
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Version 0.9.11beta3

* Fixed a bug where large positive mouse movement became negative.
* Event information is written to Synchronization.log during net play (this file can be quite large) -cannot be disabled yet.
* Include slow memory in memory checksumming (chip + slow, now).
* Replaced a busy-loop in net play with proper condition signal/wait, using significantly less CPU now.
* Fixed a race condition in the net play server where input events could be sent to some clients out of order (with regard to frames). This would have caused desync when it occurred.
* Fixed a bug in the net play server where input events could be sent to some clients before all clients were connected.
* Detect refresh rate properly on Mac OS X (was not included in 0.9.11beta2).

Version 0.9.11beta3 can be download here: http://fengestad.no/wp/fs-uae/download-beta

For net play, this version is incompatible with earlier FS-UAE releases, and also requires an updated server: http://fengestad.no/wp/fs-uae/net-play
FrodeSolheim is offline  
Old 04 March 2012, 16:32   #64
AmigaOnline
Online Amiga Gaming
 
AmigaOnline's Avatar
 
Join Date: Jun 2010
Location: Paris/France
Posts: 280
Your updates are really appreciated!
AmigaOnline is offline  
Old 05 March 2012, 02:17   #65
AmigaOnline
Online Amiga Gaming
 
AmigaOnline's Avatar
 
Join Date: Jun 2010
Location: Paris/France
Posts: 280
Quote:
Originally Posted by FrodeSolheim View Post
If the game requires mouse + joystick at one point during the game, and joystick + joystick at another, this is not currently possible with FS-UAE. It would need a input configuration menu in FS-UAE (planned anyway), but also distributed joystick port swapping (this is possible to do).
That could be very useful
AmigaOnline is offline  
Old 06 March 2012, 18:56   #66
P-J
Registered User
 
P-J's Avatar
 
Join Date: Mar 2001
Location: Moorpark, California
Age: 44
Posts: 1,153
What happens if a game does something that involves random numbers?

Just say, for example, Sneech decides to place the collectibles based on randomness using the system clock or elapsed milliseconds as it's seed. Would this always result in the same behaviour on both systems?
P-J is offline  
Old 10 March 2012, 09:39   #67
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Quote:
Originally Posted by P-J View Post
What happens if a game does something that involves random numbers?

Just say, for example, Sneech decides to place the collectibles based on randomness using the system clock or elapsed milliseconds as it's seed. Would this always result in the same behaviour on both systems?
As your correctly mention, games (and programs) use pseudo-random numbers based on, for example, the system clock or elapsed time.

Since the Amiga are run synchronously in net play, elapsed time will be identical at the time the game wants to create a random number, so both Amigas in a 2-player net game will generate the same random number.

(Also, MSM6242B/RF5C01A clocks are synchronized -but just a hack for now - both are set to 0, -proper time synchronization will be fixed later).

But the point is, games should work just fine, also when using random numbers!
FrodeSolheim is offline  
Old 10 March 2012, 12:38   #68
AmigaOnline
Online Amiga Gaming
 
AmigaOnline's Avatar
 
Join Date: Jun 2010
Location: Paris/France
Posts: 280
Smile

Quote:
Originally Posted by FrodeSolheim View Post
But the point is, games should work just fine, also when using random numbers!
I can confirm that. Sneech seems to work online And "random" numbers/results are the same for all players (in this game at least)
AmigaOnline is offline  
Old 10 March 2012, 12:46   #69
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Quote:
Originally Posted by AmigaOnline View Post
I can confirm that. Sneech seems to work online And "random" numbers/results are the same for all players (in this game at least)
Excellent

Quote:
Originally Posted by AmigaOnline View Post
... The same issue will probably occur with games like Rodland/Super Cars 2....
I believe Super Cars 2 (floppy version) (and any other floppy game) should work perfectly as well!
FrodeSolheim is offline  
Old 10 March 2012, 13:09   #70
AmigaOnline
Online Amiga Gaming
 
AmigaOnline's Avatar
 
Join Date: Jun 2010
Location: Paris/France
Posts: 280
Quote:
Originally Posted by FrodeSolheim View Post
Excellent



I believe Super Cars 2 (floppy version) (and any other floppy game) should work perfectly as well!
Hehe, this game will be tested asap
Other games have been successfully tested:
-Base Jumpers
-Battle Squadron
-IK+
-Kick Off 2
-Lemmings
-Lotus Esprit Turbo Challenge
-Lotus Turbo Challenge 2
-North & South
-Pang
-Pinball Dreams
-Speedball 2

With the passing of time, the most awaited features are:
-input configuration menu
-distributed joystick port swapping
-a working/basic chat feature (just to make sure that the other players are not already dead)
-a message/info to explain why the players have been disconnected from the server (unexpected bug or normal shut down)

Keep up the good work!
AmigaOnline is offline  
Old 10 March 2012, 13:13   #71
Foul
Registered User
 
Foul's Avatar
 
Join Date: Jun 2009
Location: Perigueux/France
Age: 49
Posts: 1,516
Send a message via ICQ to Foul Send a message via MSN to Foul
@AmigaOnline : Vais ptet enfin ! pouvoir jouer en ligne sous nunux grâce à cet émulateur

@Others : i will maybe can play online under Linux with this fabulous emulator
Foul is offline  
Old 10 March 2012, 13:39   #72
AmigaOnline
Online Amiga Gaming
 
AmigaOnline's Avatar
 
Join Date: Jun 2010
Location: Paris/France
Posts: 280
Quote:
Originally Posted by Foul View Post
@AmigaOnline : Vais ptet enfin ! pouvoir jouer en ligne sous nunux grâce à cet émulateur

@Others : i will maybe can play online under Linux with this fabulous emulator
Okay
AmigaOnline is offline  
Old 10 March 2012, 13:40   #73
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Quote:
Originally Posted by AmigaOnline View Post
With the passing of time, the most awaited features are:
-input configuration menu
-distributed joystick port swapping
-a working/basic chat feature (just to make sure that the other players are not already dead)
-a message/info to explain why the players have been disconnected from the server (unexpected bug or normal shut down)

Keep up the good work!
I have been away for work all week, and haven't been able to code on FS-UAE, but I have made plans in my head -And I was just considering working on exactly these issues

Regarding disconnects / error messages: yes, I have of course planned to have the server report back error codes to the client. The current implementation where FS-UAE just quits on error with any message is just a preliminary implementation, due to net play being coded during a single weekend

But this is what I am thinking to do: if net play is aborted (for any reason), the server sends error code/message to clients, and shuts down (on unrecoverable errors, at least), but FS-UAE will continue to run in off-line mode (instead of quitting).

This way, it will be possible for players to continue playing alone, or save the game state (if one state is copied to other players, one could in theory continue playing later).

Regarding desyncs, in the future, the game will probably continue (for the same reason as above), but with a clearly marked error message / icon in FS-UAE letting the players know that the game is not in sync -but still, better than just shutting down (allows saving, etc).
FrodeSolheim is offline  
Old 10 March 2012, 13:46   #74
AmigaOnline
Online Amiga Gaming
 
AmigaOnline's Avatar
 
Join Date: Jun 2010
Location: Paris/France
Posts: 280
Quote:
Originally Posted by FrodeSolheim View Post
But this is what I am thinking to do: if net play is aborted (for any reason), the server sends error code/message to clients, and shuts down (on unrecoverable errors, at least), but FS-UAE will continue to run in off-line mode (instead of quitting).

This way, it will be possible for players to continue playing alone, or save the game state (if one state is copied to other players, one could in theory continue playing later).

Regarding desyncs, in the future, the game will probably continue (for the same reason as above), but with a clearly marked error message / icon in FS-UAE letting the players know that the game is not in sync -but still, better than just shutting down (allows saving, etc).
Excellent!
AmigaOnline is offline  
Old 10 March 2012, 14:24   #75
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,518
Quote:
Originally Posted by FrodeSolheim View Post
(Also, MSM6242B/RF5C01A clocks are synchronized -but just a hack for now - both are set to 0, -proper time synchronization will be fixed later).
Better to just not include real-time clocks in emulation configuration when playing games, no game cares

Problem isn't actually the clock time directly but 68000 MUL/DIV instruction having different cycle counts depending on instruction parameters, time conversion routines usually use multiplication and division.

If I remember correctly, random numbers are only used in floppy emulation to generate random number of extra bits to disk image's emulated write splice (There are loaders that break if word sync state is _not_ lost during gap!) and internally in IPF decoding library (but it has API to set and get the seed value)
Toni Wilen is offline  
Old 10 March 2012, 14:41   #76
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Hi Toni, thanks for replying!

Quote:
Originally Posted by Toni Wilen View Post
Better to just not include real-time clocks in emulation configuration when playing games, no game cares
Yes, I found out after coding it that the normal Amigas (A500 etc) did not have real time clocks anyway ;-)

Quote:
Originally Posted by Toni Wilen View Post
Problem isn't actually the clock time directly but 68000 MUL/DIV instruction having different cycle counts depending on instruction parameters, time conversion routines usually use multiplication and division.
But if the clients are kept in sync, and using cycle-exact emulation, this should still work? (Of course, fastest possible modes are not supported). I haven't spotted any problems so far, but I am not an Amiga hardware expert, so if you believe there could be a synchronization issue here, I would appreciate any hint/help you can give!

Quote:
Originally Posted by Toni Wilen View Post
If I remember correctly, random numbers are only used in floppy emulation to generate random number of extra bits to disk image's emulated write splice (There are loaders that break if word sync state is _not_ lost during gap!) and internally in IPF decoding library (but it has API to set and get the seed value)
You are correct! This issue is handled in FS-UAE like this:
* All calls to random which can affect emulation is replaced with a call to uae_random(). uae_random does not use the system rand functions, but a custom random number generator (Mersenne twister from glib), and this is initialized to the same value on all clients in net play.

The net effect is that the random bits should be calculated identical on all clients. As an extra safe guard, a random number is calculated for each frame and sent to the server to check that the custom random number generators are still in sync.

I found the seed value for IPF decoding when implementing net play, and simply initialized this to 0 in the initial version, but will replace this with a call to uae_random().
FrodeSolheim is offline  
Old 10 March 2012, 15:37   #77
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,518
Quote:
Originally Posted by FrodeSolheim View Post
But if the clients are kept in sync, and using cycle-exact emulation, this should still work? (Of course, fastest possible modes are not supported). I haven't spotted any problems so far, but I am not an Amiga hardware expert, so if you believe there could be a synchronization issue here, I would appreciate any hint/help you can give!
Yes, it should work fine.
Toni Wilen is offline  
Old 11 March 2012, 21:03   #78
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Quote:
Originally Posted by AmigaOnline View Post
-input configuration menu
-distributed joystick port swapping
I have released version 0.9.13alpha1 with new input configuration menu (joystick port mode switching should work in net play mode, but I haven't tested it yet):

http://eab.abime.net/showpost.php?p=...&postcount=287
FrodeSolheim is offline  
Old 11 March 2012, 23:16   #79
AmigaOnline
Online Amiga Gaming
 
AmigaOnline's Avatar
 
Join Date: Jun 2010
Location: Paris/France
Posts: 280
Quote:
Originally Posted by FrodeSolheim View Post
I have released version 0.9.13alpha1 with new input configuration menu (joystick port mode switching should work in net play mode, but I haven't tested it yet):

http://eab.abime.net/showpost.php?p=...&postcount=287
Thanks a lot, Frode!
AmigaOnline is offline  
Old 12 March 2012, 00:02   #80
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Quote:
Originally Posted by AmigaOnline View Post
Thanks a lot, Frode!
I replaced the links to alpha1 with alpha2. A minor update only: joystick port mode is properly updated on the main menu for other players if one player changes joystick port mode.
FrodeSolheim is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
UAE XFD wrapper (beta) Toni Wilen Amiga scene 9 06 July 2022 12:14
fs-uae.net - New home page for FS-UAE FrodeSolheim support.FS-UAE 4 01 May 2013 11:10
Can FS-UAE be used to play on the same IP? Neil79 support.FS-UAE 9 09 February 2013 21:03
P-UAE on wiki.abime.net ? Mequa support.OtherUAE 4 24 November 2010 23:50
How i can get a game on net and play it on AMIGA Scuppe80 Amiga scene 4 29 September 2004 16:47

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 22:04.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13439 seconds with 16 queries