Nepeo's Forum Posts

  • I hadn't seen this, so thanks for bringing this to my attention. The scope of the changes they are bringing in is quite wide, but I'm hopeful this will improve the situation around APK size limits.

    Before I get into this it's worth noting that APK's do not have an actual size limit, the current 100mb limit is imposed by the play store.

    So... they have basically introduced a new intermediate format called Android App Bundles ( AAB ). You can now export one of these instead of an APK from android studio. But the kicker here is that you cannot install a AAB on an android phone. They are intended for is to be published to the play store, then when someone tries to download that app an APK is generated from AAB. This allows the APK to only included the code needed for that device, theoretically decreasing the APK size.

    At the moment cordova does not support AAB exports, and I cannot find any mention of them on their feature tracker... So we are unlikely to support this format on the build server for awhile. Also you need a special command line tool to convert an AAB to an APK for device installation/testing which makes it less useful. If you want to try it out you can export as an android studio project, and then generate an AAB using android studio ( some minor tinkering is required, and you must be fully up to date ).

    It's unclear if the 500MB size change will be available to APKs it sounds like it's only going to happen for AAB files.

    It's not really clear if this is going to remove the need for expansion APKs... I will keep an eye out, but will keep working on expansion APKs for now.

  • If you've got an image you want to use as your background the simplest solution is to create a sprite and put and put the image into that.

    You don't need to worry about collisions yet. Objects with collisions won't block character movement, only items with the "solid" behaviour will.

    I don't think you need the tilemap object, the "tile movement" is a behaviour you can apply to sprite, etc. it doesn't actually need a tilemap.

    I made a quick example of the tilemap plugin and tile movement behaviour for you.

    dropbox.com/s/dvpzoo5p3qalx4b/tile_movement_example.c3p

    The tilemap has 1 white and 1 black tile, which I've just painted as a chess board like grid. Then for a character I've created a sprite, which I painted red. I attached the tile movement behaviour to the sprite, and tweaked the positioning so that it sits in the middle of a space.

  • santiagoestrade have you used the tilemap tool before? It sounds like you've created the tiles but haven't painted any tiles to the object.

    The tilemap plugin allows you to create a small set of tiles, then you can use "paint" those tiles to the object to create an image. To "paint" a tile you can you the tilemap bar to select a tile and then you can just draw onto the object in the layout view.

    The demonoire demo is a good example of tilemap usage. It uses 2 small tilemaps to draw all of the backgrounds for something like 20 layouts. It also has a separate invisible tilemap that it uses for collisions, a handy trick for grid based games.

  • TL;DR - the data editor will support ranged cut/copy/paste in r123. Compatible with G Sheets and MS Excel(probably)

    The copy and paste was a good suggestion joelmayer As ranged cut/copy/paste is something that has been requested a fair few times for the data editor that would cover 2 bases, and avoids writing special import/export system.

    I've done some experimenting and matched the format that google sheets uses, so in the next release it should be possible to copy/paste between the 2. If pasting from excel into sheets works then in theory it the same format should also work for excel. But I can't be 100% sure ( I don't have excel on my development machine to test ).

    If your interested sheets uses a slightly awkward variation on the TSV ( tab separated values ) format. There's some very special treatment of double quotes, which has been a pain to handle.

    Hopefully this should cover your bases for converting to/from CSV files!

  • joelmayer importing/exporting array data to CSV is probably a bit awkward, as array data is always 3D but CSV is only 2D. I tried passing an empty 10x10x10 array file through an online json > csv converter and ended up with 30 values instead of 1000.

    It should be possible to convert a "layer" of an array to CSV fairly painlessly, but I'm not aware of any tools that do it. If there's enough interest I would consider adding the ability to the array editor itself for import/export. As MS excel supports CSV it could be handy in some situations. However, CSV isn't really standardised, which is a bit of pain.

  • joelmayer as mentioned above we aim to do the documentation for new features when the following stable release comes out.

    As a pure data format JSON is much nicer and a lot more flexible than CSV, and isn't too hard to work with. You may find it easier in the long term to just rewrite your dialog file in the JSON format instead of converting it from CSV.

    all references to arrays here are talking about JSON arrays, not the array plugin

    Crash course in JSON

    JSON is structured similar to how you would think of folders and files. There are 2 types of "folder"; arrays and objects. You start an arrays use square brackets and an object with a curly braces. Arrays have no label, so you access their contents by index. Objects have a label for each "file", these labels are strings. You can put any type of "file" or "folder" in any "folder". Every "file" or "folder" in JSON has a unique path that you can access it with.

    Crash course in JSON plugin

    If your trying to read data the first thing you want to do load it in. Get your data with the AJAX plugin and use the JSON.Parse action to load it into the plugin. If it's not valid JSON the on parse error condition will trigger, otherwise your ready to go.

    If you know the path of the "file" you want you can just get the data using the JSON.Get expression. You can make a path by joining the names of the "folders" with a full stop. As arrays don't have names for their contents you can use a number like so "data.enemies.3.name".

    It can get a bit tedious writing the full path all the time, so you can move your current location using the SetPath action. Now if you start your path with a full stop it will be relative to the current location. Paths that don't start with a full stop will be absolute paths and ignore the current location.

    Working with arrays you might not know how many entries there are, so you can use the ArraySize expression to find out. Also there is a foreachcondition that loops over "folders". Inside the loop you can use the CurrentKey expression to get the label and CurrentValue to get the value.

    I'm not going to cover it here but the plugin also has methods of creating and modifying JSON data.

    Putting this together

    Say you have a series of named dialogs, each having a title and a few pages of text you could have something like:

    {
     "welcome": {
     "dialog-title": "Welcome",
     "pages": [
     "Hello new player",
     "welcome to my game",
     "I hope you enjoy it"
     ]
     },
     "gameover": {
     "dialog-title": "Game Over",
     "pages": [
     "You seemed to have died",
     "Maybe you should try again?",
     "Or you know, go look at a tree or something"
     ]
     }
     }
    

    Then in you can have an function for "show dialog" that just takes the name of the dialog and do:

    System | Set DialogName to Function.Param(0)

    JSON | Set path to DialogName

    Title | Set text to JSON.Get(".dialog-title")

    JSON | Set path to ".pages"

    // some magic here to increment through the pages

    System | set PageCount to JSON.ArraySize(".")

    Content | Set text to JSON.Get("." & PageNumber)

  • Admob sometimes just doesn't send Ads, not really sure why. It's worth taking it into account when creating your events. In any of the error events you can check the reasons using the MobileAdvert.errormessage system expression.

    pilpgam Admob pushed out an updated on Friday ( not cool ) which added a new setup step. If the setup step isn't completed they purposefully crash the app ( also not cool ) I can't figure out why they needed the step, it seems pretty pointless. I've pushed an update out to the build server to use the older version of Admob, so it should now be working again. Hopefully we will be using the latest version again in r122.

  • There has been a bug reported today which turned out to be an issue with the "int" expression when a project is minified. Any expressions using it in r120 will fail.

    If you are using minification then I recommend that you try disabling it and see if your game behaves correctly. As your exporting to android minification so it's probably safe to leave it off. It won't have much of an effect on your APK size; the native code and any media tend to be the largest parts of an APK.

    If your not using minification or the int expression please file a bug report with a project that repeats the issue on github and we'll take a look for you.

  • I've just updated the manual entry for the mobile advert plugin with more details on GDPR compliance, which includes how to set a custom provider list.

  • There's been a few people struggling to get their configuration settings correct. With the addition of the GDPR compliance parts some additional setup and properties need to be completed for the plugin to work. There are no open issues with the Mobile Advert plugin at the moment so if you do believe something is wrong please file a bug report at our github tracker.

    When you experience an error with the mobile advert plugin it worth checking the "ErrorMessage" expression, as it should contain the reason for error.

    A few issues you may be experiencing:

    - you must use a custom provider list with no more than 12 providers

    - a privacy URL must be provided withing the plugin properties

    - app ID and publisher ID must be filled in

    - there is now a separate apple and android app ID property ( the old property value has been changed to android app ID )

  • Hey tunepunk looking at the GC you show in your screenshot it takes roughly a third of a normal frame(5.5ms) to complete, and as far as I can see in your profiler image there's nothing else occurring for the remaining 40ms of that frame. I expect it's managing to line up with some other large task the browser was doing that isn't shown on the flamegraph. Also worth remembering that when using preview chrome will share the process between your game and construct, so performance isn't completely representative.

    As ash said GC has changed a fair bit in the last few years. Chrome prefers lots of small GC calls during expected idle time to avoid long blocking GC pauses. The side effect of that is that your memory graph will often appear as a sawtooth, even when there isn't a memory pressure. It's also worth noting that despite chrome labelling that as a "major GC" it was only 400KB ( max heap 34MB ), the graph you referenced is showing GC of about 80MB ( max heap 190MB ) so not only is construct using a lot less memory but the GC was 20 times smaller!

    In terms of static allocation, it doesn't magically improve performance. We use it where possible but often it's just not feasible to use. In my experience, forcing the use of static allocation everywhere you can makes code a lot harder to work with, increase overall memory pressure and in some cases can have a negative performance impact.

    I'm not trying to wash over the issues your having. Dropped frames definitely suck, and I have to say I've been having a slightly rough day in regards to chrome 69 bugs. I have spent most of the day working in canary instead, so I'm hoping to see some form of maintenance release over the next few days.

    Perhaps could you upload the profile you took for us to look at? You can save it as a JSON from the timeline. It might answer more questions than a screenshot.

  • I'm not completely clear as to the structure of your game, but I'm guessing you don't need all this data to be loaded at once. If that's the case I would suggest breaking it into chunks and then only loading the sections you need. If your trying to produce a terraria style game and have effectively the whole world loaded at once your going to have memory problems left, right and center.

    I've been working on minecraft clone written in webGL and JS for about 6 months ( haven't actually had much time to work on it, coding as a living puts you off coding in your evenings as well ). So I'm fairly familiar with the techniques needed for procedural generation of terrain and streaming level loading.

    In my case the world is split up into 16 x 16 x 256 block chunks. Chunks don't exist until they have been visited. When a chunk is visited for the first time I generate a 3D array holding a number representing the block type using 2d simplex noise. This is then passed to a separate system where a mesh is generated for the chunk ( so I only have to render 1 object per chunk ). When I leave the chunk the mesh is thrown away and I pack up the block data into a flat array. That flat array is 66kb and if needed could be compressed quite heavily.

    While it would be complex most of this could be done in construct for a 2D game. Instead of meshes you could use tilemap instances. With the addition of a small bit of JS you could hold a much smaller representation of your chunk data in a Uint8TypedArray or similar. Additionally you could store your world in a simple binary format that would be a lot smaller than JSON.

  • I presume your trying to download this file using the Array plugins "download" action? I expect the method is struggling with the array size, but it's not clear why. If you submit a bug to our issue tracker with a barebones version of the project your using to generate the array we can take a closer look.

    You can include JSON files ( in our array format ) into your project by importing them into the "files" folder. To load the file in your game you can use the AJAX plugin to get the file as a string, then use that to create your array. We don't support a pure binary form of array files at the moment, only JSON. Binary formats tend to be a lot smaller, and often faster to load, but need specialist tools to view or edit them. Whereas textual ones like JSON are can be read in any text editor ( notepad or textedit for instance ).

    The inbuilt array editor in C3 can create arrays up to 1000 x 1000 x 1000. But in practise I wouldn't advise trying to create an array that large, I think the highest I've got it to load is about 60 million cells before chrome runs out of memory, but your mileage may vary.

    I was curious how much memory such a large array would use, so I've done a bit of testing. Within the runtime it's hard to predict quite how much memory an array is going to consume, and even with the same data it's going to vary depending on a lot of factors.

    You can get a rough estimate by counting the number of objects that make up the array. For starters all arrays in construct are 3D even if your only using a simple 1D array. This 3D array is made from lots of smaller 1D arrays, structured as an array of arrays of arrays.

    Number of sub arrays = (width x height) + width + 1

    Number of items = width x height x depth

    Size of a string (bytes) = 2 x length

    Size of a number (bytes) = 8

    Size of an array (bytes) = 32

    So for an array of numbers ( I used 0 as my number ) with the dimensions [5000, 5000, 1] you would need 900MB. In practise I saw about a 960MB memory increase when I created an object that size ( actually a smaller margin of error than I was expecting ). Unfortunately I can't be any more precise, because the memory profiler in chrome cannot deal with an object this large ( it crashed the tab every time I ran it ). Converting that to JSON gets you a string that is 100 million characters long ( 200MB ). When you use the download method in the array plugin that JSON string is then URI encoded, which increases it's length by 2.5 times. That should be 250 million characters ( 500MB ) but in practise chrome crashed again at this point. If your curious supposedly the maximum length for a string in chrome is about 1 billion characters.

    Okay final tally. Say I had that data as a file, used AJAX to get it over the network, passed it into my array then tried to download it. How much memory would that use?

    200MB + 960MB + 200MB + 500MB = 1.86GB

    700MB of that would be garbage collected after the download had completed, but its still quite a lot!

  • Hey rickario, we made some changes to how we load folders from the cloud in the last stable. It used to be that we would load the whole tree of folders and files at once, which could take awhile if you've got a lot of files and folders. Now we load a folder at a time, which is generally a lot faster.

    Do you find it any faster than the old version?

    what platform are you using? You might have a sign in popup hiding away somewhere, it will show as loading until the sign in is completed. The cloud component talks directly with your provider, so any slowdowns are either the provider being slow or your internet connections I'm afraid.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • We have some fairly liberal limits at the moment, mostly to prevent abuse. It's likely to be tightened up a bit in future but it's not our intention to limit users. Just to ensure that the server has enough capacity for everyone to use it.

    A minor tweak to what said; the compressed limit is currently still 500MB, but the expanded version is 1GB. In case it isn't clear these are per build limits, not some kind of usage quota.