JHGuitarFreak / UQM-MegaMod

A fork of The Ur-Quan Masters + HD-mod that remasters the HD graphics with a veritable smorgasbord of extra features, options, QoL improvements, and much more...
https://uqm-mods.sourceforge.net
GNU General Public License v2.0
76 stars 22 forks source link

Tweak for slow machines: Slower planet rotation. #86

Open clort81 opened 2 years ago

clort81 commented 2 years ago

I found that slowing planet/moon rotation, while aesthetically more pleasing, also drops cpu use.

With 3DO FPS (35) and HD on, the current 2021-10-27 git master shows > 95% cpu use: cpu_fastrotate

in planets.h setting:

define PLANET_ROTATION_RATE (ONE_SECOND * 60 / RES_SCALE (PC_MAP_WIDTH))

results in ~20% cpu use (and looks majestic and aesthetic) cpu_slowrotate

This is quite different than either pc or 3do rotation speed, but I share it in case anyone has trouble with old/slow computer, or would prefer a stately planet rotation.

arrowgent commented 2 years ago

useful. but also taking note that 100% cpu usage means one core, if you have 8 or 16 cores etc, thats not a lot of cpu used, only one pthread (eg 800% is full cpu used on 8 cores) might be good information for a raspberry pi or something, or seriously old like pentium4/amd athlon something without multiple cores.

though i would agree with balancing cpu usage with something arbitrary like spinning planets 35fps seems reasonable for an object like this

arrowgent commented 2 years ago

i also enabled GL OSD to see the fps i reported 41fps watching planets rotate 80-95% pthread cpu usage -- reported by htop & nvtop

some of the transitions reported up to 180fps briefly example: transistion from solar view to hyperspace view.

i set a GL frame limit of 30fps for the whole game and everything seemed to run fine

Kruzen commented 1 year ago

@clort81 @arrowgent Hello. As for current version 0.8.2 we have 3 styles for these planets and all 3 have different framerate (DOS being the slowest and 3DO being the fastest). I'm planning to redo/optimize this code for next release, but still, do you have any data on performance of older machines for current version? I would like to know the boundaries