Sign in to follow this  
Followers 0
TimAtchley

PixelCheckSum or PixelGetColor?

11 posts in this topic

Basically in a grid of 64x64 pixels, There will be an explosion animation anywhere every 300-1000ms.

The animation has a preset ms to repeat itself.

So I was thinking using either PixelCheckSum or a 2-dimensional array of PixelGetColor values and calculating an average of all the pixels then looking for patterns.

My concerns are I don't know exactly how many ms PixelCheckSum or a couple for loops with PixelGetColor will take so I am kind of stuck.

Any suggestions?

Tim

Share this post


Link to post
Share on other sites



Basically in a grid of 64x64 pixels, There will be an explosion animation anywhere every 300-1000ms.

The animation has a preset ms to repeat itself.

So I was thinking using either PixelCheckSum or a 2-dimensional array of PixelGetColor values and calculating an average of all the pixels then looking for patterns.

My concerns are I don't know exactly how many ms PixelCheckSum or a couple for loops with PixelGetColor will take so I am kind of stuck.

Any suggestions?

Tim

I don't know about much of that but if you can easily find out how long a routine will take like this

$tStart = TimerInit()
;code here
$Time = TimerDiff($tStart)

Welcome to the AUtoIt forums :)


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Haha thanks for the warm welcome :).

So if I wanted to use

$tStart = TimerInit()
;code here
$Time = TimerDiff($tStart)

Would I be able to use PixelCheckSum to save time from writing a ridiculously long algorithm with PixelGetColor?

And if I do use PixelGetColor in the manner of:

For $i = 0 To 63
     For $z = 0 To 63
          $somearray[$i][$z] = PixelGetColor(.....
     Next
Next

and what it scans is an animation would I get a picture of the explosion or a blurry mesh of the animation because it grabs pixel by pixel in a for loop?

Thanks again,

(if that doesn't make sense I'll explain more)

Tim

Share this post


Link to post
Share on other sites

bump?

Share this post


Link to post
Share on other sites

Haha thanks for the warm welcome :).

So if I wanted to use

$tStart = TimerInit()
;code here
$Time = TimerDiff($tStart)

Would I be able to use PixelCheckSum to save time from writing a ridiculously long algorithm with PixelGetColor?

And if I do use PixelGetColor in the manner of:

For $i = 0 To 63
     For $z = 0 To 63
          $somearray[$i][$z] = PixelGetColor(.....
     Next
Next

and what it scans is an animation would I get a picture of the explosion or a blurry mesh of the animation because it grabs pixel by pixel in a for loop?

Thanks again,

(if that doesn't make sense I'll explain more)

Tim

You won't get a picture or animation. It will just tell you if something has changed on the screen.

Return Value

Returns the checksum value of the region.

Share this post


Link to post
Share on other sites

You won't get a picture or animation. It will just tell you if something has changed on the screen.

Return Value

Returns the checksum value of the region.

I wasn't talking about the checksum right there. I was talking about PixelGetColor. & the checksum just appear to be some randon int anyways? Whats the int = if its changing vs it being static?

Tim

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

The returned integer is the checksum. If it is statics, it will return the same integer. What exactly are you trying to do?

Edited by qazwsx

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

The returned integer is the checksum. If it is statics, it will return the same integer. What exactly are you trying to do?

What am I exactly trying to do? Write a bot that solves a puzzle to a beat pretty much. Its for a Used Map Settings game in Starcraft called "bounding." Basically people make puzzles that you run a unit through and I was my program to be able to scan each obstacle and figure out where the open spots are then click where it needs to with perfect timings. -- Don't worry about trying to help me with the actual puzzle solving.

I need the program to basically sync with each obstacles timings #1, and #2 be able to determine which square is open at which time so I can make an algorithm to calculate where to go after each beat in the puzzle.

Does that make sense? lol

Here is an example -> http://www.youtube.com/watch?v=J92tYRVXMZk

Tim

Edited by TimAtchley

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Why not check the colors of the pixels every .1 seconds for say 20 seconds and save the states. You could use this information to find out when each square is open.

Edit: Good luck with this; it will be difficult to get the proper timing.

Edited by qazwsx

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Why not check the colors of the pixels every .1 seconds for say 20 seconds and save the states. You could use this information to find out when each square is open.

Edit: Good luck with this; it will be difficult to get the proper timing.

Each obstacle repeats itself after x amount of seconds. Usually anywhere from 3-10 seconds. I was thinking that I could basically "record" the obstacle for every 64x64 square that has explosions and determine the start and end of each loop by checking for patterns. I'm not too worried about accomplishing determining all the parts you guys would see as difficult but more how I will retrieve the data via autoit.

Here is what it looks like so far: http://i39.tinypic.com/344wrjq.jpg

The grid lines up with the game's grid so testing for the edge of each box nicely for determining which boxes have explosions vs not.

Any one else? I know this is possible.

Tim

Edited by TimAtchley

Share this post


Link to post
Share on other sites

I don't know if this would put me over my work load, but I found this: http://www.stormcoast-fortress.net/cntt/software/DatEdit/

I may be able to extract each explosion sprite and compare using that?

I need to do a lot more reading if I want to do this but enlighten me if this will work please.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0