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 


Efficiently scanning memory, optimizations?

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

Joined: 16 Feb 2011
Posts: 2

PostPosted: Wed Feb 16, 2011 7:09 pm    Post subject: Efficiently scanning memory, optimizations? Reply with quote

Here's my problem: the game in question contains an array of structures, each containing a string and a pointer among other things. I need to search through this array in my program to find the right structure. Each structure is 32 bytes and there's a few thousand of them in the array. The one structure I'm looking for is at an arbitrary location and can only be identified by the string. I need to find my structure as quickly as possible.

Is using ReadProcessMemory repeatedly on 32 byte chunks slower than reading larger chunks to a big buffer and checking that? What I really want to know is how fast ReadProcessMemory is, and if copying memory over to my own program and working with that will be faster than accessing it in another process.

What are your experiences with this?


------------------

Another part of my program will be to extract the game's level geometry. Should I just extract the BSP tree in its entirety or is ReadProcessMemory fast enough to read thousands of scene polygons without keeping them in a buffer?

Any suggestions you have in optimizing my approach would be helpful. I'm looking to see if the line segment between two players is unobstructed. My approach will be to find the node of the BSP tree that encompasses but does not divide the line segment. At this point, every leaf under this node will contain polygons that possibly intersect my segment, meaning each will be checked. I'm trying to keep the overhead of my program down.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Feb 17, 2011 1:09 pm    Post subject: Reply with quote

reading a larger chunk of memory is more efficient as there will be less taskswitching involved

as for what you want to do it might be easier to use code injection into the game itself and make use of internal functions like isInLineOfsight(xxx) (you'll have to find those out yourself)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

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

Joined: 16 Feb 2011
Posts: 2

PostPosted: Thu Feb 17, 2011 7:13 pm    Post subject: Reply with quote

Thanks for the info. I'd do as you suggested with the isInLineOfSight() if I wasn't planning on using the BSP for other purposes too. I probably should have mentioned that.
Back to top
View user's profile Send private message
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