Game has odd mouse coord setup

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
Forum rules
This is a sub-forum for things specific to MicroMacro.

This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Post Reply
Message
Author
Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

Game has odd mouse coord setup

#1 Post by Exempt » Tue Jan 26, 2010 12:31 pm

I was playing around with a simple rpg, trying to learn macromicro a bit better. I'm working with a game called fff. The game has a really odd coord systems cause if i move the mouse just 1 pixel or will jump all the way across the screen. Anyone have any ideas on a way to get around this, the game requires mouse movement.

I thought about it for a bit and I'm going to try and change the memory addresses that hold the mouse coords manually. After a while of tinkering i've found both x and y coord for my mouse (Even better they don't change after the game is restarted :)) They have huge numbers like 1133767554, I guess thats why it was all wierd with the normal mouse movement functions... I'll probably be back for more questions soon enough.
Last edited by Exempt on Tue Nov 16, 2010 8:29 pm, edited 1 time in total.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Game has odd mouse coord setup

#2 Post by Administrator » Tue Jan 26, 2010 4:46 pm

How were you moving the mouse? mouseSet() or mouseMove()? Is the game fullscreen, or windowed?

The coordinates might be stored as floats instead of ints. That would account for the 'strange' positions you are describing. In this way, mouse positions are between 0.0 and 65535.0; (0,0) being the top-left corner of the drawable area, and (65535,65535) being the bottom right.

Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

Re: Game has odd mouse coord setup

#3 Post by Exempt » Tue Jan 26, 2010 6:27 pm

I used both mouse movement methods both wihthe same affect. I memory addresses i found for mouse coords using Cheat Engine go from 0 to 1.1 billion. I did use 4byte to look them up though, I will try a float. Oh, and the game is full screen. When i try to make it window it turn into about a 1inch by 1 inch box in the top left corner of my screen.

I checked around at different types and stuff for the mouse coords but there is only one that will make it move and thats the one that goes 0-1.1billion.

I can get my mouse to move and stuff using this memory adresses i have but i'm not really sure of a good method to coordinate the mouse coords and the actual player coords in the games.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Game has odd mouse coord setup

#4 Post by Administrator » Tue Jan 26, 2010 8:21 pm

When using mouse input in attached mode, you probably will not see the mouse move at all. The mouse positioning functions will, in attached mode, store the coordinates for the virtual mouse. Once a click is supposed to happen, it will send the virtual mouse coordinates of the click to the game client, but will not ever move the 'physical' mouse cursor.

However, in this particular game, it does seem that attached mouse input doesn't work very well. Partly because it seems the developer wrote his own (goofy) mouse code. The hardware mouse cursor in this game remains in the center of the screen while a sprite mouse cursor displays what represents where the mouse should be. This is not unusual to game programming, but is more typical of a first person shooter, not an RPG. Due to the way he made this, it's probably best to do as you are doing now with writing to the memory to position the "mouse".

Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

Re: Game has odd mouse coord setup

#5 Post by Exempt » Wed Jan 27, 2010 9:33 am

Hm, thanks for the info.

Now i just need to figure out how to caLculate the mouse screen coords to reflect the in game coords so i can walk to a ingame position. Any ideas on this?

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Game has odd mouse coord setup

#6 Post by Administrator » Wed Jan 27, 2010 4:13 pm

Again, they should be stored as floats. If it's not 0->800,0->600 (for 800x600 resolution, obviously), then it's 0->65535,0->65535. In the second case, just use the forumla x = (desiredX/800*65535) y = (desiredY/600*65535) where desiredX and desiredY are 'screen' coordinates (between 0 and 800 for x, 0 and 600 for y).

Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

Re: Game has odd mouse coord setup

#7 Post by Exempt » Wed Jan 27, 2010 7:18 pm

I scanned over and over for the mouse coords as a float. There is nothing there that will adjust the mouse coords. I'm going to look again though.

The mouse coords i found that will move the mouse by canging the memory addresses go from...

x: 0, 1145552896
y: 0, 1142276096

Edit: That forumal isn't exactly what i'm after though. hm.. Ok, say your character is in the game world stand at (Player position coords in the game) x:1000, y:1000 i want to move to x:1010, y:1010, I need to mouse my mouse using the screen coords to te tile ingame that is x:1010, y:1010.

Edit again: After a while of getting less stupid with cheat engine I relized that x goes from 0-799 and y is 0-599... I found the float values now. This will helpa ton, thanks alot for the help:) Now if i can just figure out the right formula to turn screen coords into game coords!~

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Game has odd mouse coord setup

#8 Post by Administrator » Wed Jan 27, 2010 9:00 pm

What are the addresses you found?

Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

Re: Game has odd mouse coord setup

#9 Post by Exempt » Wed Jan 27, 2010 9:43 pm

Both are floats
800x600 screen res
mouseX: 027C5B6C Value: 0-799
mouseY: 02484014 Value: 0-599

Also, I think i have my formula. :D

MaxMouseX / MaxIngameX * (CurrentXPosition - DestinationXPostion) + (MaxMouseX / 2)

For me that is:

800 / 12 * (2730 - 2726) + 400

Seems to be right when i use a calculator. I do think it will work well ingame to. :)

Edt: I have it working now, seems to be working good..

No position checks or anything yet but it goes to where i tell it to. :)

Code: Select all

function moveTo(mtX, mtY)
		curX = memoryReadInt(myProc, 0x02C84944); --My current X position
		curY = memoryReadInt(myProc, 0x0157C78C); --My current Y position
		x = (800 / 12 * (mtX - curX) + 400);
		y = (600 / 10 * (mtY - curY) + 300);
		printf("x: %d \n", x);
		printf("y: %d \n", y);
		memoryWriteFloat(myProc, mouseX, x);
		memoryWriteFloat(myProc, mouseY, y);
		mouseLClick();
		yrest(1000);
	end

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests