Ashley's Recent Forum Activity

  • thehen - feel free to hack the physics behavior to try it out.

    Box2D uses a different collision engine to C2, which is continuous, so you should never get teleporting with the physics behavior. If the time step becomes too large and the physics engine becomes unstable, I guess anything could happen - including arbitrary velocity limits.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh, I see. It depends on resizing the browser window. I'll try get this fixed for the next build.

  • Yann - that's a great screenshot, and shows the truly ingenious levels of sprite re-use that professional games use, and you hardly notice unless you look carefully. Construct 2 makes this convenient too since you can take a sprite and scale it, rotate it and copy to different layers. I think even the original Mario got away with using the cloud image for bushes, but with a different palette to change the color to green. So there's a long history of this kind of trickery!

    Arima - the memory manager only works layout-by-layout - it currently makes no effort to release textures mid-game. It will only release anything when changing layout. It tries to pre-load everything on a layout when the layout starts, but it does this by looking at which objects are placed in the layout view initially. If you create an object not initially in the layout view, it still has to load the texture at the moment you create it, which can create a pause.

    Modern 3D games use a technique called texture streaming, which is where they load and unload textures dynamically as you move around. However they have two advantages in doing this:

    • they support threaded texture loading, so they can load textures to the GPU in the background without pausing the game. WebGL doesn't support this yet, although I think the group working on it want to add support using Web Workers or similar.
    • they are 3D, which means they exploit distance. If a texture has not been loaded, the object will appear a solid colour. However it will generally load textures as you approach objects from a distance. So at first they are usually so small in the distance you can't see any texture detail. The texture usually gets loaded before you can approach and see any detail, meaning it's a pretty seamless experience. In 2D, there is no distance, so objects will simply appear as holes in the level until they get streamed in. This makes it more difficult to ensure textures are always loaded by the time you scroll to them - especially difficult if you can scroll very quickly in unpredictable directions.

    So we could improve texture streaming capabilities in C2, but the tech isn't quite there yet, and it would still be hard to use. I'd still recommend taking the composition approach (Rayman style). Not only does it make the game use a lot less memory, it also makes the download size considerably smaller, which is especially important for web games.

  • Hmm, that's a bit of an oversight. You can't add No Save to those objects right now (or Persist). I'll see if I can come up with something to fix that.

  • Arima - it's hard to avoid mid-game pauses from the textures being loaded and dumped on the fly with that method. Also C2's texture management isn't expecting you to do that, so it might keep textures in memory and still accumulate up to the full layout memory size.

  • The existing Dictionary object is a good substitute for the INI object. INI is an ancient format from Windows 3.1, obsoleted in Windows 95, and has some ridiculous limits built in to it. It really needs to die. Dictionary can store data in a very similar way, without limits, in a modern standardised format that is easily interoperable with other services.

  • You do not have permission to view this post

  • Is it just because all their avatars are the same? I didn't think our site let anyone sign up more than once with the same email, maybe Tom can investigate. Still, could just be one person who really loves your game and wants to show off their scores :)

    (If I was a hacker I'd enter 2^31-1 as the score, but maybe that's because I'm not really a hacker, heh)

  • Well, a left arrow is U+2190. A lot of spritefont engines don't support non-ASCII characters, which is quite a big limitation (good luck if you speak a non-latin language). Luckily C2 and all modern browsers support unicode, so you should be able to do something like: if keystring = "?", set to "left arrow".

  • What exactly goes wrong? We can't help without a detailed description of any problems. Note you have to submit a few scores before the hi-score table appears.

  • The only way to solve this is to use framerate dependent physics. It's one of the few cases where you should avoid dt.

    The Box2D manual explains this issue a bit:

    ox2D uses a computational algorithm called an integrator. Integrators simulate the physics equations at discrete points of time. This goes along with the traditional game loop where we essentially have a flip book of movement on the screen. So we need to pick a time step for Box2D. Generally physics engines for games like a time step at least as fast as 60Hz or 1/60 seconds. You can get away with larger time steps, but you will have to be more careful about setting up the definitions for your world. ... generally you should use a time step no larger than 1/30 seconds

    Basically physics engines become unstable with large time steps. I guess the error compared to the "true" result gets really big. If you use dt as the time step, then the FPS gets really low, dt becomes big and the physics will become unrealistic. The only solution is to use a fixed timestep and let the game go in to slow-motion. (Increasing the iterations to improve the simulation quality will reduce the FPS even more!) 10 FPS is usually unplayable anyway, are users really getting that bad results?

    The Box2D manual actually recommends against a variable time step for stability reasons (and dt can have quite a lot of variation). That's part of the reason physics defaults to a fixed timestep. It's still nice to have framerate independence, but I guess Physics is unique in that it can cause problems, and it might be less bad to use fixed stepping.

    Edit: I guess we could add a maximum time step for Physics, to be 1/30. So it's framerate independent down to 30 FPS, then slows down the motion beneath that.

  • Hmm... I guess this is a trickier problem than I thought.

    But how does your custom engine solve this? Even using events, Construct 2 will still register a collision at the entrance of a 25px tunnel and stop you moving down it, right?

    Surely the easiest thing to do is just use a 1px smaller player object with a transparent background. Then the 1px thing is hardly noticable.

Ashley's avatar

Ashley

Online Now
Early Adopter

Member since 21 May, 2007
Last online 3 Nov, 2026

Twitter
Ashley has 1,835,577 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
  • x6
    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
  • x44
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

32/44
How to earn trophies

Blogs