Tsardall's Forum Posts

  • It lags all the time and i think its only checking around the sprites having the “france” variable.

    So the issue really is the massive amount of sprite? Setting them to be non-visible outside the screen doesn’t change anything (it takes even more CPU) and changing the sprites for SVG image doesnt fix anything about lag.

    Also I can’t really reduce the amount of sprite because together they form the a map that change colour depending on the variable and each hold information so a tile map wont work since its only 1 object.

    Doesn’t it mean that a project like this one can t be done efficiently in Construct3?

  • Its only an event to activate what's below when the button is clicked.

    It's in a group. But i think the lag is caused because I have too much objectes (40'000 sprites)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The line of sight can see up to 8 pixel, so by checking if there's any sprite in its reach I can also insure that they are all within 8 pixel. Thats how I calculate the distance.

  • They are all the same sprite (but copied over) and they already change colour and variable when owned by any country via the eventsheets.

    Here's how it look:

    *Its only a small part of the map

  • Because those 40’000 objects are all tiles that make up the map. They change colour depending of the country owning them.

  • I have about 40,000 copies of a sprite and it's slowing down my project immensely with CPU usage at 95%. With the debug menu I see that some event-sheets are also contributing to the lag but turning them off changes nothing, the same amount of CPU is used whatever I disable or modifie. So I'm having trouble finding what the problem could be other than the massive amount of objects.

    Thank you-

  • Basically, I am using only one object and copies of it. What differentiate some of the copies is their variable : Ownership (which is whether owned or unowned)

    Now I need to calculate if the distance between a owned object and an unowned one is less or equal to 8.

    For now I am using the Line of sight behavior to do so but I feel like it makes performence drop to much for some reason and want to know if there is an alternative to it .

  • Thank you, it worked

  • Are your pages only sprite or you have text pinned to them?

    Because I did something similar only using 1 sprite, instead of many pages on different Z layers, I used sprite animation and frame.

    That way you would only have to refere to one sprite and just tell which frame/animation you want.

  • In this situation whene a square is 7pixel near an other square having a special variable, the square detected should change colour. For this I use LOS, but the way my event is structured, each square with special variable checks every ticks (i guess) if there's an other one near which obviously cause lag.

    So I would need to fix this by only calculating if there's squares near whene a button is clicked but also have the colours display until it updates.

    Thank you

  • I tried your first option, but could make it work...

    This is contexte:

    The squares represent territories, the yellow ones have the variable ''Unowned'' and the reds ''Owned'' but they all have the variable ''Adjacent''. So if a yellow square touch the red (owned) ones the ''adjacent'' variable would change to 1 (meaning it's touching) and then if its equal 1 I change the colour of those touching.

    So I need to know how to change the variable ''adjacent'' of the unowned squares in dirrect contact with the reds.

  • I have tried using overlapping and LOS condition to know if a copy of the sprite is near, but I wasn't able to make it detect only if the variable of this copied object is for exemple: 1.

    In short

    I would like to know how to do this:

    If object is overlapping and that overlapping object instance variable = 1

    then

    change this object colour...

    Thank you

  • You do not have permission to view this post

  • It works but the hitbox of the 3d shape is completely off, so my square can go into the shape but theirs also an invisible wall because of the weird hitbox. I only need the shape to pârtially go over the 3d object that's why I need the hitbox.

    (I am also using a 3d camera)

  • But this completely changes its position, I need something that can put the sprite over the 3d the same way layers or Z order would do.