[Mac 0.9.8] Cannot launch, failed to initialize the mouse

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
User avatar
SmileyDude
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Jul 30, 2014 1:38 pm
Contact:

[Mac 0.9.8] Cannot launch, failed to initialize the mouse

Post by SmileyDude »

Hi Everyone --

I just purchased a copy based only on the videos posted on the web, a few reviews and a recommendation from a friend who got sucked into the game until 3 AM last night. When I downloaded the 0.9.8 version this morning, I went to launch it and I got this error message:
factorio-failed-to-initialize-mouse.png
factorio-failed-to-initialize-mouse.png (23.6 KiB) Viewed 12532 times
Since I was able to click on the OK button with my mouse, there isn't a problem that I know about with it. Obviously, this is impeding my ability to play the game :D

My machine specs:
  • 2012 Mac mini, 2.6GHz quad Core i7, 16GB RAM
    MacOS X 10.9.4, Mavericks
This machine has HD4000 graphics and can run games like Diablo 3, Minecraft and others without issue, so I wouldn't think that this game wouldn't work on it. I didn't see anything specific about video cards other than having 512MB to 1GB. According to the System Information app, I've currently got 1GB allocated to VRAM.

I have seen references to higher version numbers in the forums, but I've been unable to locate a download yet. Are these only available via auto-update or is there a direct link somewhere?

Thanks!

EDIT: I just found the download for 0.10.4 and I get the same error message with that version as well.
User avatar
SmileyDude
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Jul 30, 2014 1:38 pm
Contact:

Re: [Mac 0.9.8] Cannot launch, failed to initialize the mous

Post by SmileyDude »

Ok, so I spent *way* too much time tracking this down today, but it looks like it's a bug in the Allegro library for OS X. The mouse detection code was only using the primary HID usage/usage page values and the mouse I have here (Microsoft Comfort Optical Mouse 3000) doesn't report itself primarily as a mouse, oddly enough. I made a quick patch to the Allegro code that I submitted upstream already, but obviously no idea on when that will land in the official git repo for Allegro or into Factorio eventually. I'm attaching the patch here as well, in case the Factorio devs want to apply it on their end.

As an aside, it's a bit unfortunate that the OS X version of Factorio has the Allegro libraries statically linked rather than just using embedded frameworks. I could've patched my copy locally if that was done instead. Just a suggestion for future releases.

For now, I'm off to find another mouse that I can use :D

EDIT: for some reason, this forum isn't allowing me to upload the patch file. I'm putting in inline here in case anyone needs it.

Code: Select all

 src/macosx/hidman.m | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/macosx/hidman.m b/src/macosx/hidman.m
index 6e5ac65..f62ee07 100644
--- a/src/macosx/hidman.m
+++ b/src/macosx/hidman.m
@@ -372,8 +372,8 @@ HID_DEVICE_COLLECTION *_al_osx_hid_scan(int type, HID_DEVICE_COLLECTION* col)
      /* Add key for device type to refine the matching dictionary. */
      usage_ref = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &usage);
      usage_page_ref = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &usage_page);
-     CFDictionarySetValue(class_dictionary, CFSTR(kIOHIDPrimaryUsageKey), usage_ref);
-     CFDictionarySetValue(class_dictionary, CFSTR(kIOHIDPrimaryUsagePageKey), usage_page_ref);
+     CFDictionarySetValue(class_dictionary, CFSTR(kIOHIDDeviceUsageKey), usage_ref);
+     CFDictionarySetValue(class_dictionary, CFSTR(kIOHIDDeviceUsagePageKey), usage_page_ref);
    }
    result = IOServiceGetMatchingServices(master_port, class_dictionary, &hid_object_iterator);
    if ((result == kIOReturnSuccess) && (hid_object_iterator)) {
-- 
1.9.3 (Apple Git-50)
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [Mac 0.9.8] Cannot launch, failed to initialize the mous

Post by kovarex »

Wow thank you for the help, we will include it (once we test it).

The static link of allegro has its reasons, and connecting altered allegro version based on the original would work, because we have our own changes in the allegro as well.
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: [Mac 0.9.8] Cannot launch, failed to initialize the mous

Post by cube »

Hi, thanks for the patch. Slpwnd (our OSX guy) is out for a few days, so we can't test it now. I'll ask him to merge this as soon as he returns. Unfortunately this means that your patch won't make it into 0.10.6, so you will have to play Factorio with a different mouse for at least one more week :-)
User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: [Mac 0.9.8] Cannot launch, failed to initialize the mous

Post by SHiRKiT »

It's amazing how many bugs shows up in this forum every day, and how different they are.
User avatar
micomico
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Thu Jul 24, 2014 10:55 pm
Contact:

Re: [Mac 0.9.8] Cannot launch, failed to initialize the mous

Post by micomico »

SHiRKiT wrote:It's amazing how many bugs shows up in this forum every day, and how different they are.
This tells me the game is getting ever more popular, with more players reporting problems. Not that the number of bugs are rising or something like that.

Also, I like to think that people report bugs because they want their game - which they enjoy - fixed, rather than simply pointing the existing bugs with a negative intention.
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: [Mac 0.9.8] Cannot launch, failed to initialize the mous

Post by slpwnd »

@SmileyDude Thanks for reporting the issue, researching it and solving it yourself! That is the spirit :D I have merged the patch to the 0.10.x branch and it works fine at my setup. It will be present in the next release.
micomico wrote:This tells me the game is getting ever more popular, with more players reporting problems. Not that the number of bugs are rising or something like that.

Also, I like to think that people report bugs because they want their game - which they enjoy - fixed, rather than simply pointing the existing bugs with a negative intention.
I certainly hope that is the reason :D
User avatar
SmileyDude
Burner Inserter
Burner Inserter
Posts: 8
Joined: Wed Jul 30, 2014 1:38 pm
Contact:

Re: [Mac 0.9.8] Cannot launch, failed to initialize the mous

Post by SmileyDude »

slpwnd wrote:@SmileyDude Thanks for reporting the issue, researching it and solving it yourself! That is the spirit :D I have merged the patch to the 0.10.x branch and it works fine at my setup. It will be present in the next release.
Not a problem at all. Glad I could be of some assistance here.

BTW, I've since swapped out my machine to a MacBook Pro. And on those, this problem never occurs because there is always at least one mouse device (the trackpad) that passes the Allegro test as a valid mouse. Once that hurdle has been jumped, it doesn't matter what mouse you use -- everything just works.
Post Reply

Return to “Technical Help”