Ashley's Forum Posts

  • Closing as fixed in r186.2.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The browser engine effectively pauses the game when you switch tab. You really don't want to work around this. It will unnecessarily drain battery on laptop and mobile devices, and freezing the game allows it to go in to low-power idle states.

    You can easily check how much time has passed if switching away. Just check the wallclocktime expression in 'On suspend' and 'On resume' (Browser object triggers). So even if the game has frozen because the user switched away, you can still tell how much time they spent, *and* you get to save battery because the game properly froze.

  • Closing, we don't officially support CocoonJS any more, please follow up with Ludei.

  • We haven't made any functional changes to the multiplayer plugin - or the server - for ages. Perhaps you accidentally made some change to your project and mistakenly attributed that to a C2 update.

  • Create a new particles object each time you want to fire a one-shot.

  • Have you got a minimal repro to play with?

  • Sorry about this, botched something in this update. Should have a .2 update out to fix it tomorrow. Don't forget you're opting in to this kind of thing occasionally if you choose to use beta releases!

  • Oh, and remove this line at the top - it's a completely redundant texture lookup which isn't referenced anywhere!

    vec4 front = texture2D(samplerFront, vTex);[/code:ftvktn0g]
    
    That should double your rendering throughput 
    
    Also, tagging @Aurel
  • The renderer is fully premultiplied, meaning the color rgb values are multiplied by their alpha components. For example 50% opacity red is actually (0.5, 0, 0, 0.5), and will still render as full brightness red at 50% opacity instead of a dark "half red" at 50% opacity due to the renderer blend configuration. It's easy to mess up premultiplied alpha in shaders.

    I can't figure out why right now but there seems to be some kind of built in fog calculation which screws up the premultiplied alpha. I don't know why that would need to be in the shader anyway, since if it's linear you can fake it easily with a sprite. If you remove the fog then the alpha blend works correctly.

    Just replace the last few (broken) lines of the shader:

        vec4 color = texture2D(samplerFront, vec2(mod(xx * scale_x, 1.0), mod(yy * scale_y, 1.0)));
        
        //add some fog in the distance
        gl_FragColor = vec4(color.rgb/color.a, color.a*(abs(pz)*15.0));[/code:5se2x7m3]
    
    with this, which skips the fog calculation:
    
    [code:5se2x7m3]gl_FragColor = texture2D(samplerFront, vec2(mod(xx * scale_x, 1.0), mod(yy * scale_y, 1.0)));[/code:5se2x7m3]
    
    Top tip: GPUs aren't good at conditionals. The shader would probably be a lot faster on low-end hardware if the "single_image" conditional were removed. It could be made as two separate shaders instead, each with the mode hard coded on/off. Then you have a blazing fast shader: one texture lookup per fragment, no conditionals, no loops... it should even run well on mobile!
  • Yeah, I tried it out and the autocomplete kind of works better, since it updates as you type and you also get all syntax highlighting/other autocomplete features. This is done for the next build so closing.

  • Should be fixed in the next build, we made some changes to how the function name suggestions work.

  • I looked in to this more and it could be fairly tricky to sort out and take a while. I'd prefer not to spend a lot of time on it if it's not really a huge problem since as ever we get more feature requests than we can address quickly... the easiest two options are:

    1) leave it as it is (my preferred, since it involves no work )

    2) go back to the old way, but list the functions in auto-complete when you type "

    What do you think is the best way? How about if this same change is extended to animation names, layout names etc - would you want the same solution?

  • That's what letterbox scale mode does. CocoonJS doesn't support letterbox scale so falls back to scale outer. Just choose scale outer if you want the same on other platforms.

  • Do you have the latest updates installed? I think it's VS2013 Update 3 now.