Ashley's Forum Posts

  • Could you file a bug and include all your system information?

  • Just to clear a few things up...

    Construct runs each tick like this:

    1. Run the events to completion
    2. Run any waits that have expired
    3. Draw the screen

    This means if you have a long-running loop in your events that takes 5 seconds, it gets stuck on step 1. Since the engine is tied up in an event loop it never gets as far as checking if any waits have expired, nor does it get to draw the screen - so you can't show any progress during a loop.

    This is exactly how many other programming languages work, including JavaScript - for example if you add a "click" handler on a button for a web page, and in that handler run a loop that takes 5 seconds, the browser never gets as far as redrawing the screen (or running any timers), and so the web page will appear to hang for the user. It's a common architecture since everything has to be done in a series of steps, each step is not interruptable (otherwise you get bugs involving half-baked states), and it's largely done on the same thread (since multithreading large and complex programs is extremely complicated and highly error prone). So the way Construct does this isn't at all unusual.

    The ideal solution is to actually run the work on another thread, but Construct doesn't support that yet, given the extreme complexity of the feature and questionable feasibility - see this blog I wrote a few years ago on Why do events only run on one core? Therefore the next-best solution is just to run the work in chunks, so the engine has the chance to periodically continue to the other steps needed to run a tick, including drawing the screen.

    An obvious way to do this is to run a fixed number of iterations, like 100000 per tick. However this isn't ideal since on very fast systems it will complete the work early, and sit idle while it waits for the next tick, meaning it doesn't complete as fast as it could; and on slow systems that amount of work could still be enough to make it noticably slow.

    So really the best approach is to do work for an amount of time. So you'd break up work in to chunks of 15ms, for example. This means fast computers get more work done per tick, and slow computers just take longer, while also allowing the possibility to reach 60 FPS if everything else is fast. But! 'Wait' events don't run during loops, so you have to use a timer value that can update during a loop... and in Construct, that's the wallclocktime expression. So you should save that time at the start of the loop, and then repeat until wallclocktime is greater than startTime + 15ms.

    Also...

    In Delphi, there's a repeat:until loop which is a lot like a while.

    As I pointed out in the thread you linked to, this is supported in Construct. A 'While' followed by another condition is equivalent to 'Repeat until condition false'.

    The difference between those is, in a while loop, if the condition is met anywhere in the middle, the loop breaks.

    Almost every programming language I've ever heard of only checks loop conditions upon repeating the loop - so this would be an unusual design if it is the case. The reason most languages only check conditions upon the repeat is that if they can break *anywhere* inside the loop, it makes it extremely slow, since it has to keep doing "is condition false" checks after every single statement, which can be a lot of extra work. So that design would basically make it impossible to write efficient loops.

    Also newt or anyone else who says "just use JavaScript" - that is not really helpful in this forum. There is a separate scripting forum for people who want to use JavaScript. In any posts outside of that forum the assumption should be they are working only with events and only want help with events.

  • You can retrieve the Color property of an object with the ColorValue expression.

  • I would really discourage the use of 'Wait' for building logic like this. 'Else' is definitely the correct way to go. 'Wait' is only when you intentionally want to delay something by a period of time, such as firing a laser half a second after pressing spacebar. Since 'Wait' breaks the normal sequencing of events, if you use it in lots of places for general-purpose logic, you'll probably end up with nightmarish problems where actions and events are all running in an unpredictable order and you can't figure out how to get things in the right sequence.

  • One question Ashley is there any reason not to include wrapping in the plug itself?

    Yeah, that's a good point, I'll see if I can add that in.

  • You can use the desktop download and save the project as a folder, which can be used with source control.

  • It shouldn't matter, because if your math is correct, angles like 0 and 360, or -180 and 180, are equivalent. Normally people run in to problems because their math is actually wrong and it depends on treating angles as linear values, but they're cyclical.

  • It's not a bug. Most browsers only allow audio playback after the user has interacted with the page, e.g. a touch or click.

  • Multiplication has higher precedence than subtraction, so the two equations newt posted are in fact identical.

    If you use a formula like that though the offset eventually becomes a huge negative number, like -10000. That could cause precision issues on the GPU. The best way is to add wrapping with the % operator so the number always stays within a reasonable range.

  • Your text objects are too small to display the full value, that's all. Resize them bigger.

  • Using HTML5 exports on mobile is not supported. You must use the Android or iOS export options.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
    • Post link icon

    It's not feasible to investigate reports that say "it crashes randomly". We need step-by-step instructions that always reproduce the crash. We might need to follow these 10-20 times before resolving the issue, and this becomes impossible if we don't have a way to reliably observe it. The only other option is to rely on guesswork or looking for other factors that might affect whether or not it crashes, but that approach could easily take months longer.

    • Post link icon

    We've been releasing some updates recently in an attempt to address this, but unfortunately without reliable steps to reproduce the problem, or at least some indication of what might cause the problem (e.g. settings that make the problem go away or otherwise fix it), there is virtually nothing we can do. I still have absolutely nothing to go on right now.

  • Please do file a bug - anything that breaks previously working projects is something we definitely want to fix.

  • I have deleted several posts from this thread.

    As far as I can tell, Emac asked a question that was actually unrelated to the plugins/items sold by , therefore they had no obligation to support you with that. They attempted to offer some help anyway, but then it appears the goalposts shifted to whether or not an email (about the unrelated problem) arrived. Considering there was no obligation for to help in the first place this seems like unnecessarily hostile activity on the forum from Emac - consider this a warning.

    I'd remind all forum users to review the Forum & Community guidelines and do your best to abide by them at all times.