Mouse interface for Grim Fandango (Fan made mod)

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
tobiaspfaff
Posts: 33
Joined: Sat Feb 08, 2014 3:50 am

Post by tobiaspfaff »

robb_force wrote:This is awesome work!

I wanted to be able to call the residualvm executable from the command-line, but the current binary wasn't built to allow that.
Nice, thanks! Do you remember which options you had to set to enable the cmd-line options in your build?
tobiaspfaff
Posts: 33
Joined: Sat Feb 08, 2014 3:50 am

Post by tobiaspfaff »

hennymcc wrote:For those who are interested in an Android version, here it is:
Ha! That's pretty awesome. Just tried it, and it works!

Two issues:
In direct touch mode, the cursor needs to move before clicking, otherwise no action is performed. In mouse mode, the aspect ratio is off on my phone screen.

But yeah, I'm pleasantly surprised the Android port plays so nicely with the mouse mod. Good work!

PS: Pick-up shouldn't be required for the grinder. I rigged it so Manny automatically picks it up after using it on the machine, so you can play that with the mouse mod.
User avatar
JohnnyWalker2001
Posts: 405
Joined: Mon Oct 16, 2006 1:27 pm
Location: London, UK

Post by JohnnyWalker2001 »

I've blogged about your amazing mod on the GFDeluxe site. Hopefully it will make even more people aware of work, and possibly lead to more volunteers on ResidualVM.

http://grimfandangodeluxe.blogspot.co.u ... -here.html
robb_force
Posts: 2
Joined: Sun Feb 23, 2014 11:40 pm

Post by robb_force »

tobiaspfaff wrote: Nice, thanks! Do you remember which options you had to set to enable the cmd-line options in your build?
I followed the scummvm tutorial to build the visual studio project files, which has the commandline option already set.

http://wiki.scummvm.org/index.php/Compi ... ual_Studio
That's the relevant page and there's a bit at the bottom named "Enable the console" that explains what to change on the project.
misanthropos
Posts: 4
Joined: Sat Mar 29, 2014 3:52 pm

mouse.lab not in repository?

Post by misanthropos »

I came accross here to ask about mouse.lab which I cannot find except as in the forum posted from the windows zip-file because I am trying to make it work on my machine. Where is that file to be found then normally?
I don't see it in the official repository.
Since I have a bought a netbook with an Atom 2800 and this crap called PowerVR GMA3600 integrated which is not supported in Linux I have to rely on software rendering.. and NOT using fullscreen.
Unfortunately going to full screen is buggy with all SDL - It will set wrong dimensions and I will see only half of the whole thing.. thats with every game I have tried so far using SDL going fullscreen..
I wonder why I am not able to get the mouse working then.. could it be related to having it run in a window?
I copied mouse.lab to the datadir and had grim_mouse pulled from the official repository.. compiled it.. installed it..
It works so far... just without responding to my mouse.

Any ideas?
tobiaspfaff
Posts: 33
Joined: Sat Feb 08, 2014 3:50 am

Post by tobiaspfaff »

Hi misanthropos,

if you're building from source, mouse.lab can be found in dists/engine-data in the repository. Mouse support works in both windowed and full-screen mode. Software rendering is not supported at the moment, however-- there are issues with transparency rendering using TinyGL which I haven't yet had the time to figure out.
misanthropos
Posts: 4
Joined: Sat Mar 29, 2014 3:52 pm

Post by misanthropos »

sorry... went through twice.. see next post
Last edited by Guest on Sun Mar 30, 2014 4:30 pm, edited 2 times in total.
misanthropos
Posts: 4
Joined: Sat Mar 29, 2014 3:52 pm

Post by misanthropos »

Thanks for your quick reply, Tobias - but this is what's driving me nuts :?

I git cloned https://github.com/tobiaspfaff/grim_mouse

./configure
make
compiles through and results with working binary.

Anyway:

find . -name mouse.lab - result: nothing
find . -name Makefile -exec grep {} mouse \; - result: nothing

I don't get it.
All goes well... but maybe I miss a lib which is not caught by configure?
tobiaspfaff
Posts: 33
Joined: Sat Feb 08, 2014 3:50 am

Post by tobiaspfaff »

Ah! You need to checkout the mouse branch. Master is the vanilla ResidualVM branch. Sorry for not mentioning this, forgot about it.
misanthropos
Posts: 4
Joined: Sat Mar 29, 2014 3:52 pm

Post by misanthropos »

Oh man / grim_mouse led me to believe its your modified repository already. Thanks for the hint.
Ripcord
Posts: 3
Joined: Thu Mar 06, 2014 4:50 am

Post by Ripcord »

Finally got around to trying the Mac version again, and like others v0.4 fixed my crashing bugs.

This is such great work. I missed out on Grim the first time around, and my wife and I just started playing. We hadn't gotten very far, but trying this I can already tell this is like a whole different game.

Question: Anyone feel a newbie should play it through "normal" the first time? I don't want to miss out on anything, though the control system was demotivating us from continuing to play at all.

I can tolerate the tank controls, but for some reason my brain refuses to adjust to the inventory and action/examine/etc system.
User avatar
JohnnyWalker2001
Posts: 405
Joined: Mon Oct 16, 2006 1:27 pm
Location: London, UK

Post by JohnnyWalker2001 »

Ripcord wrote:Finally got around to trying the Mac version again, and like others v0.4 fixed my crashing bugs.

