Ashley's Forum Posts

  • Waiting 0 seconds will run at the end of the current tick, which may be good enough for what you are doing. Waiting for 'dt' will wait possibly two ticks due to imperfect timer accuracy.

  • The issue should have been fixed in r171. Are you sure this is not the offline cache still serving up the old broken export? Export again to a different URL and load that in Safari to verify if it's fixed without any chance of using a previous cache.

  • This is an extremely complicated problem and even designers of top commercial RTS games struggle with it. There is not a clear, easy solution that works well in all cases. It's something you're going to have to experiment with and come up with something that works reasonably well for your own game.

    • Post link icon

    ashesh - you are not allowed. In fact you are not allowed to sell any unmodified content that comes with Construct 2 for free.

  • Irbis - where would the warning go and under what circumstances should it appear in such a manner that it is not a simple irritation to those whom the problem does not affect? It is not trivial even to display a warning, and the workaround is trivial, you just need to throw in a 'set layer visible' action.

    • Post link icon

    Why would you possibly want to sell a game that is available for free with Construct 2? No, I do not believe this can be allowed, since users will think it's a scam if they had to pay for something they could have got for free somewhere else.

  • As described in this tutorial, you can use the Browser object to detect an update is available and then reload the game to start using the update. This means even on the first play back you can get them playing the latest version.

  • eli0s - both lights are set to cast from 'all'. You need to change that to 'same tag'. Also note system expressions don't pick objects so comparing the tag and moving the Z order will always move both of them.

  • Your project does not appear to contain any .m4a files at all. IE and Safari cannot play .ogg, so you must also have .m4a files for those browsers to play audio. Refer to the manual for more information.

  • Just open the Chrome console (ctrl+shift+J) and it tells you what it's doing, e.g. checking for an update, downloading an update, then it tells you when the update is ready. After that hit refresh and you get the latest version. It should be pretty straightforward.

  • 1. ExecJS can only return strings or numbers, so make sure the JSON is stringified and not a raw JS object.

    2. I would strongly recommend always using the Javascript SDK instead of executing JS strings directly.

  • It looks like peers update ControllingUser, but that information is never sent to the host, so the host never knows which players are trying to move the token. If the host never moves the token, on the peers any changes will be overridden as the object is synced with wherever it is on the host.

    In general anything the peers do needs to be sent to the host, and then the host actually does it.

  • You can't unfortunately, so you just have to set it on start of layout/on created instead.

  • It's styled by the browser. On other platforms it can look completely different. If you want a fixed styling, perhaps just use a tiled background and set its with to represent progress or something like that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The 'shadow length' problem is difficult to solve. As I noted in the original release notes: "Avoid placing radius-based lights very close to, or even over, shadow caster objects. The algorithm can fail to render a full shadow in this case.". The way the algorithm works is by extending the edges of the objects by a length and filling in the resulting polygon. As you can see from your screenshot the object is very close so the shadow extrudes at a very shallow angle either side of the wall (almost horizontal). This means it doesn't quite end up below the bottom of the screen, then fills across horizontally, not fully filling the shadow area on the screen. I've extended the extrude distance a bit further for the next build, but it's difficult to 100% solve this without extending the polygon for tens or even hundreds of thousands of pixels, which seems like a bad idea (some GPUs might struggle if you send them ridiculously enormous geometry). As the release notes say the best thing to do is just avoid putting lights with a radius that close to the shadow caster, e.g. by putting the light inside an object with an even bigger radius, and only moving the light where the bigger radius is clear of shadow casters.

    The multiple lights problem can be solved with a shader (which I've added for the next build). Is what you want is to have 2-3 lights and have shadows only appear where none of the lights can reach them, otherwise having full visibility? If so you can do it (from the next build) like this. For simplicity I've used an example of having 2 lights.

    • place 2 lights on the same layer with 50% opacity
    • notice that the areas that neither light can reach have 75% opacity (which is what you get when rendering 50% opacity on top twice)
    • apply the (new in the next build) Alpha Threshold effect to the layer, and set the threshold to 70
    • now you get 0% opacity (transparent, full visibility) where either light can reach, and 100% opacity (opaque, no visibility) where neither light can reach.

    With 3 lights, rendering 50% opacity three times results in 87.5% opacity, so a threshold of 80 should work. However the result is, although correct, very strange. I'm not convinced it's what you really want. You get a very unusual pattern of scattered black triangles in odd places, which just so happen to be the intersection of shadow for all three lights. IMO the original example of just using ordinary opacity looks better, but then it doesn't fully obscure areas none of the lights can reach. This again is achievable using additive blend. If you have 2 lights on a layer with 'force own texture' set to yes, opacity 50, and each light using additive blend, then you get a build up to opaqueness instead of just becoming less semitransparent. In other words 50% opacity rendered over 50% opacity with additive blend results in 100% opacity (opaqueness), instead of 75% opacity like you would get with normal blend. IMO this result looks better: instead of weird scattered triangles, you get a clear distinction of full visibility where both lights can reach, 50% opacity where only one light can reach, or fully opaque darkness where neither light can reach. Adding a third light and dropping the opacity to 34% would create a similar three-stage effect and so on. This is already possible in the current build.

    In short with creative use of blending, opacity and layers, you can already do some interesting multi-light effects - and with shaders (such as alpha threshold in the next build) you can do even more.