mahdi71's Forum Posts

  • hi

    i have a game wich when user win or lose the game timescale change to 0.0001

    then a win or loos music (in music folder) start playing

    but after a 4 - 5 time wich user win or lose, the game start crashing and get force closed

    i disable the music group (wich start playing win or loos music) then game runs fine !

    i use cocoon canvas+ for this but since this is an audio problem i think this is a construct 2 problem here

    so why is that ? how can i fix this ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > newt , tunepunk

    > in a game you have alot of different sprites

    > let say you have 1 sprite with size of 300 * 300

    > and another with size of 300 * 100

    > and 2 sprite with size of 100 * 100

    > ok if you load each one : (the way wich construct 2 using now)

    > sprite1 = 512 * 512

    > sprite2 = 512 * 512

    > sprite 3,4 = (128* 128) 2X

    > - now the way wich i suggest :

    > pack sprite 1,2,3,4 to one 512 * 512 texture .

    > result : huge memory optimization

    >

    Sprite Sheeting only happens when you have multiple frames, and goes to the nearest power of 2. Are you saying you have an animation with 300x100, and100x100 frames?

    If you have a bunch of odd sized textures you will not gain any bonus from sheets, as there will be more unused space that way.

    each sprite have 1 image.

    no do you know images save on memory by power of 2 ?

    so how can you say that ?

    my example is very clear

  • newt , tunepunk

    in a game you have alot of different sprites

    let say you have 1 sprite with size of 300 * 300

    and another with size of 300 * 100

    and 2 sprite with size of 100 * 100

    ok if you load each one : (the way wich construct 2 using now)

    sprite1 = 512 * 512

    sprite2 = 512 * 512

    sprite 3,4 = (128* 128) 2X

    • now the way wich i suggest :

    pack sprite 1,2,3,4 to one 512 * 512 texture .

    result : huge memory optimization

  • Not really. Sprite Sheeting goes on the power of 2 to make the sheets. Once you get to the maximum size it will start a new sheet.

    Then if you don't have enough to fill the new sheet it will still make it to the next p^2 leaving wasted space.

    You can of course plan your sizes to accommodate that, but you have to take into account that sprites will get 1 pixel padding which removes any benefits, so to deal with that you must render your sprites 1 pixel less.

    The fact remains all these attempts don't really do much to affect performance.

    The real issue is still proper use of events.

    but when we put all of sprites in 1 sprite object it will fill as much as possible and that really effect so much on performance because if c2 do that then it can be alot memory optimization

  • Because they share the same texture, which means that you wouldn't have ability to change to a different texture at runtime.

    If you need one spritesheet, use instances.

    using instances for all objects is hard !

    you probably say that becuase when we pack all textures then we have to load all textures for each layout. right ?

    but we can solve that with using a link method like this :

    an option so we can link all sprites wich we use in each layout together or (mostly on mobile games) we can link all sprites.

    then i can say it can be a huge performance gain

  • hi,

    why construct 2 dosn't make spritesheets for all of the sprites ?

    and it just make for each sprite object !?

    if you put all your images in one sprite object it will pack them into spritesheets pretty nice (pack more then 100 images into just 4 ! >> so as result >> huge memory optimize and smaller size)

    but if you have different sprite objects then it will not do that and this way you will loose so much memory

    specially on big projects wich you can not put everything on one sprite !

  • Every time you ask your units to do something. Record the action and what time that action happened. If the opponent is AI, u can record the AI commmands also. Something like that I would go about.

    i have some actions wich do happens in every sec or less then that like every 0.1 (like shooting)

    by time you mean tick or a custom every x secound time ?

    i want my game do exact same thing and no matter what is timescale or framerate and i want to replay the game in the different speed and still exact same thing happens

  • Hmmmm a bit tricky i guess, but I think I would try to use an array to record all the unit positions and commmands, for the last few seconds. (depending on how long playback do you need) if only a few seconds i think array would be fine, but if you want to record the whole game you probably have to output to a log file or something, then replay the log in some way. I'm pretty sure it can be done.

    hi

    i just said it can not be done by recording every tick every position

    there is alot of units (30 unit ) and with diffrent variables like health - type - attack{ower - attackSpeed - ...

    so it can not be done with that.

    the exact game must be replay with just recording inputs

  • hi,

    i want to make a replay system for an rts game

    game use bullet behavior for all movement

    i can not record every unit x and y and then replay it becuase there is diffrent type of units and they creating in realtime

    so i have to save only user input and then do the exact same things

    i did that but when i replay the game in different framerate or different timescale , the replay changes and its not exact same thing

    so how can i do that ?

  • Nope, the js files are as custom as the events.

    It does keep the thieves from doing the exact same thing.

    i can do that actually :

    i can upload runtime.js in my server then in the index file (after export) i change runtime.js address to my server (like this: runtime.js to http://mysite.com/folder/runtime.js), but i want to cache (save) that js file in local and updated if newer version is there !

    just like what we can do in html5 export but i want to have it in cordova as well

    anyone know how to do this ?

  • hi,

    is there any way to load runtime.js and data.js from server in apk file ?

    every time i want to do a little change my game i have to update entire game in google play

    i mostly change the code and not the images so :

    i want to upload runtime.js and data.js in my server then load the logic in my game

    how can i do that ?

  • mahdi71

    Please enlighten us regarding all the bugs you say C2 is full of.

    there are alot, but i name a few :

    http://www.scirra.com/labs/multiplayer/ghostshooter/

    join scirra's own multiplayer demo and try to stay connected more then 30 minutes ! if you are still connected then you have a record!

    and with that plugin there is alot more bugs too, like if server internet get down then server side triggers like (on disconnected) dont act or server think its still in the game !!! but it really disconnected !

    what about websocket ? why is connected event not working !!

    oh, dont let me start on compiler stuff : so scirra suggest us to use xdk ! but its reallllly worst then cocoon !

    why ? becuase some times when you compile music dosn't work ! and you have to stop your update untill they get fix it !!

    or if you want to use cocoon (canvast+) other construct 2 stuff don't work !

    there is alot of problems in your way ! and then you realize the engine is not design well its dosn't act as a game engine its act like a problem ! and the fact there is no hit with c2 games will prove my word

  • > that because c2 is full of bugs and don't give us a good performance for big games and don't give us a good size for little games so we can not have nice little game with a small size to be a hit or a big game with a smooth gameplay.

    > just imagine if flappy bird was +30 mg size ! it simply coudn't be a hit

    > or if clash of clans didnt have a smooth game play.

    >

    This is a horrible generalisation at best... I've seen plenty of larger C2 games with perfect performance. It's how you set up your events and how efficient your design is... it's nothing to do with C2. Also... bugs? Those are rare, but name one piece of software that has zero bugs?

    ~Sol

    name one of that big c2 games ?!

  • that because c2 is full of bugs and don't give us a good performance for big games and don't give us a good size for little games so we can not have nice little game with a small size to be a hit or a big game with a smooth gameplay.

    just imagine if flappy bird had +30 mg size ! it simply coudn't be a hit

    or if clash of clans didnt have a smooth game play.

  • its working for me