TimAtchley Posted May 9, 2009 Share Posted May 9, 2009 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 Link to comment Share on other sites More sharing options...
martin Posted May 9, 2009 Share Posted May 9, 2009 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? TimI 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. Link to comment Share on other sites More sharing options...
TimAtchley Posted May 9, 2009 Author Share Posted May 9, 2009 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 Link to comment Share on other sites More sharing options...
TimAtchley Posted May 10, 2009 Author Share Posted May 10, 2009 bump? Link to comment Share on other sites More sharing options...
Qousio Posted May 10, 2009 Share Posted May 10, 2009 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. Link to comment Share on other sites More sharing options...
TimAtchley Posted May 11, 2009 Author Share Posted May 11, 2009 You won't get a picture or animation. It will just tell you if something has changed on the screen.Return ValueReturns 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 Link to comment Share on other sites More sharing options...
qazwsx Posted May 11, 2009 Share Posted May 11, 2009 (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 May 11, 2009 by qazwsx Link to comment Share on other sites More sharing options...
TimAtchley Posted May 11, 2009 Author Share Posted May 11, 2009 (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? lolHere is an example -> http://www.youtube.com/watch?v=J92tYRVXMZkTim Edited May 11, 2009 by TimAtchley Link to comment Share on other sites More sharing options...
qazwsx Posted May 11, 2009 Share Posted May 11, 2009 (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 May 11, 2009 by qazwsx Link to comment Share on other sites More sharing options...
TimAtchley Posted May 12, 2009 Author Share Posted May 12, 2009 (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.jpgThe 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 May 12, 2009 by TimAtchley Link to comment Share on other sites More sharing options...
TimAtchley Posted May 12, 2009 Author Share Posted May 12, 2009 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now