PaulPlay's Recent Forum Activity

  • Yeah, thats exactly what I mean by "with code". I have 2 HUGE event blocks with around 70 actions to set all the keys of a dictionary called "language". I only got 2 languages now, but will have more in the future and will switch to json. I was just wondering wether it has a performance impact to have this much more code, which is only running on start of the layout so I'd guess performance impact probably isn't huge.

    Anyway, the array thing seems good but I have already implemented the dictonary in my game on which I am working on since 2019 and it would be a pain to switch to that. So I will prob just load the Json into the existing dictonary and hope for the best.

    I have seen there is also a "download dictonary" action, which supposedly exports the dictonary as json, maybe this works so I don't have to copy it by hand...

  • The best way to do localization in construct is probably to use AJAX to request a JSON file for the correct language and then AJAX: "On tag completed" -> Dictonary load from Json string (Ajax.LastData).

    I want to switch to this solution because it is easier to have every language in a seperate file, BUT...

    ...I wonder what the real NEGATIVES of just creating a Dictonary in code are. If you have let's say 5 Dictonaries in code and they all contain 30 sentences in a language, does this increase loading times? Or is it bad for general performance? Because text uses only a few kb so I wonder why it isn't a common practise to just put the dictonaries in code and don't load them from json files. I'm curious to see your answers :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is it available yet? Haven't heard anything about it.

  • Thanks, imma try that if I get sufficient installs. Chadori truly is a Chad, his plugins seem pretty good.

  • Yeah but the IronSource Addon from this guy is 160$, only worth it if my game becomes a great success. If you earn „only“ a couple hundred bucks per month from advertising mediation does not really get you higher ecpm, because other networks often value customers with larger audiences. At least thats what I‘ve heard.

  • Appodeal would be great, but it seems like it's cancelled. (?)

    Oh and keep up your good work (even though it's kinda expensive but you gotta make some money off of that and for people with a lot of ad revenue it pays off)

  • Hey,

    I was wondering wether the admob plugin also includes other important app networks to support mediation.

    Best regards,

    Paul

  • Hey,

    I was wondering what restore purchases in the IAP plugin really does.

    Do you need to keep track of all purchases that were claimed or does it do that automatically?

    How does it handle paid consumables?

    What if you reinstalled the game, can you then reclaim the purchases? If yes, should you trigger the action the first time the user opens the app?

    Should you make a button for it or trigger it every time the app starts? Or only the first time it does so? What happens if the user is offline?

    Best regards,

    Paul

  • dop2000

    You can create rooms on a seperate (unused) layout, connect all objects to the room with hierachy [...]

    Does this mean I can just connect them with hierachy in the layout view?

    Because I got like a hundred objects and I dont want to make an action "if object1 overlaps room1 -> room1 add child" for every object.

    Or would "if room1 overlaps "FamilyWithALlObjects" -> room 1 add child "FamilyWithAllObjects" work? Or would it just pick all family members in the whole scene?

    thanks for your help!

  • Okay so this seems helpful (thanks a lot!) but it is a very lengthy tutorial so I figured for everyone who's curious here is the short form:

    CurX here is the right boarder (BBox.right) of the last placed scene. CurY here is the Y position of the last placed scene, in this example it always stays the same but if you want to add verticality to the game you might want to change this.

    For adding a room (in this case called "scene") above the current room, you need to take BBox.top for the Y position (curY) and if wou want to add a room below the current one you need to use BBox.bottom + NewScene.height instead.(this wasn't mentioned in the video but I believe this should work)

    Now, you got a family with all the scene objects (so basically every object in your game's world), in this case it is called "Entities".

    Now with this funky formula you set the position for each entity to the position where the new scene is going to be but add the own position of the object relative to the scene position (so self.x & self.y) as an offset.

    For this formula it is essential (wasn't mentioned in the video though) that the origins of the background scene objects are in the lower left-hand corner.

  • Hey,

    I want to make an endless runner (think of Subway Surfers) where pre-defined rooms spawn ahead of the player (these can be either created or moved to the position).

    These rooms should consist of multiple objects, like spikes or bombs.

    Now: I want to move those rooms, but the issue is that I can't just pin the objects to the rooms because there are also instances of such objects in the other rooms.

    This is why families wouldn't work either, because they select every instance.

    If I want to move an entire room to a different position, there would need to be something like a "prefab" so I can create or move a room with all the instances at the correct position.

    An Idea was to create a family in which all objects are and then say: if family overlaps with room_background (invisible sprite) = pin to object. However, this did not work well.

  • Hey, I have always struggled with the fps of my game, so I did a lot of research and looked through many forum posts as well as Ashley's guides (that I can really recommend!) for optimizing your game. I have stumbled across a few "magic settings" you can use to get instantly higher fps, will explain them quickly and show you other ways to improve the performance of your (mobile) game. I managed to get my game from 2.5GB of ram to just 250, as well as getting it from crashing instantly to stable > 60 fps on my older galaxy s8.

    ---

    Project Settings:

    Sampling: Does not make a big performance difference at all.

    GPU Preference: High Performance makes a slight difference, use it instead.

    Downscale quality: for my game, this made quite a big difference, but it really depends on your game, so do proper testing. I recommend putting it on low for you mobile game, if the textures are high resolution.

    Max Spritesheet size: A smaller size is worse for cpu performance, however it really decreases ram usage. The switch from 4096 to 2048 saved a lot of memory for me while only very slightly impacting cpu performance - recommended!

    Fullscreen Quality:

    Basically, due to scaling, setting this to low will make the game a bit more pixelated (which you can't see on my 1440p phone display!) but can make quite a difference regarding performance. Setting it to high will render the game at the screens resolution while low will render it at the set viewport resolution and simply scale it to fix the screen. So depending on whether your game has a higher or lower resolution than your target device, either setting can be beneficial.

    Anti-Aliasing: Makes a bit of a difference when it comes to performance, so for mobile games if your game uses very detailed sprites you might want to turn it off.

    ---

    Ram usage:

    Bigger sprites use way more ram than smaller ones. You might think a 4000x4000 image only uses double the amount of ram as a 2000x2000 one, but actually it uses 4 times that. This is due to the amount of pixels in the 4000x4000 image. Make sure to downscale images to the smallest size that still looks pleasing. For pixel art, this is of course not an issue. For buttons, 250x250 is enough in most cases. Try to downscale all images by alot.

    Spritesheets work in a way, that for example a 400x400 image occupies a 512x512 space and a 600x600 image actually uses a 1024x1024 spritesheet space so make sure they are always under these numbers if possible. For example, a button that is 258x258 needs a 512x512 space, so rather go for 256x256. Compressing images to a smaller size ONLY makes your game smaller, not the ram usage as they are converted into a different format in ram so they can isntantly be displayed when needed.

    You can also use SVG images for static sprites - not moving sprites, cause then this will be very cpu intensive. When you downscale an image in the animation editor, try to use smoothing as it makes edges less rough so the image actually looks smoother and higher resolution.

    In the DEBUG Layout you can see, which layers use the highest amount of ram, so use this for detecting large sprites.

    You might wonder, how much ram these new phones can even handle.

    My S8 struggled a bit with 500mb of ram, while new flagship phones can even handle 1.5GB, however it is really bad for gpu performance so try to minimize ram usage as much as possible. If your game has many scenes, it might be worth it to unload certain sprites out of memory, there is an action under "system" for this.

    CPU Usage:

    This is a bit more interesting. Here, you can use the Debug Layout too to find out which groups use a high amount of cpu, however, make sure to put the frame rate mode to unlimited if testing!

    You might have already heard that for example "every tick" uses a lot of cpu power, so rather go for someting like "if variable<7" etc instead. Also, settting a text to something every tick or very often uses a lot of cpu too.

    You might want to use a sprite font for that. Very handy is "trigger once" for certain actions that only need to be triggered once when a certain condition becomes true. For Triggers (the ones with the green arrow) this is done automatically and they only trigger once. For other actions (for example, "if text="0" " you might want to use "trigger once" instead if the action only needs to activate once the condition becomes true (or becomes true again). Another trick is, to turn of certain groups in your code when you don't need them. For example, if my shop menu isn't opened, I can turn off most of it's code.

    GPU Usage:

    This is pretty straightforward. All effects except of simple color changes etc. consume quite a lot of gpu power. For example the water shader, when applied to bigger sprites, uses a lot of gpu performance. When you use particles, you can test if they are still "on screen", and if not, destroy them, as they still use cpu (?) performance if they are outside of the layout. Using small sprites as described under Ram Usage also helps a lot.

    On static layers you can also activate "render cellls", I did that on my background layer. Do NOT do this on layers with particles or moving objects though, it reduces performance significantly. Adding more layers itself does not decrease performance. Objects that are 0% opacity still use some gpu power, so make sure to destroy them or set them to invisible.

    Final words:

    I hope this short guide was able to help you. Of course, this can't fix messy code or gigantic layouts, but can still improve your fps by a lot. So make sure to optimize your code and keep it as short as possible, also you can try using java script in construct as it also has a better performance that the actions but you should be fine with visual scripting (like I use) too. If you have any other tricks or tips to improve performance, make sure to let me know in the comments!

PaulPlay's avatar

PaulPlay

Member since 22 May, 2021

Twitter
PaulPlay has 2 followers

Trophy Case

  • 3-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x3
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

8/44
How to earn trophies