This is such great work. I missed out on Grim the first time around, and my wife and I just started playing. We hadn't gotten very far, but trying this I can already tell this is like a whole different game.

Question: Anyone feel a newbie should play it through "normal" the first time? I don't want to miss out on anything, though the control system was demotivating us from continuing to play at all.

I can tolerate the tank controls, but for some reason my brain refuses to adjust to the inventory and action/examine/etc system.
I don't think you're missing out on that much, if anything at all. Oddly I do think the tank controls make you feel like you're "there", but that might just be me. I'm sure it's still a great game with great music, dialogue and story with a mouse!

If you want to try tank controls, I'd suggest using a controller. I finally made the switch to using a controller for the first time in my current playthrough and, not that surprisingly I guess, it's MUCH better.

I'd recommend sticking with mouse for now, but if you do fancy trying a controller, get Pinnacle (it's free) and an XBox 360 Controller:

http://pinnaclegameprofiler.com/

Here's the Grim Fandango profile for the game (don't bother with the one on the Pinnacle website, it stinks):

https://dl.dropboxusercontent.com/u/304 ... ndango.pin
momomomo888
Posts: 7
Joined: Tue Feb 25, 2014 8:24 pm

Post by momomomo888 »

misanthropos wrote:Oh man / grim_mouse led me to believe its your modified repository already. Thanks for the hint.
Thank you both!! That is exactly what happened to me also!... It's working perfectly now :)
momomomo888
Posts: 7
Joined: Tue Feb 25, 2014 8:24 pm

Re: Mouse interface for Grim Fandango (Fan made mod)

Post by momomomo888 »

Hi!

I'm loving this mod... Thanks a lot!

I have modified it a bit, to use it along with increasing the viewport resolution... But I'm not used to GIT so I don't know if I should or how to upload any change to the code, so... those are my changes:

OPENGL.CPP

void GfxOpenGL::getBoundingBoxPos(const Mesh *model, int *x1, int *y1, int *x2, int *y2)

Code: Select all

...
            gluProject(v.x(), v.y(), v.z(), modelView, projection, viewPort, &winX, &winY, &winZ);
            
            // Added those two lines
            winX = winX/_scaleW;
            winY = winY/_scaleH;

			if (winX > right)
				right = winX;
			if (winX < left)
				left = winX;
			if (winY < top)
				top = winY;
			if (winY > bottom)
				bottom = winY;
...
bool GfxOpenGL::worldToScreen(const Math::Vector3d &vec, int& x, int &y)

Code: Select all

...
    gluProject(vec.x(), vec.y(), vec.z(), modelView, projection, viewPort, &winX, &winY, &winZ);
    
    // Added this two lines
    winX = winX/_scaleW;
    winY = winY/_scaleH;
    
    winY = _gameHeight - winY;
...
bool GfxOpenGL::raycast(int x, int y, Math::Vector3d &r0, Math::Vector3d &r1)

Code: Select all

...
    GLdouble modelView[16], projection[16], p0[3], p1[3];
    GLint viewPort[4];
    // Changed this line for the next one
    //GLdouble winX = x, winY = _gameHeight - y;
    GLdouble winX = _scaleW*x, winY = _scaleH*(_gameHeight - y);
    glGetDoublev(GL_MODELVIEW_MATRIX, modelView);
    glGetDoublev(GL_PROJECTION_MATRIX, projection);
    glGetIntegerv(GL_VIEWPORT, viewPort);
    
    gluUnProject(winX, winY, 0.0, modelView, projection, viewPort, &p0[0], &p0[1], &p0[2]);
    gluUnProject(winX, winY, 1.0, modelView, projection, viewPort, &p1[0], &p1[1], &p1[2]);
...
GRIM.CPP

Common::Error GrimEngine::run()

Code: Select all

...
	bool fullscreen = ConfMan.getBool("fullscreen");
	createRenderer();
    // Added this if, instead of calling always to setupScreen with the fixed resolution
    if (ConfMan.hasKey("gameWidth") && ConfMan.hasKey("gameHeight")) {
        g_driver->setupScreen(ConfMan.getInt("gameWidth"), ConfMan.getInt("gameHeight"), fullscreen);
    }
    else g_driver->setupScreen(640, 480, fullscreen);
    //g_driver->setupScreen(640, 480, fullscreen);
...
I should have added asking the renderer on grimm.cpp to ensure I'm using opengl, but that's it. The keys on Residualvm preferences (.ini) file could be, for example

gameWidth=1280
gameHeight=960

I tried 1920x1080... and it's great too. It's stretched, but It would be anyway at fullscreen so :)

Also... a few other changes... I changed the GL_CLAMP to GL_CLAMP_TO_EDGE and the texture filtering from GL_NEAREST to GL_LINEAR everywhere at opengl.cpp's CreateBitmap, CreateFont and PrepareMovieFrame.

Code: Select all

		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
But at last I had to revert to GL_NEAREST filtering for backgrounds ( CreateBitmap() ) as it draws some artefacts on a some locations (like the initial camera from Manny's office).
User avatar
JohnnyWalker2001
Posts: 405
Joined: Mon Oct 16, 2006 1:27 pm
Location: London, UK

Re: Mouse interface for Grim Fandango (Fan made mod)

Post by JohnnyWalker2001 »

You should create a Github account, the original author may not see this here, momo.
Post Reply