Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3   Go Down

Author Topic: EMU: New UAE Variant Released - "fs-uae"  (Read 24932 times)

0 Members and 1 Guest are viewing this topic.

FrodeSolheim

  • fs-uae Dev
  • A600
  • *****
  • Karma: 8
  • Offline Offline
  • Gender: Male
  • Posts: 64
    • FS-UAE Homepage
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #15 on: February 09, 2012, 10:04:53 PM »

i think you can ignore my comments about it not finding the config file.
I had expected that when i clicked on a ".conf" file, and selected "open with... fs-uae" that the config would be opened. I now see that I need to give it jsut the one file in a certain location (the program folder is fine)
No, you made a good point. Why shouldn't you be able to open a config file with fs-uae -or drag and drop a config file on top of fs-uae for that matter. I have fixed this already, so the next version will support this.

I think i would still like to see a Config browser, and editor, for OSX though!

I am not likely to create a configuration editor - I do not think it is worth the time (i.e. I would rather make other features) :-\ -But of course, anyone can create a configuration front-end without my involvement.

As for configuration browser, I do not plan for fs-uae to become a "game center" for amiga games (I have a separate project for this ;-)). Having a simple on-screen file browser for selection a configuration file wouldn't be stupid though - it could help people get started since they would not have to put the config file in exactly the right place etc. I'll think about it.

Also, any thoughts on my comments about joystick/keyboard/port 3-4 mapping etc?

I haven't played Gauntled II 4-player -but if I understand you correctly (plus a little guessing), it can be played on the Amiga with two players having one joystick each, and the last players using separate sets of keys on the Amiga keyboard?

Yes, I think mapping options such as you suggest could be appropriate for fs-uae, for cases like these. I have to think a bit on how it should be configured. I'll put it on the wishlist :)

I am more likely to first implement another feature which has been suggested: An on-screen keyboard for pressing keyboard keys once in a while (say "Escape" to exit a level) from a game pad.
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #16 on: February 09, 2012, 10:52:38 PM »

Acutall, Gauntlet II is the "exception" in that it uses the parallel port joysticks for Players 3/4 (sometimes called "Par Joy 0 / Pat Joy 1")  ... these only support up/down/left/right and single fire button each, and so usually need to be supported by some keyboard keys as well, for any additional functions (e.g. casting magic in Gauntlet II) .... it's a feature that does appear on WinUAE and E-UAE though.


The keyboard mapping I find helpful for games like Pinball Dreams (the original) which did not have CD32 versions, and therefore cannot be played on joystick alone, but do quite suit being played via a joypad.

Perhaps i should post an example (video?) of how this is managed on PSPUAE, where you have the similar problem of trying to set-up multiple control-types with only a joypad input to control it from!!


I am glad you are adding an OSK - this was also found very helpful with PSPUAE!

Also i am glad you have taken on-baord the comments about the Config browser - this would suit me to the ground, as I am likely to "auto-script" a lot of my .conf files anyway, so this is certainly more important for "casual users" than the config editor.

Keep up the great work fs - this project is very exciting!
« Last Edit: February 09, 2012, 10:54:34 PM by Hungry Horace »
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

FrodeSolheim

  • fs-uae Dev
  • A600
  • *****
  • Karma: 8
  • Offline Offline
  • Gender: Male
  • Posts: 64
    • FS-UAE Homepage
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #17 on: February 10, 2012, 05:04:42 PM »

Acutall, Gauntlet II is the "exception" in that it uses the parallel port joysticks for Players 3/4 (sometimes called "Par Joy 0 / Pat Joy 1")  ... these only support up/down/left/right and single fire button each, and so usually need to be supported by some keyboard keys as well, for any additional functions (e.g. casting magic in Gauntlet II) .... it's a feature that does appear on WinUAE and E-UAE though.

Good description, now I get it :) -I had noticed parallel port joystick emulation in the WinUAE UI, but did not really know what it was used for.

The keyboard mapping I find helpful for games like Pinball Dreams (the original) which did not have CD32 versions, and therefore cannot be played on joystick alone, but do quite suit being played via a joypad.

Perhaps i should post an example (video?) of how this is managed on PSPUAE, where you have the similar problem of trying to set-up multiple control-types with only a joypad input to control it from!!

I understand what you mean.

I have also gotten a feature request for online multi-player functionality (well, I think this was the request). -Had no such plans, but thinking about it made me a bit interested (at least enough to try creating a simple prototype at some point). Anyway, this requires modifications to the input event code, so I am going to rewrite the input handling system to allow for:
- input event synchronization between multiple clients
- generic mapping of input events
- on-screen keyboard
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #18 on: February 10, 2012, 06:11:12 PM »


