tarek2's Recent Forum Activity

  • Hi,

    I'm trying to debug the RAM usage for the Arrays that I use in my game as they are quite big in size, around (14mb+)Compressed Each. But Construct shows Ram usage just for images.

    Is there any way to know how much Ram uses an Array?

    I try to use Chrome "Task Manager" but it gives a few different values like (Memory FootPrint & JavaScript Memory) and not sure if any of those are the ones that I should look for or if they are any accurate.

    Thank you

    These are some of the pictures from Chrome TaskManger:

    Empty Project but No Json Loade yet:

    Empty Project + 1 JSON Loaded of 14mb size

    Empty Project + 2 JSON Loaded of 14mb size each

    Empty Project + 3 JSON Loaded of 14mb size each

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • tarek2, that's amazing! You've done in few minutes what I was trying to do last two days. Thanks a lot!

    No problem, I'm glad it was helpful)

    Good luck

  • Ah, my mistake. I wasn't clear enough. I'm not trying to repeat the same object many times. I would like to know how to create a sprite that will mimic obstacles' shapes like a dotted circle here youtube.com/watch

    Ho, I see,

    Interesting mechanics I have never seen before.

    To be honest I will keep it simple as it will be very easy to hurt performance if you are not very careful as you have many balls to check on.

    I quick and simple idea that comes to my mind will be something like this:

    Demo:

    https://www.dropbox.com/s/fglaium14kq2jd8/1-Batty%20Cave.capx?dl=0

    You can keep updating and tweaking to your needs, this is just a quick demonstration.

    Tips:

    1-You would want to keep the shapes simples (Squares, Rectangles, Circles, triangles) shape that you can easily adjust the collisions points.

    But if you need more advance then kyatrics idea will be better to detect the collisions.

    2-Donot spawn too many balls so you can keep performance nicely.

    3-On this demo the obstacles are already placed on the layout as I wanted to make a quick concept but what you would want to do is like flappy birds style that keeps spawning the obstacles on the fly, this way you will keep the object count at the minimum, so set a set of obstacles to be spawn on the runtime and then just choose randomly.

  • Not sure which one you need to repeat but if:

    1-You need to create an identical object just use the system create object >>>> your object

    2-If you need to constantly repeat the same object use "Tiled Backgrounds"

  • Hi,

    I had a few ideas that could be cool to add:

    Feature1:

    Could be an added feature to right-click on the Top Root folder and choose "Remove any Subfolders" but keep the Animations of course, because for some Animations you don't need that many folders.

    Its something like Ungroup Layers from Photoshop that removes the folders

    Example:

    You Have This:

    And you want to convert it to this by Right-Click Colors Folder and choose remove subfolders:

    But this is not that important so is ok if it doesn't get added.

    =======================================================

    Feature2:

    One cool feature that will be nice:

    Is that you can Drop a (Zip or File) in the (Layout or Project) and it will create all the separate Objects with their Names like when you Drop file through the Animation editor that it creates the Animation but instead it will create whole Objects + Animations.

    This could be a nice time saver as you just drop the Zip on the editor and it will create all the objects with the right names and Animation names, so you don't have to go manually on each object to update the Animation, you will see the benefit for this when you have to update Animation for like 50+ Objects for example.

    Though one feature that it will need to work nicely is that If you Drop the (Zip or File) in the Layout:

    1-If the object to create already exist then just Update his Animation example:

    -If the Animation already exist then just replace the frames with the new ones

    -

    2-Else if the object doesn't exist then create the Object and add the Animation from that zip

    And it follows similar rules as to when you import a file inside the Animation Editor:

    -The Root Top Folder = (Zip of file) Name

    ">>>>>"Then the Subfolders Names = New Objects To Create

    ">>>>>>>>>>>>"Any Subfolder inside those folders = Animation to create for those objects

    This is how it will look like a Zip to import:

    So here on this case, I drop on the layout a Zip named colors and this is what happens:

    It creates 4 objects

    -Black_Object

    -Green_Object

    -Purple_Object

    -Red_Object

    =================

    And any subfolders of those folders is their Animations

    -Black_Object

    ">>>>>>"Animation_Name1

    ">>>>>>"Animation_Name2

    -Green_Object

    ">>>>>>"Animation_Name1

    ">>>>>>"Animation_Name2

    -Pueple_Object

    ">>>>>>"Animation_Name1

    ">>>>>>"Animation_Name2

    -Red_Object

    ">>>>>>"Animation_Name1

    ">>>>>>"Animation_Name2

  • DiegoM

    That would be fantastic if you could add the option to choose between different sorting modes Thank you

    Thanks for the Tips too

  • I'm still looking for solutions if anyone has any ideas.

    I tried looking at all the config on the server but I don't see anything related to this and Google doesn't help much as there is no much info on this topic.

  • This is Awesome!! what a great addition Thank you

    It already saved me a lot of hours of manual importing

    There is just one big issue for me:

    is not consistent with the ordering of the frames as I need to maintain the order for some Animations

    Example:

    If I want to import this folder that I have on my PC, this is how it looks like:

    is ordered nicely

    ============================================

    So If I import it like normal by

    Right-click in the frames window >>>> Import from file >>>> select all the frames

    Then it will import them correctly ordered

    =================================

    But if I use the new system by Drop a file on the Animation editor it will mess up all the order of the frames so they no longer follow the order I had on my PC folder.

    Like this

    CAPX:https://www.dropbox.com/s/b9okm7i9n3et367/Frame_Order_BUG.zip?dl=0

    Is there any way that I can change the order settings to be consistent?

  • I haven't tried it out, but I am wondering what is that base64 encoded data?

    I tried looking at the json on on it's own in Notepad++ and it struggled to show anything. Taking several seconds to open the file and then scrolling through it as sluggishly as you could possibly scroll.

    I am thinking the data is an image because 16 megabytes of raw text would be a lot of text.

    I know it is tempting to just cram an image in text format in a json file and then just load the json. But in this case maybe it is better to hold an identifier in the json and then use that to load the image through the browser's normal methods.

    Thanks, Diego no worries, just making sure that it doesn't get lost on the forum

    Yes that's an Array encoded to base64 then is saved into another Array as it is, basically, one big normal Array that holds in each X index an Array encoded in base64

    Yes you're right it's quite a lot of data as it was the only way to make this game, there wasn't any other alternative, it needs all that data to make it work.

    Is not an image lol its insane amount of data I know haha but there is no images or anything like that, it is just pure Data that is needed to run the game, it is one of those games that it wasn't meant to be done in construct I realize after but I'm quite happy with the results as all the hard part it's done already, basically the whole game it's done and I'm just finishing the UI which is the last few things left.

    Though once the ajax is loaded it runs very smooth no problems at all, also when it manages to load the JSON it loads quite fast there is no problem either.

    Also, my original JSON file is 16MB only so I had to increase it for this BUG demo to 28MB to make sure you can reproduce it easier.

    Thanks for your help I really appreciate it

  • Is this a bug? do I have to open a bug report? or it's a specific problem on my server?

    Can someone confirm, please to see what I need to do next

    Thank you

  • I did a search for net::ERR_CACHE_WRITE_FAILURE and it seems to be related with the browser not being able to cache very large files.

    Is your server gzipping and minifying the json? If the file is being served as is, that might help.

    You can also try an incognito mode tab to see if it works there.

    Hi Diego Thank you

    I think you're right looks like it could be something about the size as I found things like this

    Link: https://soorajchandran.medium.com/speeding-up-your-website-using-prefetching-techniques-8077058b7418

    There is not much info on the internet bout this topic though which I'm surprised

    Also, Is there any limit for JSON files? I never heard anything like that on the forums or Manual that there is a size limitation using Json files loaded through Ajax

    Is your server gzipping and minifying the JSON? If the file is being served as is, that might help.

    Nope, as far I know there isn't any (gzipping or minifying) at least I haven't implemented them when I created the server.

    You can also try an incognito mode tab to see if it works there.

    I always test in incognito mode so it doesn't save the cache and it fails all the time.

    =============================================================================

    The good news is that I managed to reproduce the BUG in a new empty project so I can share it.

    What I did is try to replicate as many settings as possible that I had on my main project and also I increased the Json File to increase the chance for a failure.

    There are no many settings to be honest:

    -I use Custome Loader layout

    So it starts on the "Menu Layout"

    There once it loads the Game it waits 2 secs and moves to the "Game Layou"

    -On the Game layout is where I load the Ajax at the start of the layout

    Where it shows a text message for if it loaded successfully or not

    Console Log Error:

    =================================================

    So here are the Files:

    C3 Project: https://www.dropbox.com/s/l4dccom4ia2oxco/Ajax%20BUG.c3p?dl=0

    If you export it by your self then here is the settings that I use when exporting as HTML

    ====================================

    Or here is the Zip ready

    https://www.dropbox.com/s/6usggrd2q30c78p/Ajax%20BUG.zip?dl=0

    I would really appreciate it if someone can confirm the bug so we can eliminate that is from my server

    Thank you

    Steps To Reproduce:

    Load the zip to your website

    1-Open chrome in incognito mode

    2-Go to the URL wait until it rich the "Game Layout"

    If it shows "Ajax Loaded Successfully!!!!!!!!!" then you need to close the tab and open a new one and try again until it shows

    "Errorrrrrrr Ajax Failed!!!!!!!!" in Red

    For me, it fails every time but you may need to try many times

    Also one more thing important, this problem is not only Chrome related as the error occurs when I test on the iPhones Browser swell.

  • Are you sure Play.Data_Ready is False by default and you are not switching to another layout before AJAX loads the file? This is the only thing that potentially can be wrong with your code.

    Maybe 16MB file is just too much for Construct. Try expanding all branches in that error message in console log, maybe you'll find something there.

    Yep, that is all good and checked:

    The Play.Data_Ready is False always

    Also, it cannot go to the next layout as "Play.Data_Ready" it becomes Active only after it loads the Array from Ajax so that's not possible that it can move to the next layout before it loads the Array.

    I blocked just in case the events for changing to the next Layout so there is no more layout change, just the Array loading from Ajax and still failed so definitely is not because it was changing the layout, at least I can discard that option.

    The only thing that I think could be the cause maybe is that I'm testing in Browsers incognito mode? not sure if they are any known problems using incognito mode but I need to test there to clear the cache.

    Are you saying this only happens with the exported game? Maybe it's a problem with your web server.

    Yeah, maybe that's what I thought too as it doesn't happen on preview, not sure what else it could be, I just have the C3 files there but I will keep looking, I use Cloudflare so not sure if that could cause any problem.

    The logs didn't help much:

    Thanks for your help

tarek2's avatar

tarek2

Early Adopter

Member since 26 Jan, 2016

Twitter
tarek2 has 12 followers

Trophy Case

  • 8-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x5
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

15/44
How to earn trophies