R0J0hound's Recent Forum Activity

    dop2000

    You can uninstall specific windows updates from the "programs and features" program in control panel. You can also block windows update from re-installing it with a tool by microsoft or you can temporarily disable updates by setting your network connection to be "metered".

    The microcode updates, seem to be applied per boot so they aren't permanent from what I read. Unless you manually flash a new bios.

    I suppose it makes sense that the Meltdown/Spectre patches are the cause of the slowdown. It looks like the patches rolled out January 3, although one of the big forum topics about things being slow was around the 31 or December before the patches, unless they did some unofficial patch work in a previous update.

    Anyways, there seems to be a registry key that can disable the patches for testing purposes. That could be something to test for someone affected by the slowdown.

    My guess is it's after a particular windows 10 update that things got slower. Maybe we can pinpoint which one? Here's a lest of them:

    https://support.microsoft.com/en-us/help/4058258

    The other topics on similar performance issues seemed to stem from late December. Anyways, here's a list of users that posted their win10 build version and said they were/were not affected. I appended the date of the update, or date range when the exact build wasn't specified.

    For anyone who wants to find the exact build of your windows 10, open up notepad and click on help->about.

    Affected:

    dop2000

    16299 (10/17/17 - 1/31/18, but i assume the latest)

    --- also mentioned on another thread that after the 1/3/18 update things felt slower.

    BackendFreak

    15063.850 (1/3/18)

    Unaffected:

    R0J0hound

    10586.633 (10/11/16)

    RetroInsight

    15063 (4/5/17 - 1/17/18)

    NN81

    15063 ..

    So far the update in question is sometime after April 2017. Maybe the change log could give some revelation of why things are now slower. At the very least I may get an idea when to stop getting win10 updates.

    NN81

    What's the exact build number you're using?

  • Updated links in my original post. It’s more of a way to do keyframe animations. The tweening from one thing to another is only a small part of it.

  • It's "scroll to player.x, player.y" if unbounded scrolling if off. If it's on, it would be:

    scroll to clamp(player.x, OriginalWindowWidth/2, LayoutWidth-OriginalWindowWidth/2), clamp(player.y, OriginalWindowHeight/2, LayoutHeight-OriginalWindowHeight/2)

    But eh, it's fundamentally the same, except the layout sizes are different, and the result of some of the calculations are saved to variables. Coding doesn't have to be so verbose.

  • You could do something like this to generate it in one go. It's also if you don't care about the upper bound.

    array: set size to (0,1,1)
    
    set v0 to -1
    set v1 to -1
    set v2 to -1
    
    repeat 10 times
    --- set v2 to v1
    --- set v1 to v0
    --- if v2 +1 = v1 
    ------ add int(random(2,10)) to v0
    --- else
    ------ add  int(random(1,10)) to v0
    --- array: push v0 to back[/code:3q6v6xg8]
    
    But if you want all the values to be within a range you can do the following.  Note: this will hang if you can't possibly have 'num' values without 3 consecutive values below 'maxVal'
    Anyways, barring any typos.
    [code:3q6v6xg8]array: set size to (0,1,1)
    var num =10
    var maxVal = 30
    
    repeat num times
    --- array: push int(random(maxVal)) to back
    
    array: sort
    
    //// get rid of duplicates by making consecutive
    var shift=0
    for "" from 1 to num-1
    --- add shift to array.at(loopindex)
    --- if array.at(loopindex) = array.at(loopindex-1)
    ------ add 1 to shift
    ------ add 1 to array.at(loopindex)
    
    /// get rid of three consecutive numbers sequences
    set shift to 0
    for "" from 2 to num-1
    --- add shift to array.at(loopindex)
    --- if array.at(loopindex) = array.at(loopindex-1)+1
    --- and if array.at(loopindex-1) = array.at(loopindex-2)+1
    ------ add 1 to shift
    ------ add 1 to array.at(loopindex)
    
    //// shift stuff back down so the last number in within the maxVal
    var i=0
    while
    array.at(num-1) >= maxVal
    --- set i to int(random(1, num))
    --- if array.at(i) > array.at(i-1)+1
    --- and if array.at(i-1) =/= array.at(i-2)+1
    --- and for "" from n to num-1
    ------ subtract 1 from array.at(loopindex)[/code:3q6v6xg8]
    
    edit:
    bruno's example would fail if z ended up being 0.  Also it could still give three consecutive numbers.
  • It’s getting a color off anywhere on the game canvas that’s not reliably possible with webgl without some changes to the runtime. Getting a color off the pasture texture with webgl however is possible, and actually the webgl snippit in that link is close to how it would be done.

    It’s not something I’m willing to do though. There are too many more fun ways to spend my time.

    Anyways, cheers to black hornet for porting it to a c3 addon.

  • If you give the object two instance variables: radius and ang

    Then you can do this

    Moon: on created

    —- moon: set radius to distance(planet.x, planet.y, moon.x, moon.y)

    —- moon: set ang to angle(planet.x, planet.y, moon.x, moon.y)

    Every tick:

    —- moon: add 100*dt to ang

    —- moon: set position to planet

    —- moon: move self.radius pixels at self.ang degrees

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I fiddled with it a bit more, didn't find any worthwhile changes.

    On a performance note I get 6-7 fps on my machine. I made the entire thing in javascript completely independent from Construct and got 22 fps, but that's also with a 360x360 grid instead of 50x50 and I'm not doing anything fast with the rendering.

    I found that fun. I'm probably going to do that sort of thing more and more. No engine, no editor, completely diy, and no limits. Completely carefree, and it actually isn't harder and doesn't take much longer than doing it in a game maker. Sorry for the off-topic tangent, it doesn't help with the op in relation to this software.

  • I don’t think that will work. You’d have to make sure to only update it if it won’t be touched again in the loop. Then you’d also have to update the remaining ones after the loop finishes. I think it’s overly complicated for what you’re doing.

    Even at 60fps the water will spread slowly. This was so water wouldn’t go negative. Never letting it go below zero is a fix to that but the total amount of water would change.

  • bbjGames

    I actually didn’t measure if it’s that much slower, so I’m probably mistaken. It does move slower but that’s just to prevent water from going negative. There is likely other ways to do this that are faster.

    The other game wasn’t made in Construct so there’s lots of things he could have done to make it faster.

    Events are basically interpreted, so there’s that. If you made a plugin with JavaScript to do the water calculations there it would be a lot faster since JavaScript is jit’d into machine code.

    dop2000

    I guess I’m not seeing what you mean from the pictures. The water will try to flow downhill when it can. If too much water is added to one spot the water spills over in every direction. Given a bit of time it should settle down to the valleys. So if anything it solves it too slow. I haven’t based this on any existing algorithms so I’m probably not doing many parts of it the right way. Even after posting it there are things I want to try to do differently.

    The idea behind it is simple enough. I take two adjacent cells and calculate how much water to move from the higher one so the two are level. If there is enough water that is.

    The tricky part is doing that with the four adjacent cells at once and keep things unbiased. I’m also trying to keep the total amount of water the same as it moves around. The only problem so far is it flows too slow in large quantities, but given enough time it will level out.

  • Here's an unbiased version. It required looping over the array twice, which was bad for performance.

    https://www.dropbox.com/s/ekvw5ukgmr4d7 ... .capx?dl=1

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound