Toby R's Forum Posts

  • Here it is fixed in the way you started: https://drive.google.com/file/d/0BwT_0lczDpc9Vndva1ktMlgtUnM/view?usp=sharing

    But just FYI, it is not the best approach for a flappy bird. You should use platform behaviour for the bird instead of physics (physics are much more CPU consuming, so use it only when you really need physics behaviour). Also background should move infinitely and player should remain in one position (X position I mean). So you just make an illusion that player is moving forward.

    There is an example template built-in in C2, you should check it out and investigate. That will give you a better picture.

  • I'd agree in a way with newt and You shouldn't worry too much about hackers. I'm not saying you shouldn't secure your app at all, but just don't freak out. If you want to secure it completely, this will be a neverending fight as they will find a new way for your new securities all the time. If you both (hacker and you) get stubborn enough this will be a ping-pong game between you both.

    So I suggest to secure it from the noobies-hackers and kids with some cracking soft and that's it. They are the majority of problems. Real hackers which dive into your code and search the way to bypass your security are really minority. And well if they struggled to do it... take it as a complement, it means your game was worth a hassle.

    From my experience, the noobies-hackers are less than 0.5% of your game users. In my case it was 0.2%. The real hackers are far less part of your game community.

    Now keep in mind that most of the noobies-hackers have no idea about anything related to development. Someone showed them a tool and they simply use it. So if you want to get rid of kids who make direct changes in your storage, simply encrypt the data - this step should already discourage most of kids.

    For data encryption you have to use some two way hashing algorythm like Base64. So you could encrypt and decrypt data. Also don't bother to encrypt/decrypt all the values separately. You can use one LocalStorage key "gameData" and save there encrypted Dictionary JSON which you can then load and decrypt on game start. In that way "hacker" will see only one local storage entry containing some mystery hash and you will have your data loaded in RAM memory.

    You can go a bit further and give some salt to the encryption process in case there is one smarter kid who heared of Base64.

    Much more secure would be to have all data on your server in some database and sync this data each time user spend resources. But this is pretty complex to do for someone who is not experienced in PHP/MySQL or any other backend technology as you have to secure your data transfer as well. If you have time, then go learn it, backend technology is very useful and fun, if not then encrypting storage should do the job for kid-ackers.

  • Backend part for such a tool is really nothing fancy. If you make it with some lightweight framework (or even just some libs) and cache it with APC for instance then you can handle pretty anything. It's lightning fast on an average server with some decent amount of Apache forks available, so I wouldn't worry about the PHP.

    Thanks for your opinion by the way .

  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.