Closed felleg closed 2 years ago
Hey Felix,
When SAM detects Button inputs, it should stop the shuffle indefinitely if menuonly=yes
is set in the ini. menuonly means "Only start SAM if you are in the main Mister menu. So menuonly=no
will continue the shuffle while you have started playing a game.
A couple days ago we fixed an issue where menuonly was ignored by SAM. If you update, it should work again now as intended.
1 and 2 of your use cases can be controlled by setting listenjoy=no
(or whatever input device you use) in the ini.
We used to have an extra script for use case 3 that we called I feel lucky
. Let me see if I can find it, we can add it as an extra option on GitHub.
I can add those three modes in the SAM menu. Shouldn't take me long and it means you won't have to change things manually. Those three cases are all covered by SAM but can't be set in a convenient way. Let's make this easier.
Thanks a lot mrchrisster! You're making an already great script ever greater!!
Another thought: It would be perfect if we could set a different counter for modes 1 and 2.
My controller isn't recognized, either, but both mouse and keyboard are recognized, so, if you have one of those connected, try moving the mouse, or, hitting a key on the keyboard.
I have a first version ready in test branch.You can test by going to MiSTer_SAM.ini
and set branch=test
at the bottom. Then update and check the new menu items. (Game roulette)
@Paradox I'd like to figure out why your controller is not detected. What output do you get from ls /dev/input
?
by-id event0 event10 event2 event4 event6 event8 js0 js2 js4 mouse0 mouse2 by-path event1 event11 event3 event5 event7 event9 js1 js3 mice mouse1 mouse3
I have several controllers connected, and upon pushing buttons on all of them, only 1 was detected.
Looking around in the different scripts, it seems it only watches js0, although there is some commented code that is meant to start a watcher for each controller. Seems we need to figure out how to ignore BT only, or, figure out a way to work around it. None of the controllers I have connected are BT, but, I do have some, I guess I'll dig them up and test them out..
I uncommented the code, and all 4 of my controllers work, now. So, we need to figure out how to work with, or, around misbehaving controllers.
The problem is a lot of people are buying PS5 controllers now. A single controller connected over bluetooth creates a js0 and js1 device. Js1 in my case is always firing which breaks SAM. Kitrinx thinks it's probably the info from the different sixaxis causing a constant stream of data.
What we could do is have a switch in the ini for Bluetooth controllers which only enables js0. Otherwise we would need to improve on the python script to see if any of the binary data streaming through js devices can let us identify PS5 controllers.
I feel this thread is developing into its own issue. Should we make a separate issue to make sure what I discussed in the OP is properly tracked?
My thoughts exactly and that's what I just did:
Did you try out the test branch?
I did:
git fetch && git checkout test
scp MiSTer_SAM_on.sh root@MiSTer:/media/fat/Scripts
Here is what I see after running the script:
I do see the added modes by doing a git diff
Where should I go in the configuration menu to set my roulette preferences?
No additional options in the Scripts list
In short, the MiSTer_SAM_on.sh of the test
branch seems to run for me as the current main
version.
That's not how it works, you open the ini and change branch, all the way at the bottom, to test and run the script again, with no switches, or, the upgrade switch.
I managed to make it work!
It's almost as I imagined. The only things I wish for are :
Other than that, it works wonders! Thanks a ton @mrchrisster , let me know if you intend to fulfill these wishes or not. :)
Actually, one thing I notice is the roulette1 option doesn't seem selectable (see gif from comment above). Normal?
Hey Felix,
Yeah this was my test setup. You see that the gametimer is actually just 30s, so I can test if the variables are being handled correctly.
With lucky mode, I was thinking of taking it back out since it's basically SAM's original behavior once button detection is fixed. If you start playing a game and menuonly="Yes"
it will not continue cycling. So just clicking on Start SAM should yield the same results...
Happy to create an ini variable for the roulette timer, that's easy to do.
Looking forward to it! Thanks a ton :)
Hey Felix, roulette mode should be working now. Initially you wrote
while I believe the script normally should detect inputs and stop the internal counter to allow players to pick up and play a game, it seems the game changes for us when the counter reaches 0 even after we start playing it.
Can you update main branch and see if this works correctly now for you? We've been busy working on button detection for both keyboard and gamepads and hopefully SAM detects your controllers now.
It looks like it's working great for controller detection on the main branch!
I noticed you added this line in the config, but I haven't figured out how to customize the roulette timers ("Play a random game for X minutes").
# SAM game roulette is a mode available in the menu, where you only have a certain amount of time to play a game, before SAM shuffles to the next game.
# SAM will ignore any button inputs and shuffle to a new game after the set timer expires.
# While SAM is primarily meant as a way to enjoy the pixel art of random games, roulette mode let's you play those games while continuing to shuffle.
roulettetimer="500"
Should be bottom entry in the game roulette menu
Ah! I see it now, looks like it works great.
What happened to lucky mode, though? Was it moved elsewhere?
Lucky mode is basically the way SAM works (if button detection works correctly), so there was no need for it
Right, brilliant!
My usecase is perfectly handled now. I could nitpick and say "I wish I could launch roulette with a specific core", but that wasn't my original idea. Closing this issue, thanks a bunch! :)
welcome :)
Context for this "issue":
I've been using this script with a friend to "spin the wheel and find random games" to great success. I think I'm having a "it's a bug, not a feature" experience: while I believe the script normally should detect inputs and stop the internal counter to allow players to pick up and play a game, it seems the game changes for us when the counter reaches 0 even after we start playing it. Is this intended behavior? Either way, I love this behavior. It maade me realize that there are three different ways I want to use SAM.
What I would like to accomplish:
I see three modes in which MiSTer SAM could operate to cover all usecases that comes to my mind:
counter
reaches 0 regardless of button inputscounter
reaches 0 only if no input has been pressedI would like to find a way to easily pick in which mode I want to run MiSTer SAM. What would be the cleanest way to set this up? The best solution for me would be one that allows picking a Script that would launch MiSTer SAM in the correct mode.
Another thought: It would be perfect if we could set a different counter for modes 1 and 2.
Brainstorming
I thought about making different copies of the MiSTer_SAM script to track different ini files, but doing so would prevent me from getting automatic updates for the script. Currently, MiSTer SAM only supports 1 ini file with a hardcoded path, so I suppose running MiSTer SAM in the three modes outlined above is not possible without modifying the ini file every time.
Thoughts?