Ashley's Recent Forum Activity

    • Post link icon

    We're not allowed to distribute any Steam SDK files.

  • Well, if you want unhackable software, it's not possible!

    We basically bundle the game data with NW.js and that's it. If you make actual suggestions of changes, I could perhaps evaluate them.

  • I think there's an interesting analogy with fan games. Some people (quite possibly a non-overlapping section of users to those posting here) like to make their own versions of Mario, Sonic, etc. and end up using ripped sprites. Firstly even these big companies can't stop people getting hold of artwork and such, even if they originate from cartridge-based systems. People find ways to rip it, or they just take them off screenshots, promotional imagery, or whatever they can find. Secondly they sometimes get upset when these big companies send them cease-and-desists, sometimes trying to frame it as "just trying to have some fun" (note these companies usually have a legal obligation to defend their work in order to keep their trademarks and such). Ultimately I think the same process will occur with your own games, you're just an indie dev instead of a megacorp.

  • calebbennetts - sure.

    Animmaniac - I really am not very persuaded by other time stepping algorithms. Sure, someone wrote a blog post saying "this is the best way to do it!" but that doesn't mean I agree. The way I see it is you either end up stepping more than the rendered framerate, which means you're burning CPU simulating stuff that isn't displayed, or you step less than the rendered framerate, which means there's nothing new to draw at the next rendered frame.

    Also people are very sensitive to jank/juddering/uneven movement. If the logic is running at a different rate to the rendering, the motion becomes uneven. For example logic at 45 Hz with rendering at 60 Hz means every rendered frame shows alternating step distances, e.g. 10px, 15px, 10px, 15px... given how sensitive people are to this (particularly when scrolling), I think the only solution would be to go for an integer multiple/divisor of the framerate to guarantee every rendered step moves the same distance. E.g. logic at 2x, 3x, or 1/2, 1/3.

    This means then that if you want faster logic than the display rate, it will have to go at least twice as fast, to 120Hz. This also means if your current CPU usage is 60%, you don't have enough overhead to do that, and your game will start lagging. It also will use more battery, make phones hotter, and significantly lower your headroom to do interesting stuff with the CPU.

    If you want slower logic than the display rate, it'd probably have to be 30 Hz. What I don't really get about this is if you only step the game at 30 Hz, there is nothing new to draw in between logic frames. I think some devs propose a "lite" step in between which just advances motion without doing anything else, but this worsens tunnelling problems (new scenario: object actually seen colliding, but no collision registered!), and could still use a bunch of CPU e.g. if it's a large physics game. Also, to reliably schedule at half-display-rate we need browser support.

    Finally the really obvious problem with fixed timesteps is systems which have different display rates. VR is making rates like 90 Hz more common, with plans to make it even higher. Gaming displays that run at 120Hz have already existed for a while. Variable-rate gaming displays like G-sync are now available too. Maybe Apple or Samsung will decide their next big differentiator is to run their next phone at 120Hz to make everything even smoother. It's naive to think everyone runs 60 Hz and will always do so, and then if you only run logic at an integer multiple/divisor, there is no solution - you can't choose a logic rate that covers all these display rates with smooth motion. And don't forget on weak systems fixed-step games go in to slo-mo instead of stepping further to compensate.

    So IMO the existing approach of variable steps has a lot of benefits:

    • with accurate v-sync, motion is perfectly smooth
    • all display rates are accommodated equally (which is also good future-proofing)
    • CPU usage is matched to the framerate and is no higher than necessary
    • slowdowns on weak systems are compensated for

    The downsides include tunnelling with large steps, but this can be mitigated in the main cases, e.g. the bullet behavior in Classic had a special stepping feature specifically to solve that problem, which I always intended to (but never quite got round to) port to C2, or there could be a stepping behavior to handle it. Then this CPU-intensive stepping only applies to things that really need it, rather than the whole game globally.

    The other downside is non-deterministic gameplay. To some extent we can improve this with better maths, as this thread shows. However I've always thought of this like floating point rounding errors: the calculations are never going to be exactly correct, so you always build in a tolerance instead of expecting exact answers. For example even with fixed steps, you can never assume your platform behavior will land at Y = 100, because floating point errors (literally occurring in the CPU circuitry) mean it will probably land at something more like Y = 99.9999999978. Given you need this kind of tolerant approach for that, I always thought this was wise to apply to motion as well, doubly so for the errors in time step. So instead of expecting the player to make a jump within 0.1px, make sure it works with say a 2px threshold (assuming we fix the math), and so on. There are ways to work around other problems as well, for example a record/replay feature could simply record the sequence of actual measured delta-times, and replay them for the purposes of making a deterministic replay.

    So my focus has always been on variable timestep, and then add features to help work around tunnelling and non-determinism if they pose a problem. So my approach for C3 is to add some of those mentioned features. The way I see it, changing the way the stepping works itself has worse downsides.

  • As pointed out, if someone wants to steal content from your game, removing devtools won't help stop them.

    TBH the most effective protection against people stealing your work is copyright law. Whatever technical measures you put in place can be circumvented: if your game can read it, so can anyone trying to steal it. Everything else is just security through obscurity, and anyone who knows anything at all about security knows that's not much security at all.

    Further, adding security can have serious side-effects for legitimate customers as well. Suppose you decide to encrypt all your game's assets. If your game is 500mb big, then on startup it has 500mb of content to decrypt, which could take a while on some systems. So now all your customers - including those who have paid - have a worse experience because you're paranoid someone's going to steal stuff. And they still can - there are tools which can pull the decrypted assets directly out of RAM. So the whole thing is kind of pointless.

  • If you try to sell other people's work on the Scirra Store, you can expect your seller account to be revoked.

  • Remember not to waste your memory

    I don't know why a boundary image would need to be so large - if you're drawing all four edges with a large area of transparency in the middle, that is very wasteful. Just make each edge a separate sprite and place them around the edges. That means you don't need any transparent central area at all, which saves loads of memory.

  • Closing as this is not really a vulnerability, it's no more a problem than the fact you can open Chrome dev tools on any page. It's there by design to help you diagnose any issues with your game, and includes the usual profiler, timeline etc. Even if you removed it, there are still easy ways to "hack" a game, it's not really relevant to that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Okay, I guess we should fix this, but it's a breaking change and would throw loads of existing games ever-so-slightly off. So I think we need a project setting like "enable better acceleration precision", which defaults to on for new projects but off for old projects, or something like that.

  • so basically, my hard drive is half dead, and im still trying to get it in for repairs, but in the meanwhile I decide continue working on a game.

    This is where you went wrong

    C2 also has built-in backup features so you can do things like backup to a Dropbox folder which is pretty resilient - your whole PC could burn down to a crisp, and you can then still get your work off Dropbox.

  • calebbennetts - this is pretty confusing, but I don't think it's the case... it's not that C2 uses the wrong formula, it's that it treats acceleration differently to the kinematic equations.

    The kinematic equation (d = v * t + 1/2 * a * t^2) assumes the acceleration keeps increasing throughout the given time t. So for example if you have a car that starts at a given speed and keeps a steady acceleration, this will tell you how far it will travel in say 30 seconds.

    Construct 2 treats movement as a sequence of very small discrete steps that happen once per frame. Given a frame is typically just 16ms, I never thought to take in to account the effect of the continuing acceleration over that time. So C2 actually assumes the velocity is constant (not accelerating) for the duration of delta-time. However since it updates the velocity according to the acceleration after every step, you still get the effect of acceleration over time.

    Should Construct 2 take in to account the acceleration during delta-time? I guess that would be more correct. However there are two issues: we probably can't change this in the engine itself without breaking loads of existing games (which will all become slightly off), and the acceleration can actually change every tick as well, for example alternating between 1000p/s/s and 0p/s/s every tick. In that case which acceleration should be used for each step, given that there is a different start and finish acceleration and the engine doesn't necessarily know what the finish acceleration is? I think strictly speaking if I were starting from scratch I'd take in to account the starting acceleration over the whole step, but we can't change this now, and I think this is one of those things where as the time step tends to zero it becomes closer to correct, so this is another one of those "discrete steps don't work quite like the continuous real world" quirks.

    Anyway, this doesn't quite solve the stated problem: the jump height can vary depending on the framerate because the calculations take in to account delta-time, which is based off an imperfectly accurate timer in an imperfectly scheduled operating system, so it tends to have small random variations every step. Given the movement over time is a non-linear summation, the small random variations can accumulate and it can change by a couple of pixels by the crest of a jump. Your altered formula is still susceptible to the same problem, because it still uses a randomly-varying dt, although I can see it would reduce the accumulated error assuming a steady acceleration. My solution fixes the value of dt every step so there is no random variation and you are guaranteed identical results every time, which you would still need to do with your altered formula to guarantee identical results as well.

    Still, I'm wondering if a setting to use more accurate acceleration calculations would be worthwhile...

    tl;dr: the problem is a randomly-varying dt, but your formula only changes whether acceleration is taken in to account during the step or not.

  • No, it's running in to a limit in the Windows OS. We never knew about the limit until it was too late. C3 is architected to avoid this problem.

Ashley's avatar

Ashley

Early Adopter

Member since 21 May, 2007

Twitter
Ashley has 1,777,999 followers

Connect with Ashley

Trophy Case

  • Jupiter Mission Supports Gordon's mission to Jupiter
  • 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
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • Forum Mega Brain Made 20,000 posts in the forums
  • x126
    Coach One of your tutorials has over 1,000 readers
  • x74
    Educator One of your tutorials has over 10,000 readers
  • x5
    Teacher One of your tutorials has over 100,000 readers
  • Sensei One of your tutorials has over 1,000,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x42
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

32/44
How to earn trophies

Blogs