I have also gotten a feature request for online multi-player functionality (well, I think this was the request). -Had no such plans, but thinking about it made me a bit interested (at least enough to try creating a simple prototype at some point). Anyway, this requires modifications to the input event code, so I am going to rewrite the input handling system to allow for:
- input event synchronization between multiple clients
- generic mapping of input events
- on-screen keyboard

Wow! My heart just skipped a beat! We have a section of this forum dedicated to online play via winuae-kaillera but with that not being developed anymore, I had given up hope of ever having online Amiga play ever again!

How brilliant to know you are considering it, and across multiple platforms too... fs-UAE is fast going up in the world!

Good luck with it all, and I will try my hardest I give useful input where I can!
« Last Edit: February 10, 2012, 06:13:26 PM by Hungry Horace »
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

skateblind

  • Important 'looking' person
  • Forum Mod
  • A2000
  • *****
  • Karma: 668
  • Offline Offline
  • Gender: Male
  • Posts: 509
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #19 on: February 10, 2012, 07:09:28 PM »

Awesome. I would donate to help motivate you to do the online stuff.  :)

Maybe get in touch with the guy who created winuae-kaillera and ask him how he did it and for any advice he might have.
Logged
What are you looking at?

FrodeSolheim

  • fs-uae Dev
  • A600
  • *****
  • Karma: 8
  • Offline Offline
  • Gender: Male
  • Posts: 64
    • FS-UAE Homepage
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #20 on: February 11, 2012, 11:21:49 AM »

How brilliant to know you are considering it, and across multiple platforms too... fs-UAE is fast going up in the world!
Good luck with it all, and I will try my hardest I give useful input where I can!

Awesome. I would donate to help motivate you to do the online stuff.  :)

I'm more short on time than on money, so this would probably not help :) -Also, I'm not promising anything! What I need most help with is actually testing FS-UAE -not the online stuff (yet), but everything else. No point in online play if there are bugs in the basic functionality :)

Maybe get in touch with the guy who created winuae-kaillera and ask him how he did it and for any advice he might have.

That might not be necessary. I did some prototyping yesterday evening (well, early night anyway), so during 6 hours I got a basic synchronization working across two clients (One on Mac, one on Windows), communicating with a custom game server I made. It actually seems to be working quite good -no input event synchronization yet, but the emulation does seem to be in sync across both UAE instances (after I also synchronized the Amiga battery backed up clock ;-)). I'm developing a custom protocol sending a reasonable minimum amount of data back and forth, but haven't tried in over the Internet yet (only on LAN).

Well, anyway, looks promising (based on limited testing).
Logged

FrodeSolheim

  • fs-uae Dev
  • A600
  • *****
  • Karma: 8
  • Offline Offline
  • Gender: Male
  • Posts: 64
    • FS-UAE Homepage
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #21 on: February 11, 2012, 10:15:42 PM »

Networked play is actually working now! I have rewritten the input system, and extended the netplay system to synchronize input events across clients. I tested playing Pinball Dreams across three computers at the same time :)  (a Windows, a Mac and a Linux box, even). I have played several sessions without de-sync, but have also gotten one session out of sync, which means that synchronization of the emulation is not 100% stable (yet).

I have also tried running the fs-uae-netplay-server on the server running fengestad.no, with two fs-uae clients connected. Performance seems fine, with a (roundtrip) time of 25 ms to the server.
« Last Edit: February 11, 2012, 11:03:44 PM by FrodeSolheim »
Logged

skateblind

  • Important 'looking' person
  • Forum Mod
  • A2000
  • *****
  • Karma: 668
  • Offline Offline
  • Gender: Male
  • Posts: 509
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #22 on: February 11, 2012, 11:46:12 PM »

hmm, how would one resync on the fly if a desync happens? Or create a more stable sync? I just can't figure it out.

If a game used a random number generator, how do both games randomise the same number or would those game just not be playable online?
Logged
What are you looking at?

FrodeSolheim

  • fs-uae Dev
  • A600
  • *****
  • Karma: 8
  • Offline Offline
  • Gender: Male
  • Posts: 64
    • FS-UAE Homepage
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #23 on: February 12, 2012, 08:39:17 AM »

hmm, how would one resync on the fly if a desync happens?

Short answer: You wouldn't! But one way would actually be to let one client perform a save state, transfer this save state to the other clients, and reset the emulation. Currently, desync isn't even detected. The emulations run independently from each-other -apart from having frame output and input events synchronized. One could perhaps checksum the amiga memory content and send this checksum to the server. -Then  the server should be able to detect most desyncs by comparing the checksums from all clients.

Or create a more stable sync? I just can't figure it out.

If things are working as intended, the emulations should get out of sync at all. When I got the desync, I had full vsync-mode on one of the clients. Vsync mode does have a bit separate code-path in some of the UAE code, so it is possible that this could be the culprit. After I switched both clients to the same video sync mode, I have not been able to get a desync.

If a game used a random number generator, how do both games randomise the same number or would those game just not be playable online?

Random number generators are not truly random. They either need a seed value (often the current time), or read other random data from an external source (for instance a microphone). I synchronize the (emulated) battery-backed-up Amiga clock so that all clients will agree on the time. Also, input events are synchronized.

Here are some conditions which must be fulfilled for synchronization to work 100%:
- Input events must be applied in the same order, and in the same "emulated time" on all clients [done]
- The clients must not be allowed to drift too much from each other (in emulated time) (well, really more of a lag issue) [done]
- Clocks and other inputs which can be read from the Amiga must be synchronized [clocks are synchronized]
- There must not exists bugs in the synchronization
- The emulation itself must be deterministic / stable given the same inputs. If there are random factors involved, those must be either removed, or synchronized across clients. Subtle bugs / differences in emulation could also occur when running on different processor architectures (x86 vs x86-64) if the emulation code is not "perfect".

The question is: are there other random factors involved? I see for instance in disk.cpp:update_jitter that UAE uses random numbers in disk procedures, and this could affect emulation.
« Last Edit: February 12, 2012, 09:52:59 AM by FrodeSolheim »
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #24 on: February 12, 2012, 11:46:40 AM »

this makes for some really interesting reading!!!

Some questions I can think of....

- How will you ensure if (for example) you have HD-Folders in the setup, that you have the same files on each side? Run a check on startup, or check files exist as-you-play and then abort if something is missing on one side?

- How will you determine which side has control of which joysticks/keyboard inputs? will one side have control of certain inputs, and "allow/block" the other side to determine the remaining? Or will you just leave it to the people setting up the configs to arrange it in a fair manner?

- I noticed you mentioned a 25ms ping via the server method - these seems pretty good to me from previous experience with winuae-kaillera, but will you be adding a P2P method as well?

Just a few thoughts I had!!

Very excited about this. Just going to try making some auto-scripting of config files here....
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

FrodeSolheim

  • fs-uae Dev
  • A600
  • *****
  • Karma: 8
  • Offline Offline
  • Gender: Male
  • Posts: 64
    • FS-UAE Homepage
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #25 on: February 12, 2012, 12:15:11 PM »

this makes for some really interesting reading!!!

Yes, it is a quite interesting challenge :)

- How will you ensure if (for example) you have HD-Folders in the setup, that you have the same files on each side? Run a check on startup, or check files exist as-you-play and then abort if something is missing on one side?

Currently, this is not checked. I would call what I have now a (fully working!) prototype. A final version could either:
- assume that everyone has the same files (all persons could for instance unzip the same zip file)
- the client could create a checksum of the entire content before starting, an refuse starting if the content differs
- the client could in theory synchronize the contents (much more work, but simple to do).

- How will you determine which side has control of which joysticks/keyboard inputs? will one side have control of certain inputs, and "allow/block" the other side to determine the remaining? Or will you just leave it to the people setting up the configs to arrange it in a fair manner?

Currently all input events can originate from any client, and will propagate to all clients. That is, everyone can press keyboard keys and and joysticks/mouse should be handled by one player using joystick_port_0 and the other joystick_port_1. It would not be very difficult to later configure the server/game with rules concerning who gets to send which types of input. One could in theory give on player control of a specific set of keyboard keys and another player could control the rest. As I said, this is definitively not rocket-science, but I will not do this for the prototype.

(For now, it works just fine if all players agree on who controls what).

- I noticed you mentioned a 25ms ping via the server method - these seems pretty good to me from previous experience with winuae-kaillera, but will you be adding a P2P method as well?

P2P will add much more complexity without any real gain. One cannot compare "UAE netplay" to another game designed for multiplayer.

Games designed with multiplayer in mind can broadcast UDP events without guaranteed delivery, and the game can implement logic to constantly keep the game state in sync (e.g. in a FPS, all clients need not get every movement commands, since movement can be predicted based on current speed, and position can be exactly updated when a later game event arrives). The point here is that the game itself can allow missing events, or events arriving out of order, as long as it handles this in some sensible way.

This won't work with the Amiga - if two key presses are applied in the opposite order on two clients, the emulation will get out of sync! This means that someone must order the events - this is done by the server. P2P will just make it more difficult to synchronize, and you will not get the benefits from P2P that other applications can get (Events can be ordered in a distributed manner, but this is much more complex, and probably much slower). The IP traffic required to sync games is actually quite modest - the most demanding cases are mouse event propagation. Low latency is more important than bandwidth.

