How C2 Draw Calls counts For TileMaps Instances

0 favourites
From the Asset Store
Medeival & Viking War Horns Sounds / 22 Unique Calls / 2:40 minutes of audio
  • Hi Everyone

    If I have for example 4 Instances of the same TileMap and all display tile Frame ID=0 does it count as four Draw Calls or it just 1 Draw Call as if it was using one TileMap without Instances?

  • Does anyone have any Idea?

  • I think all instances share the same texture, so I would assume it's just one call.

  • IIRC Construct doesn't show you the number of draw calls anywhere - just the time taken for all draw calls. So what exactly does the answer affect?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • IIRC Construct doesn't show you the number of draw calls anywhere - just the time taken for all draw calls. So what exactly does the answer affect?

    Hi Ashley, So basically I need to do an assessment to make a choice

    I'm in between of a dilemma for my current Project I don't know which way to go to make the most efficient for Performance purposes

    I have two options :

    1-EachTileMap have many Instances, and can be from 2 to 4 different TileMaps depends on the Level and different other Things, so you can multiply the Numbers of the different TileMaps by their Instances.

    So

    Example:

    TileMap1 x Many Instances

    TileMap2 x Many Instances

    TileMap3 x Many Instances

    TileMap4 x Many Instances

    So if a TileMap and Their instances displaying the same Tile ID doesn't count as one can be quite Impact on Performance

    2-The second Option was if the Option1 is not Efficient because of the Draw Calls try something else that involves loading TileMaps from URL etc... but I'm still Experimenting with URL thing so I'm not really sure if this will be better as has one problem that it takes a few seconds to load the TileMaps

    The explanation its very lite just to make it simple

    What do you think it could be the Best Option?

    Axely I opened a thread a few days ago about this but nobody replayed yet

    https://www.construct.net/en/forum/construct-2/general-discussion-17/tilemap-load-from-url-locally-140747

  • Thanks newt

  • Answer your own performance questions with measurements

    If you're concerned about tilemap performance, by far the biggest factor is the fact the C3 runtime has an incredibly faster tilemap rendering approach. It's something like 40x faster.

  • Answer your own performance questions with measurements

    If you're concerned about tilemap performance, by far the biggest factor is the fact the C3 runtime has an incredibly faster tilemap rendering approach. It's something like 40x faster.

    Thanks for the Info but if you could just Answer the original question I could do the everything else by myself the problem is this missing information which will make the things much easier and quicker to asses

    If I have for example 4 Instances of the same TileMap and all display tile Frame ID=0 does it count as four Draw Calls or it just 1 Draw Call as if it was using one TileMap without Instances?

  • The question can't really be answered because the term "draw call" is very vague. Drawing involves calls through multiple layers of the rendering stack, which could mean any of:

    • Number of calls to the SDK Draw() method
    • Number of calls to the internal WebGLRenderer
    • Number of batch jobs executed in the WebGLRenderer
    • Number of actual WebGL calls made

    The numbers will be completely different for all four cases. Additionally, at some levels a draw call is extremely cheap (e.g. a redundant call to WebGLRenderer), and others are comparatively expensive (e.g. an actual WebGL call), so "100 draw calls" can involve either almost no work at all, or a relatively large amount of work. So it's not really a useful thing to talk about.

    That's why Construct only measures the time spent on all draw calls. It measures all of the above - the entire CPU time spent issuing draw calls.

  • Ashley

    Ok ok you could just have written that on your first Comment lol :) for one moment I was thinking what's going on on this thread did I touch some obscure topic that you don't wanna talk about it and the thread is gonna end up in who knows.

    I'm not a programmer so I thought the answer will as easier as this amounts of calls or that amount, I understand now it's more complicated to answer not a problem sir.

    Just a quick note:

    A didn't have any problems yet I was just trying to learn the best approaches to make things depends on the situation and also good to know for future projects so you know what to do in each situation.

    Thanks for your Explanation and for your Time

  • Ashley

    Sorry to tag you again but I'm still confused as for when I first asked the question.

    I didn't get any info that Helped me to clear up my doubts and you are the only one can answer this question.

    Let me change the Question:

    Does the Draw Calls increase for each Instance of a TileMap Created displaying the same Tile ID?

    With a Simple Yes or Not will be enough to finally know the answer to my original question

    Thank you

  • Yes in c2, at least usually.

    They both have the same texture so they’d both be in the same batch I’d imagine. A batch is just a list of quads sent to the gpu in one go and told to draw.

  • Well, thats exactly the kind of thing you should be able to make your own performance measurements of... but for what it's worth, Construct does drawing work for every individual tile, so the total drawing work will always be proportional to the number of tiles. However I think in the C2 runtime, if the tile texture is the same it doesn't need to switch the texture, which is faster. (In the C3 runtime it can render the entire tilemap without switching texture at all, even if every tile is different, hence the large performance improvement.) But either way it's doing drawing work per-tile; in the C2 runtime the amount of work per tile depends on the tile.

    The technologies involved are super complex - few deeply technical questions come down to a simple "yes/no" answer. You shouldn't expect things to be so straightforward, and you shouldn't get upset if you can't reduce complicated topics to such a simple answer.

  • Well, thats exactly the kind of thing you should be able to make your own performance measurements of... but for what it's worth, Construct does drawing work for every individual tile, so the total drawing work will always be proportional to the number of tiles. However I think in the C2 runtime, if the tile texture is the same it doesn't need to switch the texture, which is faster. (In the C3 runtime it can render the entire tilemap without switching texture at all, even if every tile is different, hence the large performance improvement.) But either way it's doing drawing work per-tile; in the C2 runtime the amount of work per tile depends on the tile.

    Awesome thanks a lot for all the Extra details really appreciated, I'm looking forward to Subscribing to c3 again I just have one problem to solve with MoveTo Plugin is not available yet.

    The technologies involved are super complex - few deeply technical questions come down to a simple "yes/no" answer. You shouldn't expect things to be so straightforward, and you shouldn't get upset if you can't reduce complicated topics to such a simple answer.

    Ashley, I wasn't upset lol, You missed my point about (Yes or No) it was in good faith :) Basically, I felt that you don't wanna talk about this topic for some X reason it can be because its complicate like you said etc... And I know you must be very busy with all the Staf that you have to do so I didn't want to take any of your Time that's why I said it will be enough for me just with a (Yes/no) obviously for me the more you explain the better because I will understand it a lot better feel free anyone if wants to go in more detail its much appreciated honestly.

    The one thing that it's a bit frustrating and that I just can understand Why you keep saying

    > "you should be able to make your own performance measurements of"

    Because just by the outcome of the answer if it was (yes or not) I shouldn't need to do any performance measurements, I feel like I'm missing something? or maybe that I didn't explain properly

    Just to make sure I explained Properly:

    Both Tests are displaying Tile ID = 9

    Both Tests Have 20 Tiles

    The only difference is that Test1 is just one object and Test2 is split into 5 Instances

    So basically is exactly the same thing

    Is Test2 gone take more performance just by the fact that is split into 5 instances even that both Tests is basically the exact same thing, just one is in one full Tilemap object and the Test2 its split into 5 Instances

    Test1

    Test2

  • Yes in c2, at least usually.

    They both have the same texture so they’d both be in the same batch I’d imagine. A batch is just a list of quads sent to the gpu in one go and told to draw.

    Thank you R0J0hound, with yes you mean on the Test2 will take more Performance than Test1 just because is split into Instances right? I just posted a few Pictures to make sure I explained properly if you don't mind have a look, thanks for your help

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)