issue with tile map refresh speed
Re: issue with tile map refresh speed
In a user loop long term, this will prevent the program from hogging the CPU, and will free time for other tasks.
Re: issue with tile map refresh speed
Alternatively, sleep every 10 loops?
Ran my program on my netbook, still 115 fps.
CPU: Intel(R) Atom(TM) CPU N450 @ 1.66GHz
GPU: Integrated in CPU, VGA compatible :-)
OS: Ubuntu 14.04 (32-bit)
FreeBASIC Compiler - Version 1.00.0 (09-14-2014), built for linux-x86 (32bit)
Ran my program on my netbook, still 115 fps.
CPU: Intel(R) Atom(TM) CPU N450 @ 1.66GHz
GPU: Integrated in CPU, VGA compatible :-)
OS: Ubuntu 14.04 (32-bit)
FreeBASIC Compiler - Version 1.00.0 (09-14-2014), built for linux-x86 (32bit)
Re: issue with tile map refresh speed
Why not put the map into a single large image buffer and then put only the part of the map you need to the screen? If you want to have objects that the player can walk behind then you would need to put those images after drawing the character sprites, but that would be faster than re-drawing the whole map.
Re: issue with tile map refresh speed
I think I already tried this kind of solution, but this may produce images a little choppiness.badidea wrote:Alternatively, sleep every 10 loops?
Re: issue with tile map refresh speed
this would limit the size of the world map, and start to be very memory intensive if rotated views are also used (which I will incorporate into the prog)Merick wrote:Why not put the map into a single large image buffer and then put only the part of the map you need to the screen? If you want to have objects that the player can walk behind then you would need to put those images after drawing the character sprites, but that would be faster than re-drawing the whole map.
right now the world map is something like 2048 x 2048 which would take up a rather large chunk of memory (assuming 3 bytes per pixel for color and each tile is 16 x 16, then this would be a 3gb picture in memory! ack!)
Re: issue with tile map refresh speed
badidea,
I do not understand why your little netbook running at 1.6ghz, single core is getting 115 fps and I am getting about half that with dual core & 2.16 ghz??? I am driving a 40" external monitor and will check to see if there is any improvement just going directly to the notebook screen and disconnecting external monitor. The only other diff is ubunto vs windows.... can it really be that mush difference in OS speed?
disconnected monitor, ran prog, same speed... about 64fps.... argh! netbook can't have a better graphics chip then a notebook, right? ridiculous!
I will have to see if I can dig up my old netbook, same specs as yours, with some version of linux installed and load up Freebasic and try it out to see if it is getting faster frame rate too...
I do not understand why your little netbook running at 1.6ghz, single core is getting 115 fps and I am getting about half that with dual core & 2.16 ghz??? I am driving a 40" external monitor and will check to see if there is any improvement just going directly to the notebook screen and disconnecting external monitor. The only other diff is ubunto vs windows.... can it really be that mush difference in OS speed?
disconnected monitor, ran prog, same speed... about 64fps.... argh! netbook can't have a better graphics chip then a notebook, right? ridiculous!
I will have to see if I can dig up my old netbook, same specs as yours, with some version of linux installed and load up Freebasic and try it out to see if it is getting faster frame rate too...
Re: issue with tile map refresh speed
Shouldn't be, the correct graphics driver is often more important. Does the windows GUI itself run smooth?can it really be that mush difference in OS speed?
Can a test later on a windows system.
Edit: Just thinking, it could be that my linux is cheating and not all frames actually drawn to graphics card.
Re: issue with tile map refresh speed
Another test on my first system, under Windows XP (Windows 7 refused to boot).
CPU: Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
GPU: GeForce GTS 250
OS: Microsoft Windows XP [Version 5.1.2600]
FreeBASIC Compiler - Version 0.23.0 (08-14-2011) for win32 (target:win32)
With sleep: ~64 fps http://nr100.home.xs4all.nl/badidea/hexa_winxp.jpg
Without sleep: ~634 fps http://nr100.home.xs4all.nl/badidea/hex ... osleep.jpg
OS: Ubuntu 14.04 (64bit)
With sleep: ~260 fps http://nr100.home.xs4all.nl/badidea/hexa_sprites.jpg
Without sleep: ~649 fps http://nr100.home.xs4all.nl/badidea/hex ... osleep.jpg
CPU: Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
GPU: GeForce GTS 250
OS: Microsoft Windows XP [Version 5.1.2600]
FreeBASIC Compiler - Version 0.23.0 (08-14-2011) for win32 (target:win32)
With sleep: ~64 fps http://nr100.home.xs4all.nl/badidea/hexa_winxp.jpg
Without sleep: ~634 fps http://nr100.home.xs4all.nl/badidea/hex ... osleep.jpg
OS: Ubuntu 14.04 (64bit)
With sleep: ~260 fps http://nr100.home.xs4all.nl/badidea/hexa_sprites.jpg
Without sleep: ~649 fps http://nr100.home.xs4all.nl/badidea/hex ... osleep.jpg
Re: issue with tile map refresh speed
I got a nasty virus and had to reformat etc.. so have a fresh OS windows 10 and GUI runs smooth... also am running latest version FBbadidea wrote:Shouldn't be, the correct graphics driver is often more important. Does the windows GUI itself run smooth?can it really be that mush difference in OS speed?
am getting 168 with sleep, 270 w/o sleep, better, but not what should be showing compared to yours...
Re: issue with tile map refresh speed
weirdness, rebooted computer, now getting 290 w/o sleep and 64 with sleep - i hate how it is not consistent, something is wrong here - I guess I can continue to program and just know that it will run about 4x faster on other peoples machines... lol...
I do want you to run my Isometric Voxel Scrolling Map though, but I use PNG's for my graphics because of enhanced alpha channel transparency (instead of just on/off - magic pink - I can make all my pixels 0-255 transparent... shadows, etc...) and I don't know how to get my PNGs to upload here....
I do want you to run my Isometric Voxel Scrolling Map though, but I use PNG's for my graphics because of enhanced alpha channel transparency (instead of just on/off - magic pink - I can make all my pixels 0-255 transparent... shadows, etc...) and I don't know how to get my PNGs to upload here....
Re: issue with tile map refresh speed
Something I saw a lot of the code and pseudo-code doing on this thread: more than just drawing inside the screenlock/screenunlock block. It is best to have only the drawing happen inside that block. That alone can give a pretty good boost in speed as well as remove some flicker that can happen.
Just a bit of advice.
Just a bit of advice.
Re: issue with tile map refresh speed
I think, you can't. I upload images to another location an then link with (img)(/img), but square brackets.I don't know how to get my PNGs to upload here....
Could it be some power management that causes sometimes high, sometimes low fps?
The reason I get higher fps is most likely a faster (desktop) graphics card, although already some years old. During 3d-games that thing alone consumes 3 times as such power as an average laptop maximum (~150W). geforce-gts250