Toby R's Forum Posts

  • Hey iOS devs! I want to ask you to share a bit of your knowledge.

    I do not have a Mac not iPhone but I need to have IAP setup for iOS in one project. It has to be exported with Intel XDK. Can you please tell me if there's any plugin which currently works with Intel XDK and iOS? Also if there are any particular things that have to be set up for this platform in order to restore purchases. Basically any hints, code snippets, plugin information setups (both in C2 and XDK) would be much appreciated!

    Cheers!

  • I think it's an obvious YES for every developer as every new market is an advantage for promoting your game, and platform like Xbox is a serious thing. It would be awesome to have as much Xbox Live features as possible to use as it would help a lot with development and open new possibilities.

    Things like leaderboards and achievements are a core thingy and will surely be widely used. Over that It would nice to have Xbox Live user data to allow register player into ingame database in easy way - especially for multiplayer games. I'm not yet fully familiar of what they can actually offer, but again, the more features/tools we have the more possibilities we have and the more C2 devs will be encouraged to make Xbox apps. So a big YES vote - give it all you got .

  • Hi jeffige, I have some more time currently. Please send me details to tobyr[at]wtfgamesgroup[dot]com, I'll reply asap.

  • If it's just about changing skin of the character and all skins have the same animations names then the proper way would be to create an invisible player sprite which will have all control/movement events and each skins as a separate sprite with proper animations groups.

    Now whenever you need to change the skin you simply spawn the skin sprite on the player sprite and pin it to the player. As all your skins have the same animations (walk, jump, attack, ...) you simply run the set animation function with the proper param ("walk", "jump", ...) in a generic way, so one code will work for all the skins.

    Why do you worry about "copy events for each created sprite"? Events go to player and skins are just animations, so you don't need any control, collision or whatever events on them.

    Also this way you keep the code clean and easily maintainable. If it's a big project then I strongly suggest to focus more on proper code rather than on optimisation which in this case won't give you much advantage if you put all in one sprite. Even more... one sprite with tons of frames (all skins) will be pretty memory consuming for no reason as I assume you will not use all skins in each layout?

  • We don't know your project so we can't say for sure, but it looks like you made a bad approach on your feature. There are built-in animations functionalities in C2 which should be enough for you if you plan your feature the right way...

    ...but if your project is so original and you're sure you need to control frames directly then you can simply use Sprite > set frame function. Now to make animation you can use loops or Function + System > wait function. Hard to say what would be the best without knowing what exactly do you need. If you have really small amount of frames then simple Functions should do the job. If it's much more complex then you can even code the sequence in XML or Array and then run some self made generic code to play coded animation sequence.

    In short words there are many ways of achieving what you need but as long as you want to stick to one Sprite animation, then you'll have to make a manual animation with Sprite > set frame.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, the images are decompressed before loaded into memory.

    https://www.scirra.com/manual/183/memory-usage

    [quote:3uv4df2v]First of all it is important to note the image format has no effect on memory use. You can save on your project's download size by setting some images to PNG-8 or JPEG format in the image editor. However this does nothing to memory use: compressed images cannot be directly rendered, so upon loading all images are decompressed in to a 32-bit ARGB bitmap format. This means each pixel takes four bytes for the alpha, red, green and blue channels.

    Consequently, the approximate memory use of an image is simply its number of pixels multiplied by 4. For example a 100x100 image would use 100 x 100 x 4 = 40000 bytes, or about 39kb. A HD-sized image at 1920x1080 would take 1920 x 1080 x 4 = 8294400 bytes, or about 7.9mb.

  • It's regarding RAM memory.

  • I see two options here:

    1. As described in my tutorial mentioned above. Basically you show loading screen at the end of the first layout and you hide it once everything is loaded/stable on the second layout. It doesn't speed up the loading process but at least you get rid of that "freeze" feeling.

    2. C2 engine clears the memory while switching between layouts, but it keeps the objects which are used both in the layout you are now and the one you are switching to. So basically all common objects remain in the memory and there is no need for the engine to reload them. You can use this fact and load the assets you need in the next layout just before switching to another layout (or during gameplay... up to you).

    I think you don't need to place the second layout assets in your first layout. Never tried it myself but simply spawning those objects from the code should do the job.

    There's another trick here. Keep in mind that C2 engine does not load objects which are outside visible area, so spawning an object at position -9999, -9999 won't work. Also invisible objects are not being rendered. So you need to do some kind of dirty trick like:

    a) spawn object at any position

    b) set it's opacity to 1 (almost invisible)

    c) set it's position to overlap visible area (it doesn't have to be the middle of the screen, it can be partially visible somewhere in the corner)

    d) wait 0.017s (that's the duration of 1 tick), not sure if this's gonna be needed but I believe it will to force the engine to load/render the asset

    e) set it's position somewere far away

    Might look complex but if you prepare good generic code then it's just a matter to setup some lines in event sheet for each layout.

  • You should not rely on UID, instead create a string instance variable - let's say - "instanceName". Give each object an unique value/name. Then pick anyone you want by System -> Pick by comparison.

  • Yes, that's precise. Thanks Also worth to mention that it is the same with toggling groups placed in separate event sheets. If you include event sheet below "toggle action" it will take effect in the same frame, if above then next tick. It's common that event sheets are always included at the top (then toggling always takes effect next frame), but it actually matters where you include them.

    Not sure which one is respected if you include the same event sheet multiple times in various places but I guess it's the first one.

  • If you hardcode an encryption key in your C2 apk, they just have to look into your source with apk http://www.javadecompilers.com/apk and they can find it and decrypt anything you encrypted

    That's true, but there's already a need for source digging, so it's much less "hackers". Still you can make combined salt key which will discourage another part of "hackers". But after all it's a client side... the app is in player's hands so smart guy can do whatever he wants. Again I wouldn't worry about this minority. You will spend more time/money by trying to secure your app on this level than by letting them cheat a bit.

  • Ok thank you all for the replies.

    I wonder, the groups. I use groups but just for the cosmetic reason, to make it look better in the events page.

    I do not have any runtime actions about groups. So the events inside group should simply be run top to bottom, right?

    If you're not toggling the groups then your code runs top > bottom all the time. Active groups do not affect anything, no worries .

  • If you trigger a function before any other event, engine will first execute the function and then go back to your events. So it will not run the function asynchronously. Otherwise we would have really big problems with building our apps. But if you use groups then there's a different story. Unlike triggering the function, toggling a group takes one tick. So if you activate a particular group, code which is under this group will be triggered next tick.

  • You do not have permission to view this post