Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Direction player is facing.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
HolyForce
How do I cheat?
Reputation: 0

Joined: 02 Dec 2012
Posts: 5

PostPosted: Sun Dec 02, 2012 5:05 am    Post subject: Direction player is facing. Reply with quote

Would anyone advise me with mathematics/tips on how player direction is usually implemented?

I'm doing various single player game "hacking" to practice some ASM and C++.

I am easily able to find X, Y and Z coordinates to teleport around the map. However, the direction one is facing is difficult. Often times I believe I find values related to it (because freezing them causes me to twitch), but I can never settle on some form of logic of how it works.

Any tips are appreciated. Thanks.
Back to top
View user's profile Send private message AIM Address
Dark Byte
Site Admin
Reputation: 474

Joined: 09 May 2003
Posts: 25956
Location: The netherlands

PostPosted: Sun Dec 02, 2012 5:33 am    Post subject: Reply with quote

Usually it's 2 or 3 variables
Horizontal axis (left<-->right)
Vertical axis (top<-->bottom)
And in some games the tilt

As for the logic it depends on the game engine.
Unreal for example stores the horizontal axis as a 2 byte value ranging from 0 to 65535, where 65536 is a full rotation

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
HolyForce
How do I cheat?
Reputation: 0

Joined: 02 Dec 2012
Posts: 5

PostPosted: Sun Dec 02, 2012 6:34 am    Post subject: Reply with quote

Dark Byte wrote:
Usually it's 2 or 3 variables
Horizontal axis (left<-->right)
Vertical axis (top<-->bottom)
And in some games the tilt

As for the logic it depends on the game engine.
Unreal for example stores the horizontal axis as a 2 byte value ranging from 0 to 65535, where 65536 is a full rotation


Thanks, Dark Byte.
Back to top
View user's profile Send private message AIM Address
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Dec 02, 2012 2:41 pm    Post subject: Reply with quote

Another method I've seen in some 3D style games is storing the 'heading' value in a float as a radian.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun Dec 02, 2012 4:54 pm    Post subject: Reply with quote

In XRayEngine games (S.T.A.L.K.E.R. ) there are radians too.

Up-Down angle is between 1.5 and -1.5
1.5 when looking down (85.94°)
0.0 when centered (0°)
-1.5 when looking up in the sky (-85.94°)

Left-Right angle - in 3D games, mostly, this is stored as radian, between -π and π. When you rotate ( counterclockwise ) it increases, from 0 up to π. After π is reached, it changes to -π. If you still rotate (counterclockwise) it increases from -π up to 0. (counterclockwise rotate - value is increasing)

XRayEngine Left-Right angle is radian too, But not closed in (-π,π) range. And value is increasing while clockwise rotate. So, you can see left-right angle for example as 30.0 radians (1718.87°). After quick-saving and quick-loading, it becomes -1.41 radians (-81.13°).
(1718.87° = 4*360° + 278,87° = 278,87°
278,87° - 360° = -81.13°)

_________________
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites