RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Uae4arm - randomization issue

    Scheduled Pinned Locked Moved Help and Support
    uae4armrandomizationrpi3batr4.0.2
    3 Posts 1 Posters 1.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • kormikK
      kormik
      last edited by

      Hi Folks,

      I am not sure if this is a global emulator-wide issue or is it just local to the game. The thing is since I upgraded my RPi1 to RPi3 (and RetroPie from 3.8 to 4.0) I have noticed that the powerups in All Terrain Racing game don't appear as randomly/shuffled as they used to. It's not just a feeling as in every race a couple of times I see the same power-up 3-4 times or more in a row. I don't recall anything like that on my A500, and neither on any emulator I have run before. The issue might seem trivial, but in fact it impacts the gameplay quite a lot, as it really is based on powerups :)

      Has anyone encountered anything like that elsewhere? Is randomization in uae anyhow tunable/fixable? Perhaps some CPU/chipset configuration changes could help?

      Thanks!

      1 Reply Last reply Reply Quote 0
      • kormikK
        kormik
        last edited by

        Since I got no replies, I investigated this a little bit myself and this is what I have figured out.

        By looking at the uae4arm source code, I learned it uses something like uaerand(), but this is nothing more but just a standard rand() function from C's stdlib:
        /src/include/uae.h:
        #define uaerand() rand()

        The rand() function, according to this thread on Stack Overflow is not "thread safe" and this causes issues like mine or the one described by the author of the post.

        As a workaround I have disabled 3 of 4 CPU cores by adding maxcpus=1 to /boot/cmdline.txt. This definitely fixed the issue for ATR.

        So, to sum up. This appears to be a bug and it is global for UAE4Arm. Depending on how the game is built it can probably be more or less visible, but I believe it is present anyways.

        Regards.

        1 Reply Last reply Reply Quote 0
        • kormikK
          kormik
          last edited by

          I still have a question related to this topic.

          My workaround works, but it requires a reboot of my RPi which is not very convenient - does anybody know a way of disabling a CPU core online? On non-ARM CPUs it is possible by echo'ing "0" to /sys/devices/system/cpu/cpuX/online, but here it won't work.

          Thanks.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

          Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.