| View previous topic :: View next topic |
| Author |
Message |
407 Master Cheater
Reputation: 0
Joined: 25 Oct 2007 Posts: 357
|
Posted: Tue May 24, 2011 3:28 am Post subject: [AutoIT] Monster Detection |
|
|
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 |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Tue May 24, 2011 11:55 am Post subject: |
|
|
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 |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue May 24, 2011 3:12 pm Post subject: |
|
|
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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue May 24, 2011 4:09 pm Post subject: |
|
|
| 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 |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue May 24, 2011 4:49 pm Post subject: |
|
|
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 |
|
 |
|