igortyhon's Forum Posts

  • Hello, engine developers and users who are interested in this topic. I think this is especially relevant for mobile developers.

    Question for developers Ashley and Tom: our engine is constantly growing and filling up with various interesting and useful tools.

    It would be nice to fix this mess in the sprite sheets. Currently, sprite sheets are compiled automatically and quite densely. We can even choose their size (512, 1024, 2048). But this compilation is often illogical and leads to unnecessary memory consumption at the level.

    In the screenshot, I have given an example of a sprite sheet with only three images, and they will never be used on the same level but are always loaded together.

    It is high time to do something about this, perhaps adding a tag to the sprite to which it belongs to a separate scene. Or maybe you have another solution.

  • When i check on admob, they ask me to "validate my game" and insert an "fichier app-ads.txt" into it.

    Everything works.

    The file (app-ads.txt) must be placed on your website.

  • Yeah, but +55% CPU usage - it makes no sense! And if I move the "is visible" condition inside the loop, the difference is only 3%

    dop2000 I think our colleague Je Fawk found a bug. In fact, with these tasks, a load of 5-10% is normal, because it only involves checking two parameters in a total of 3,000 objects. This is an easy task for JS, and all this load is mainly overhead and rendering costs.

    For such a task, a load of 60% is something abnormal.

  • igortyhon thank you for the testing. My point was to first filter all the objects and then do the loop with the check, to make it run better.

    Obviously it didn't work, hence why I asked if people know the reason.

    But (visible) is not a trigger, and when you have one object on stage, you can do this, and it will check that object. But when you have 500 objects, which object will be checked for visibility?

    This creates uncertainty, and thanks to Construct3, such code did not generate an error. But it is good practice to choose in the code which object you need to check through the peak or go through all of them.

  • Using r. 449.2

    Hi. You are using the optimization condition incorrectly. If you are forced to go through all objects every tick, then at least try to do all the checks in the middle of the iteration cycle.

    To make the result more visible, I increased the number of objects to 10,000.

    If we disregard overhead costs, I think the optimization gives about a 50% improvement.

  • Is there any easy way to do this? As width and height of screens could be very different from tablet to tablet

    Thanks!

    In this case, it is better to use these expressions

    PlatformInfo.CanvasDeviceHeight/PlatformInfo.CanvasDeviceWidth
    

    to determine the screen resolution on which you want the banner to be displayed, and only display it there.

    I use these expressions to adapt the game interface to tablets and smartphones.

  • Thanks, I'll try. However last time I had problems with IDFA + consent on AppStore. First IDFA is displayed, then Consent, the Apple Support want to display them in another order for some reasons

    You'll have to code it.

    When I published my first apps, I followed all the rules.

    - First, the window where I explain why I'm collecting data (to improve the game) is a design window. This recommended window is optional.

    - Then GDPR.

    - Next comes ATT.

    But in my latest app, I followed your advice, simply enabling the checkbox in the plugin. I trusted the correctness of the AdMob SDK itself. The only thing I did was remove the identifier for Android in the plugin settings, leaving it only for iOS. I didn't even test it, but it quickly passed moderation.

    That's why I gave this advice.

  • Leave the checkbox (show on startup) checked in the plugin settings and remove everything you do in the code.

    In this case, the AdMob SDK will determine whether the player should be shown the consent window; this is a problem for Google's SDK itself. You can then check your AdMob account to see how many people have given their consent or refused.

    There is no need to complicate things where it is not necessary.

  • I clearly stated in the screenshot that checks longer than 30 minutes and longer than 22 hours are a single block through the OR block.

    I also wrote this in the post.

    If you need such detailed instructions, you need to save the project in a single file (*.c3p) and post it, then it will be easier to make corrections and check.

  • Text pops up (just once) at 21 hours and 30 minutes

    OR

    Anytime after that (just once) up to 2am

    I hope I understood the task correctly, you need to check it because I haven't tested it.

    I suggest first optimizing and adding the frequency of checks so that it does not happen every tick, for example, 3 times per second.

    Then we check the mandatory conditions for the text to appear.

    -Is there already such a text?

    -Is there a pause?

    -Is it too late, less than 2 hours after midnight?

    -Is the time greater than or equal to 21?

    In the next block, we specify whether we have more than 22 hours or more than 30 minutes.

    This way, our block should work once, and the check will not overload the entire game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The conditions of step 183 will never be met, because if they are reached, the variable HoursPM = 21.

    And why duplicate the condition from the ClockPause variable? Let it only be in step 183.

  • I got it to work with ViewportMidX("UI"), but I am still wondering how could I calculate it manually.

    Hi. The old method should also work.

    Perhaps you forgot to take into account the beginning of the screen.

    ViewportLeft("UI")+ ViewportWidth("UI") / 2

  • Note: legacy (SDK v1) addons are no longer supported in this release of Construct and so cannot be installed. The last release that supports legacy addons is the r449 LTS release. See the LTS releases page, or contact the addon developer for an updated version of the addon.

    I don't understand your problem. Can you send me the file and I'll try to help?

  • Not sure you understood correctly. When I open with 420 I get the message:

    This project cannot be opened since it was saved in a newer version of Construct. The project was saved in 420.2, and you are currently using r420...etc

    Then open it in version (r420.2)

    editor.construct.net/r420-2

  • ...

    2. Using the latest LTS version my project says it was saved with a more recent version (420?) so it cant be opened.

    ...

    The latest stable version (r449-2) still allows opening SDK plugins version 1. Therefore, it is unclear why this is the case.

    then open it in the version you need.(r420)

    editor.construct.net/r420