Performance decrease with DX 9

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hello,

    I always used MMF with "standard" display mode. Now I wanted to switch to DX9, cause I want to use shaders. But a few users complains about performance and increase of CPU (before 10% now 20 - 25%). Game use large frame - 17600 * 13200 and about 30k backdrop objects.

    Is there some way how to improve performance?

    Maybe it wouldn't matter much, but users getting "laggy" not sure if thats because DX9 or that CPU performance.

    Edited once, last by kubas05 (February 22, 2018 at 5:53 PM).

  • I assume you use some kind of procedural generation for your levels as you won’t place 30K backdrops manually, right? I really don’t know exactly but I think pasting backgrounds in standard mode leads to one big pre-baked texture while in HWA modes each pasted tile is handeled and tracked separately by the CPU. This would explain the much higher CPU strain in your specific setup. In my experience handling over 10 to 15k backdrops at once in HWA will cause trouble on many machines. Maybe you can reduce the count somehow or load tiles dynamically when actually on screen. Most people have quad core CPUs and as Fusion puts all load on just one core (which most engines do) having a CPU usage of 25% means your game likely already hits the CPU bottleneck of the users machine.

    Please login to see this link.
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

    Edited 2 times, last by Julian82 (February 23, 2018 at 9:57 AM).

  • I assume you use some kind of procedural generation for your levels as you won’t place 30K backdrops manually, right? I really don’t know exactly but I think pasting backgrounds in standard mode leads to one big pre-baked texture while in HWA modes each pasted tile is handeled and tracked separately by the CPU. This would explain the much higher CPU strain in your specific setup. In my experience handling over 10 to 15k backdrops at once in HWA will cause trouble on many machines. Maybe you can reduce the count somehow or load tiles dynamically when actually on screen. Most people have quad core CPUs and as Fusion puts all load on just one core (which most engines do) having a CPU usage of 25% means your game likely already hits the CPU bottleneck of the users machine.

    Here's a dumb question, does making things invisible give a performance boost or is there no difference?

    Please login to see this link.
    Please login to see this link.|Please login to see this link.|Please login to see this link.

  • [MENTION=21402]zip2kx[/MENTION]: I think that's not a dumb question at all and the answer depends on what you do with those invisible objects/ or layers. [MENTION=5451]nivram[/MENTION] is right with the memory state, so if you don't have a pixel shader on a layer/objects making them invisible brings nearly zero (I just tested this). However, objects and layers that are invisible are not put into accout for the renderer and are, of course, skipped for pixel shaders, so in this case making things on screen invisible is a thing. If an object is outside the visible frame window tho you don't have to care about the visibility state at all, as those are not put into account for the display output anyway.

    Please login to see this link.
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • well, if it is my problem, i could try following steps:
    1. create all objects in a frame.
    2. write all object necessary data into array (name, x, y, layer)
    3. destroy all objects.
    4. and via fastloops and eachloops create or destroy "chunks" of objects (dynamic loading)

    Please login to see this link.

  • well, if it is my problem, i could try following steps:
    1. create all objects in a frame.
    2. write all object necessary data into array (name, x, y, layer)
    3. destroy all objects.
    4. and via fastloops and eachloops create or destroy "chunks" of objects (dynamic loading)

    That's a good outline of how to do dynamic tile loading! Keep in mind tho that looping through a huge array every frame tick and accessing its data may cause a problem even bigger than the CPU issue outlined by [MENTION=16467]kubas05[/MENTION]. The worst performance bottleneck of most systems is actually not CPU power or RAM limits, it is loading and writing data. I had implemented dynamic tile loading in a very early stage of my project in the hope to get a massive performance boost this way. What happened was the opposite: the huge amount of data accesses per frame tick and loading loops drained the FR even more than having everything handled by the CPU at once. I think it is worth a try tho if you work with REALLY huge scrolling areas or massive tile counts.

    Please login to see this link.
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • I assume you use some kind of procedural generation for your levels as you won’t place 30K backdrops manually, right? I really don’t know exactly but I think pasting backgrounds in standard mode leads to one big pre-baked texture while in HWA modes each pasted tile is handeled and tracked separately by the CPU. This would explain the much higher CPU strain in your specific setup. In my experience handling over 10 to 15k backdrops at once in HWA will cause trouble on many machines. Maybe you can reduce the count somehow or load tiles dynamically when actually on screen. Most people have quad core CPUs and as Fusion puts all load on just one core (which most engines do) having a CPU usage of 25% means your game likely already hits the CPU bottleneck of the users machine.

    I placed them manually. Does size of backdrops matter? Like, is it better use 8x 64*64 backdrops or one 512*512 backdrop?

    So tester had 10% cpu without HWA, about 18% with HWA without shaders, and about 23% with HWA and shaders.
    It wouldnt much matter. But it slow (lag) his "walking"

    Just for info, it is online game which use mooclick if it isnt problem?

    Will try delete all backdrops, just to see how it will work after that

  • In your setup you need to reduce the backdrop count, so 512*512 will be better. No idea about online functionality.

    Please login to see this link.
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • @Please login to see this link.: I think that's not a dumb question at all and the answer depends on what you do with those invisible objects/ or layers. @Please login to see this link. is right with the memory state, so if you don't have a pixel shader on a layer/objects making them invisible brings nearly zero (I just tested this). However, objects and layers that are invisible are not put into accout for the renderer and are, of course, skipped for pixel shaders, so in this case making things on screen invisible is a thing. If an object is outside the visible frame window tho you don't have to care about the visibility state at all, as those are not put into account for the display output anyway.

    afaik -vania games have a huge maps, and it runs on gba, ps, ds without lags so.

    Please login to see this link.

  • afaik -vania games have a huge maps, and it runs on gba, ps, ds without lags so.

    They are built on rooms though, you enter the doors and they build the new room.

    I've always wondered how the best way to do a big open map/frame in fusion is. But I suppose if your active objects get inactive if they are out of frame it should free enough memory and cpu?

    Please login to see this link.
    Please login to see this link.|Please login to see this link.|Please login to see this link.

  • They are built on rooms though, you enter the doors and they build the new room.

    I've always wondered how the best way to do a big open map/frame in fusion is. But I suppose if your active objects get inactive if they are out of frame it should free enough memory and cpu?

    i believe so, especially is you have X17600 * Y13200 and about 30k backdrop objects (and this is without counting active objects ( wich must have behiavours )
    also i've realized something similiar prototypes and i think, loading chunks of levels once per request possible in Clickteam Fusion.

    Please login to see this link.
    Please login to see this link.
    Please login to see this link.

    Please login to see this link.

  • That seems like a great example of dynamic loading by Kisguri.

    [MENTION=12521]Julian82[/MENTION]: does this example differ from your approach? I am curious if there is a “better” way to handle large levels.

    Please login to see this link.

  • [MENTION=7170]mobichan[/MENTION]: I think if you want a real open area you have to employ dynamic array loading. My efforts in this topic were pretty basic and in the end I cut everything into rooms. I think the array method is very complex to handle for games with sophisticated tile sets and multiple layers. Another thing important would probably be to scope the data accesses very well, and maybe work with multiple smaller arrays instead of one giant.

    Please login to see this link.
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • @Please login to see this link.: I think if you want a real open area you have to employ dynamic array loading. My efforts in this topic were pretty basic and in the end I cut everything into rooms. I think the array method is very complex to handle for games with sophisticated tile sets and multiple layers. Another thing important would probably be to scope the data accesses very well, and maybe work with multiple smaller arrays instead of one giant.

    yep, for advice: you can calculate player xy position and convert it into cell xy. ( you can find example xable fusion site, i believe it's calling zelda or block scrolling) and load array file (for example, room_x_y.arr) relative to player x,y coordinates.
    damn, it's very interesting concept, i hope, someday i realize it.

    Please login to see this link.

  • You have to take into account backdrops are handled differently in dx9, they have the same performance drop as active objects, I found that around 1000 objects on screen will drop perfomance quite a lot, even if they are backdrops. In standard backdrops are great for perfomance, in dx9 they are mostly useless, with almost no difference to active objects.

    Edit: Also in Dx9 backdrops count towards the object count, it is not displayed in the counter.

    My signature is the awesomest!

    Edited 2 times, last by Skyhunter (March 3, 2019 at 4:00 PM).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!