Toby R's Recent Forum Activity

  • I've built several of those leaderboards for my customer's games but haven't built the universal module yet. I'm quite bussy recently but it's surely on my TODO list. Will post it on the forum once It's done.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nope, there's no popup for JSON data.

  • Looking for a freelance effects artist designer who can provide such blitting animations like this one

    .

    It is a paid offer of course. I need several of these asap and than some more in the near future. Please send some portfolio (links) and your price (preferably per animation) to tobyr[at]wtfgamesgroup[dot]com.

    Cheers!

  • I believe static variables are not effected by a change in layout according to the manual:

    If the variable is marked static in the Event Variable dialog it will persist its value permanently, like a global variable.

    yours

    Winkr7

    Yes you are right. I usually set static values on gorup toggling, that's why they "reset" for me, but actually I am reseting them. So correct - they do not reset by default after restarting the layout. Thanks for pointing that out.

  • Regarding data holding:

    Non static variable keeps it's value only for a one tick. So you can use it for various calculations per tick and you don't have to reset this variable as it gets reset by the engine at the end of current tick.

    Global variable keeps it's value all the time. If you want to reset a global variable then you have to do it manually or use system action to reset all globals.

    [EDIT]: Static variable keeps it's value all the time like globals. Difference is in the scope.

    Constant keeps it's value all the time, but you cannot change it's value programmatically. You may think of it as of a helper feature.

    If you need to use a callback in many places, or some Dictionary or Array index, then you would need to type it manually everywhere. Once your game evolves and you have to change indexes for instance, you would have to change it again in all those places. Now when you create a constant with the index value and use use it instead, you can change only constant's value (one line) and all the indexes will be changed.

    Also Array.At(objectId, ATTACK_DAMAGE) is more human readable than Array.At(objectId, 0).

    Constants help you maintain your code, give better readability and are strongly suggested to use for any data which will remain untouched the whole game. Also they do not affect performance in any way so don't worry about that. They are here to help you, it's wise to use them whenever it's possible.

  • In addition to what spacedoubt said:

    • You can pass a parameter to the function, which you cannot do for groups.
    • Toggling a group takes effect in the next tick while triggering a function takes effect in the same tick

    It is true that you can in most common cases use functions or groups and you will have the same effect. You can add "Trigger once" to the gorup and the code will run only once - like in a function. But it's not always replaceable and it's much about semantic to use both in a right way.

    Groups help you encapsulate your code and mainain the overall performance by smart toggling. Functions are more like helpers for common (for your project) actions.

  • The engine loads only those assets which are needed for the layout. Once you switch to another layout, engine will remove all (with the exception - read on) assets from the memory and load those which are needed for the new layout. if layout1 and layout2 have common assets then those common ones won't be removed from the memory, they will remain in the memory to avoid a pointless reloading. So it is done in a very decent way.

    So this will work, but in this case as I understand you want to make 2 layouts for each - let's call it - level, so you'll build your games twice inside one project.

    You have to ask yourself if it's really worth it. C2 engine has really good up/down scaling so you might consider using assets with a quality in between. Also C2 gives you several features/options to manipulate the rendering quality programmatically, you might find this useful instead.

  • Hi Ashley,

    Would it be possible to allow to create a generic names for functions based on constants?

    At the moment the situation is like below:

    And it's understandable. But since in C2 functions are always global it would be nice to allow to make a kind of generic function names for code which could be easily reusable.

    For instance I use my "pushWall" module in several places which has a generic callback depends on the currently processed action. I know I can use a static callback and pass parameter to detect action but that forces me to create a dedicated place for handling all callbacks, which brings mess to the code as I want to keep everything encapsulated as much as possible.

    So basically it's all about removing the restriction (obviously only for constants) visible on the screen above. Would you consider this change?

  • Well it's not really true that everything can be hacked. Of course your "system" security is not only encryption of data transfers, but your server setup, gateway, firewall, browser and bunch of other things depends on the system.

    But these are usually pretty well done. It's not the weak encryption of data which usually fails. It's human who usually fails. Let's take Kevin Mitnick for instance. He is considered the most famous hacker in the world. There are books and movies about his life. Even such a guy as Kevin wasn't always able to crack/hack things in let's call it "digital way". He was doing more personal tricks. He talked to lady who was working in some company to get some information in a tricky way etc. So hacking is much more than fighting with encryption, scanning ports, sniffing network etc.

    I am not an expert in security but as I am aware there is still no super computer in the world which can break 8-character UTF password encrypted with some one-way encryption like SHA1 during average man's lifetime. So there is no way to actually crack encrypted data, but there are ways to by-pass encryption.

    What is usually enough to sleep stressless is SSL + params salted encryption with API-KEY. Companies from around the world use it by default for their webshops etc. This is a standard which is simply enough for e-commerce so I am sure it is enough for indie game industry as well. Just don't leave your data transfers plain text and you're quite fine .

  • Just a few notes from me.

    1) Resolution= the best resolution is 650,350 or 800x480 once you start going into 960x640 your in game graphics will be much larger and take longer to load. Yes you can make a smooth running game at higher resolutions but it will be much harder.

    960x640 is fine these days IMO. Just don't go for full HD yet. Dowscaling hurts a bit. Also worth to mention that you should not make a static resolution for mobile devices as there are different ratios.

    3) Collision Checks= Construct2 is great at detecting collisions in a pixel perfect way. That said if you have sprites that don't have collision events, turn off the collision detection. That will be one less collision that your device has to compute and check for.

    Collisions are being checked only for objects which have collision events. And only for those instances which are within each others collision cell.

    Setting collision to disabled for objects that are not "coded" will not impact the performance at all.

    4) Graphics Size= Make your graphics the right size for example don't make a 400x400 sprite then resize it in the layout screen to 200x200. No the memory footprint is still 400x400 . Go into your graphics editor like gimp and resize the sprite correctly. If too many graphics are too big, you will get the black screen.

    If your game resolution is small and you set both your sprite and it's image to 200x200, you will lose quality while upscaling. In other words you will have bad quality image on modern device with Full HD resolution.

    I suggest always use an image of at least 1.5x the sprite object size. So use image 300x300 and resize it in the project to 200x200.

  • Yes but still if you want a global layer. You have to add it to each layout. So you have to do something 100 times anyway. That was my point.

    Black sprite can be generated in some common event sheet. So it's not much work.

  • blackhornet Still you need to add 100 layers if you don't have such already.

    Another option might be to create a black sprite (on a top layer) to cover the whole screen and manipulate opacity of that sprite? However that might be resource consuming.

    BTW: 100 levels is not that much... you should be done adding effect within 10-20 minutes... I guess it's worth it.

Toby R's avatar

Toby R

Member since 23 Mar, 2015

Twitter
Toby R has 18 followers

Connect with Toby R

Trophy Case

  • 9-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
  • x6
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

14/44
How to earn trophies