Regarding the ping. Yes, I tested with two clients locally which both played through a server about 12.5 ms away. In this case, you will get a minimum delay (lag) of 25 ms for input, but in practice more, since the input events also are synchronized to frame events.

I do *not* recommend using wireless network. I tested with one client on wireless, and got more jittering (it still worked properly, and not *BAD*, but significantly less smooth). The problem with wireless is packet loss. Since the synchronization protocol cannot work with missed events, or events out of order, guaranteed delivery is required (fs-uae uses TCP for this). This means that packets *must* be resent when a packet loss is detected, and if a frame confirmation event is significantly delayed (the server allows some slack), this will delay the game for all clients. When testing with ping, I saw that the computer on wireless got rounds trips to the server of either 25 ms (good), but relatively often 50 ms.

Ideal conditions for netplay:
* a server with relatively low latency connections to clients. It would be most fair for all players if everyone's latency is comparable.
* low packed loss rate (avoid wireless if possible and do not saturate the link with downloads / P2P traffic while playing).

Very excited about this. Just going to try making some auto-scripting of config files here....

The upcoming version supports overriding the memory settings (probably needed if in many cases you auto-write configs from another configuration database).
« Last Edit: February 12, 2012, 12:19:03 PM by FrodeSolheim »
Logged

FrodeSolheim

  • fs-uae Dev
  • A600
  • *****
  • Karma: 8
  • Offline Offline
  • Gender: Male
  • Posts: 64
    • FS-UAE Homepage
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #26 on: February 12, 2012, 12:23:53 PM »

- How will you ensure if (for example) you have HD-Folders in the setup, that you have the same files on each side? Run a check on startup, or check files exist as-you-play and then abort if something is missing on one side?

A similar issue is configuration. It isn't difficult to a small group of people to agree on the same files and configuration, but desync bugs caused by unintentional errors can be both frustrating and difficult to figure out.

I plan to create a checksum based on all relevant client configuration and state
* disk files
* kickstart image
* relevant configuration values (amiga model, memory, ...)

With HD setups, the following should also be included:
* HD configuration and file data
* File attributes which can be seen from the Amiga

The server will refuse to start a game if the checksums do not match across clients.
Logged

FrodeSolheim

  • fs-uae Dev
  • A600
  • *****
  • Karma: 8
  • Offline Offline
  • Gender: Male
  • Posts: 64
    • FS-UAE Homepage
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #27 on: February 12, 2012, 12:29:31 PM »

The question is: are there other random factors involved? I see for instance in disk.cpp:update_jitter that UAE uses random numbers in disk procedures, and this could affect emulation.

Regarding use of rand() in the emulator itself (such as calculating random jitter in disk emulation), this should be synchronized by seeding the random number generator with the same seed on all clients. Then all clients will generate the same (semi-)random number sequence. Must search/go through all code and make sure all relevant code uses the same random number generator.
« Last Edit: February 12, 2012, 12:36:20 PM by FrodeSolheim »
Logged

FrodeSolheim

  • fs-uae Dev
  • A600
  • *****
  • Karma: 8
  • Offline Offline
  • Gender: Male
  • Posts: 64
    • FS-UAE Homepage
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #28 on: February 12, 2012, 04:51:24 PM »

"Good news, everyone!" (but this really _is_ good news). I have now synchronized random number generation on clients - they use the same algorithm on all platforms, and the seed is synchronized - even more importantly, a bit of UAE code is changed so Windows and other platforms use the random functions in exactly the same places / situations.

To ensure that synchronization is maintained, and subtle bugs do not go unnoticed, the clients send a random number, and a checksum of the contents of the amiga memory for every video frame. The server controls that these matches for each frame across the clients. This is a very powerful control mechanism, and well detect even very subtle out-of-sync-errors which you might not even have notice otherwise.

It is effectively impossible to "prove" that the implementation is correct, but further play testing will give further assurance. I have not been able to get the clients out of sync at all :) -But of course, I haven't exactly been testing for days.
« Last Edit: February 12, 2012, 05:42:53 PM by FrodeSolheim »
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: EMU: New UAE Variant Released - "fs-uae"
« Reply #29 on: February 12, 2012, 05:36:47 PM »

FrodeSolheim - i am amazed at the speed at which you have implemented this!!

I am even more surprised that you made this a priority over other improvements/changes to fs-uae... but, you are the author afterall, and you have truly created a landmark in amiga emulation :)

*opens the champagne!*
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Pages: 1 [2] 3   Go Up
 

TinyPortal 2.2.2 © 2005-2022