pcfernandesjr's Recent Forum Activity

  • Maybe you could test using a smaller layout size (therefore smaller images as well), and set the game to fit the screen useing letterbox scale.

    It could be easier to help if you post a screenshot of your event sheet

  • Nobody?

  • I tried to open my game exporten with CocoonJS on a Android 2.3 (Galaxy Y / Galaxy Player) and it stops on Ludei's Splash Screen.

    Also happened with Motorola RAZR D3.

    I think it's a lucky shot to make your game work with older versions of Android...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi there fellows!

    I am implementing a "share my score" event in my game, and I would like to know if it is possible to call the facebook app of one's cellphone instead of opening a browser with facebook's website.

    Thanks for the attention!

  • > I am getting obsessed with programming my games as much "mobile friendly" as possible. (Severe trauma from the last 2 weeks when I'm failing miserably in porting a simple game to mobile, and worried about my other games that are filled with potential memory consuming events)

    >

    > I know that besides the "Every Tick", there are others that constantly checks every tick if the related objects reaches or not their trigger conditions. For example checking collisions

    >

    > Is there any list available of these conditions? it would be nice to have one, together with the best practices tutorials and articles sprinkled over Scirra's website/forum.

    >

    Basically, every condition other than true triggers (like on created, on function, on start of layout), is checked every tick, the goal is to reduce the calculations needed by the device, collision is a pretty heavy condition compared to check if a variable is equal to something, or if a grouo is active, or something else, and even more if the number of collision to check is big, deactivating collisions and behaviors on objects that aren t on screen (or that don t need them active at a given situation) can help, not abusing of loop also is mandatory (you can still use them in cases they are really needed of course), lowering the number of points in the object hitbox can help too (pixel perfect like collision is rarely needed), some object can have on collision active only one tick out of two without breaking the game, at the end, a synthesis is:

    If you are using a behavior, do you really need all it s functionnalities, and if not, can you reproduce what is needed in events only? If so try it

    Keep calm, make a scenario in your head, then read the event sheet yourself, from top to bottom, reading the includes too, with that particular scenario, if somethings seems redundant, or looks line it could be avoided, maybe it is indeed.

    Functions are great, and can make the code look cleaner, and so is easier to edit and optimise.

    Groups help organize events, and they can be deactivated and activated by events, learn what is always needed, and what is only conditionnal, for exemple, the ennemi AI is only active if the ennemy exist, and in some cases, if it is on screen, you could play around with that.

    Maths can be pretty heavy when done a lot of times, so try to simplify the calculations if possible.

    For a clean work, do not use global variables only, instances variables for instance, local variables for what is only needed in a group for exemple.

    Includes can be dragged inside sub events, which can help deactivating an entire event sheet when for exemple, the game is paused.

    Workarounds are a bad pratice and so, if needed, should always be isolated inside functions and such, since they can broke pretty much from one version to another.

    It is only a concise and non exhautive list of how I do in C2 that works.

    Great tips, thanks Aphrodite!

  • I don't know. I never got how to use the Ludei's LAN preview or their test app properly... Is there a way to print it on the game, like FPS?

  • Uhm...I think I am facing a similar problem. So if you guys don't mind in helping me as well...

    My game have a 32x32 tile that is used as a 480x1280 background.

    The game runs fairly well on my device (Samsung Galaxy tab 3 Mini), but on some of my friends devices (Samsung Galaxy Player 4.2 and a Motorola RAZR D3) what happens is that the game freezes on Ludei's splashscreen.

    Could this be the reason of it? Or it would by other issue?

  • I am getting obsessed with programming my games as much "mobile friendly" as possible. (Severe trauma from the last 2 weeks when I'm failing miserably in porting a simple game to mobile, and worried about my other games that are filled with potential memory consuming events)

    I know that besides the "Every Tick", there are others that constantly checks every tick if the related objects reaches or not their trigger conditions. For example checking collisions

    Is there any list available of these conditions? it would be nice to have one, together with the best practices tutorials and articles sprinkled over Scirra's website/forum.

  • That's weird. Does it only occur on mobile? or does the penguin pass right through in desktop as well? Does it happen for the popsicles too?. You exporting using cocoonjs?.

    It seems fine when i tested on my android.

    You sure you didn't change the code, The for each block loop is still present right.

    Amazingly yes. It only occurred on mobile. What is happening is that randomly the Penguin is passing through ice blocks and popsicles as well.

    The only thing different I did was changing some collision points that were different from what you set up (you changed it to bottom instead of middle, but forgot to do the same in other objects frames, such as the left and right penguin frames)

    I exported the game using Cocoon JS (Which by the way worked way better than Crosswalk), and the device I am using is the Samsung Galaxy Tab 3 Mini.

    One thing that I was thinking about is if setting the Every X Seconds from the blocks/popsicle generator to "0.5" has something to do with it.

  • I think i`ll give up. I`m really frustrated with this.

  • Ha sorry but i'll need more time to understand how all those variables play together. You can keep trying new ways and testing. That's the best way to learn.

    If the game works as it is i wouldn't really bother with trying to optimize the event sheets. The performance gains you'll get is really negligible compared to the gains you'll get from removing unnecessary events, objects, collisions etc.

    If you are gonna use cocoonjs, export the project with version 1.4.7 rather than their 2.0.0 beta. Performance is definitely better in the older version.

    If the game works as it should at 60 fps on mobile, publish it and then iron out your event sheet for future updates.

    Pandy, your solution gave a huge improvement to the frame rate. I couldn't get less than 30 fps and that is great!

    But, there is something weird ocurring only on mobile. Sometimes the penguin just passes through the popsicles/ice blocks, without anything happening.

    That is really weird, I spent the whole Sunday trying to figuring out what is happening, but no success until now

    Hey, I liked your game. Simple but fun.

    Thanks man, I have hope that I will be able to port it to mobile. But it's being really hard. I wonder how must be design bigger games with C2 for mobile. ;/

  • Thanks Pandy! I'll study the changes you did to the code.

    Do you think that it is necessary to replace the every tick events with anything else?

    I've been testing using like this

    every second => add (block.bullet.speed*0.6)*dt

    instead of the current every tick event, but it doesn't work. the idea was creating a equation that could make the proportional amount of checks but every 1 second instead of 60 times a second

pcfernandesjr's avatar

pcfernandesjr

Member since 12 Dec, 2012

None one is following pcfernandesjr yet!

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies