Pipeline Minigame in Oil Imperium - unable to control mouse

Quark999
Posts: 15
Joined: Tue Jul 28, 2020 8:37 pm
Has thanked: 3 times

Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by Quark999 »

I've been trying to play my favourite game from 1989, Oil Imperium (apparently sometimes known as Black Gold) - and I eventually come up against the pipeline laying minigame that appears to be impossible to control on Minimig. It involves using the mouse to click on various pipeline pieces to reach the end, and the mouse behaves as if its wheels are stuck, left and right is largely okay, but up and down just barely moves at all, making it impossible to get from one icon to the next in time.
I've looked into it a little, and there are various forum threads from WinUAE describing the same problem, including this https://eab.abime.net/showthread.php?t=6569 and this http://eab.abime.net/showthread.php?t=41089

Apparently, this game is generally highly dependent on timing, but also uses a weird way of reading the mouse during that minigame - "It reads JOY0DAT every line (not frame, line!) and only checks if difference compared to previous read is negative or positive. (mouse movement speed -1, 0 or 1). UAE only updates mouse counters few times per frame which isn't really compatible with this weird method "

I am somewhat surprised to run into the same problem on Minimig as WinUAE encountered way back when, and which apparently has been fixed in WinUAE. I would have expected Minimig to behave more closely to real hardware, and I thought I had cracked it when I discovered that I had tried with a 68020 in the configuration - but sadly switching to a 68000 made the oil drilling more controllable, but the pipeline laying is still impossible.

Does anyone have any other suggestions on what I can try on the configuration end, and why this might be happening in the first place?
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 195 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by Malor »

At 60 frames a second, and 200 lines per frame, that means that OI is checking the mouse 12,000 times a second, or 12,800 times in PAL mode (50Hz * 256 lines), both of which are way past what current USB polling rates will handle. The fastest I've heard of is 8,000 samples/second, and that's extremely uncommon; 1,000/sec is considered fast, 125/sec is normal. A mouse connected to the Linux host is unlikely to work well with that game.

I'm not sure if even the SNAC system would go that fast, or if Minimig will use it. If both things are true, you might be able to rig up a SNAC-DB9 adapter and connect a real Amiga mouse, but I definitely wouldn't proceed until someone who knows the internals of the core tells you definitively that it will do what you want.

edit: SNAC, not SNAP, doh.
Quark999
Posts: 15
Joined: Tue Jul 28, 2020 8:37 pm
Has thanked: 3 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by Quark999 »

Hmm... How would an emulator like WinUAE "fix" that I wonder.

It would be a fun reason to try a physical Amiga mouse, not that I have one. I've got a daemonbite adspter, but as that still goes through USB I suspect it won't help matters? Is there such a thing as a SNAC adapter that works with Minimig?
mahen
Posts: 185
Joined: Sun May 24, 2020 8:25 pm
Has thanked: 19 times
Been thanked: 6 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by mahen »

I guess his minigame could be patched in a whdload slave.. https://whdload.de/games/OilImperium.html

Yep why not try a regular Amiga mouse through Snac or Antonio Villena's db9 implementation ?
Quark999
Posts: 15
Joined: Tue Jul 28, 2020 8:37 pm
Has thanked: 3 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by Quark999 »

I didn't think there was SNAC support in the Amiga core anymore? Having to go back to an older core AND investing into a SNAC adapter seems a bit risky, so perhaps Blisster is the way to go...
Probably a bit much for just one minigame in one game, so I'll see what transpires over the longer term. Might play with the USB polling as well, just to see if it makes *any* difference.
mahen
Posts: 185
Joined: Sun May 24, 2020 8:25 pm
Has thanked: 19 times
Been thanked: 6 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by mahen »

You can use the db9 fork in update all, can't you ?

Did you try with fast usb polling ? Did you try the whdload version ?
Quark999
Posts: 15
Joined: Tue Jul 28, 2020 8:37 pm
Has thanked: 3 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by Quark999 »

I suppose so - didn’t look as up-to-date as the main core, but the bigger issue is that I need to by another adapter AND a DB9 mouse, and that’s probably a bit much just for one badly coded mini game :)
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 195 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by Malor »

