View Full Version : Racing Games
jfz83
06-18-2006, 09:16 AM
hello, i have a doubt and i hope somebody can helpme, well:
In the games racing such as, life for speed, need for speed or colin mcrae, richard burns...... etc
The speed is an variable that change with the aceleration, gear and brakes.(in real time)
But that speed we can see it in the screen, when we played.
How i can capture the variable speed to use it in my own program??(in real time)
Thanks for helpme
Reedbeta
06-18-2006, 11:19 AM
Your physics system will calculate the speed. (Actually it will calculate the velocity vector, whose magnitude is the speed). Velocity is just the integral through time of the acceleration, just as the position is the integral through time of the velocity.
It wouldn't be impiossible to get it directly from the game, since the speed is most likely stored somewhere as a vector of floats. Sometimes, of course the speed is not stored, but calculated as the difference of 2 positions. But it would still be possible...
...If you can find that position in the computer memory. (Wich is highly unlikely.)
...And you can actually acess that memory in the first place. (Wich Windows normally won't let you do.)
My best bet would be to do a live OCR of the speed meter on the screen. It would just require a webcam and some coding skills. (WinAPI for webcam, OCR for the image processing.)
May I ask why?
jfz83
06-19-2006, 07:48 AM
good idea, but where i can find information about Live OCR, or information to make that program ???
Thanks
Google (http://www.google.se/search?hl=sv&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=optical+character+recognition+tutorial&spell=1) is your friend.
vBulletin, Copyright ©2000-2010, Jelsoft Enterprises Ltd.