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 


[AutoIT] Monster Detection

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
407
Master Cheater
Reputation: 0

Joined: 25 Oct 2007
Posts: 357

PostPosted: Tue May 24, 2011 3:28 am    Post subject: [AutoIT] Monster Detection Reply with quote

Ok, I'm making a bot and I'm wondering which method would be better for monster targeting detection. (Or if someone could suggest an easier and better method).

I was thinking, I could use color/pixel recognition, and loop around/run around the map until the color is found, but that would be really buggy at map changes. My second method was to just use timers and calculate total MP usage and cooldown, and have an auto-pot type thing. Another method would be (The monster's image is displayed around a colored box on top of the screen) to detect the monster's image on the top of the screen and use that as a basis as to keep attacking or to move on.

Some other notes that may be helpful:
-Tab targets the closest monster
-A sound is played when you target a monster
-I have/can obtain the monster's pointer address
-Monster's names are color coded by aggression.
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Tue May 24, 2011 11:55 am    Post subject: Reply with quote

I can't give too much input, but i'll give you some food for thought to steer you away from pixel detection. Number one, it's slow, very slow. It wouldn't be feasible to be running in real time and constantly doing monster detection via pixels.

Also, many times pixels / groups of pixels will have no determinable boundary algorithmically. The images just appear to have boundaries because of the human eye and brain, but algorithms are not at that level yet.

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue May 24, 2011 3:12 pm    Post subject: Reply with quote

Reading pixels should be easy real time. If you have access to the renderer you can just directly read the backbuffer, otherwise you can just blit it yourself. Shouldn't be slow at all.

But what's wrong with just finding the monster / entity array and just pulling info from that?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Tue May 24, 2011 4:09 pm    Post subject: Reply with quote

slovach wrote:
Reading pixels should be easy real time. If you have access to the renderer you can just directly read the backbuffer, otherwise you can just blit it yourself. Shouldn't be slow at all.

But what's wrong with just finding the monster / entity array and just pulling info from that?


Given that he'd be reading from the back buffer, he would have to keep locking / unlocking it which is extremely slow and discouraged against.

If you need to detect mobs around you, you are better of reading from memory as pixels are not going to be in the same spot for moving objects. If you were detecting something such as your health that would be a bit easier on the pixel scanning. But scanning the full surface will be slow especially if you are spamming it every frame.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue May 24, 2011 4:49 pm    Post subject: Reply with quote

It's expensive and you cause a stall but I don't think it should be particularly horrible in a lightweight game. I've tried accessing it before in a toy project and don't remember particularly devastating results.

I figured that there was a way to do asynchronous copies and apparently the answer in DX9 is GetRenderTargetData() so that should be better! Don't know what the DX10+ equivalent is and in OGL I guess Framebuffer Objects are the way to go.
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 programming 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