Page 1 of 1

speed differs with resolution

Posted: Wed Feb 22, 2006 11:02 am
by warden
hi there, i have a car moving due to user input. speed of the car is highly dependend of what resolution i use. it's faster with 800x600 than with 1024x768 or even 1280x800. i optimized all values to the latter one, but people with 4:3 displays should play the game as well. are the units of different size with irrlicht in different resolutions?

thanks
warden

Posted: Wed Feb 22, 2006 11:10 am
by Ced666
This is very dependent of how you make it run. Post the code, it will be usefull.
For example, if at every new frame you move your car by a certain distance, then it is wrong because the time between frames will vary a lot in function of the processor speed, resolution, ...
You should instead pass the time elapsed between the frames and calculate a distance based on this time and the speed you want to have (distance = speed * time).

Posted: Wed Feb 22, 2006 12:26 pm
by Quall
Alter the camera properties for your different resolution ratios (edit FOV, etc...). I believe that is what you are trying to acheive.

edit: Maybe I misread your post. The car is moving faster/slower because the fps is higher and lower depending on the resolution. People with slower computers will also have different speeds as you. To fix this, you have to base your movement on the time that has passed rather than the frames per second. Search the forum as this is asked alot.

Posted: Wed Feb 22, 2006 12:45 pm
by warden
okay thanks a lot! i first tried to do this with vectors but failed due to the many forces. i now have it simple and smoothly working on my computer. however, do you know of one or two good threads or webpages about how to deal with accleration, speed, braking and reservedriving?

thanks again
warden