You don't need to spend any money to turn on 1000Hz polling in Mister, or to use the WHDLoad image. WHD recipes often patch binaries, and the specific one he linked mentions multiple timing fixes and the pipeline minigame specifically. If you can get the right source originals, it looks like that recipe may fix everything for you.
Quark999
Posts: 15
Joined: Tue Jul 28, 2020 8:37 pm
Has thanked: 3 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by Quark999 »

If it needs to poll at 12000hz then 1000hz might not be good enough. And I did use the WHDLoad version and it has the same problem.
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 195 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by Malor »

Are you sure that you used the specific image generated by the specific recipe that mahen linked? Not all WHDLoad images are created equal.

You have to actually source the exact originals he used, and then generate the image yourself using that specific recipe, which takes awhile and needs a bigger install (the dev version of WHDLoad instead of just the player). That's pain, but costs zero dollars.

From all the patches he issued, it sure sounds like he was fixing the timing issues. The last patch was in 2019, so it strikes me as fairly probable that he also fixed it to work with emulators.

I mean, none of this is guaranteed to work, and might be wasted effort, but I always find it kinda fun to work with old machines like that. Getting old software working is frequently more interesting than the actual software is.
Quark999
Posts: 15
Joined: Tue Jul 28, 2020 8:37 pm
Has thanked: 3 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by Quark999 »

Good point - I had assumed that the MegaAGS collection would have those patches applied, but i guess not necessarily. I have a few "vanilla" Oil Imperium images as well as my original floppies and a Kryoflux, so perhaps I use this as a challenge - it was probably my favourite game back in the day (I was young and naive :)), and it would be good to try and get it to work like it was intended, first without spending any extra money.

Thanks everyone, I had somehow assumed that Minimig would play such a common and old game just as-is, so I'm just glad that it's not just me going crazy.
Optiroc
Posts: 107
Joined: Sun May 24, 2020 7:29 pm
Has thanked: 7 times
Been thanked: 38 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by Optiroc »

MegaAGS should include the latest WHDL installs, but it’s worth to double check this one perhaps.

But it’s quite likely that the timing fixes merely makes sure that the game polls at the original frequency regardless of hardware setup. So fixing this would require work on the mouse input parts of Minimig.
User avatar
limi
Top Contributor
Posts: 776
Joined: Sun May 24, 2020 6:53 pm
Has thanked: 180 times
Been thanked: 570 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by limi »

The version in latest MegaAGS is v1.6, same as the one linked above.
Quark999
Posts: 15
Joined: Tue Jul 28, 2020 8:37 pm
Has thanked: 3 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by Quark999 »

Thanks for checking that, that saves me a bunch of work. Unfortunatey it also leaves me with fewer options :(
Quark999
Posts: 15
Joined: Tue Jul 28, 2020 8:37 pm
Has thanked: 3 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by Quark999 »

Increasing the USB polling rate didn't make a difference at all to mouse movement in that minigame, so the only remaining options needs to invest in a DB9 mouse, plus a SNAC adapter, plus switching the the SNAC enabled branch of the Amiga core. I think I'll park that project for a while...
kolla
Posts: 191
Joined: Sat Jun 13, 2020 7:56 am
Has thanked: 17 times
Been thanked: 33 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by kolla »

What is a “frame” in this context? Amiga displays are written line by line directly to screen, and what’s to be written to a line may change even after the first lines have already been written. Of course, with emulation, writing lines directly to hardware may not be an option and you may have to finish writing a whole screen before it can be sent to the display as a frame…
mahen
Posts: 185
Joined: Sun May 24, 2020 8:25 pm
Has thanked: 19 times
Been thanked: 6 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by mahen »

Maybe you could file a bugreport on the Minimig bugtracker, though ? As you say it does work under UAE even though the mouse is clearly not polled at the right frequency...
Quark999
Posts: 15
Joined: Tue Jul 28, 2020 8:37 pm
Has thanked: 3 times

Re: Pipeline Minigame in Oil Imperium - unable to control mouse

Unread post by Quark999 »

I've filed a bug report, at least for the record. It works fine in WinUAE, but even 1000 Hz polling doesn't make a difference in Mister. I'm not even sure a "proper" SNAC/DB9 mouse would work, and I'm not entirely keen on spending money on it to find out :)
Post Reply