R0J0hound's Forum Posts

  • irina

    There is an image at every 360/sprite.count degrees on rotY. To rotate one at a time you could just change the value over time.

    Here's one way to change a value over one second from one value to another, but there are other ways.

    global number lerping=0

    global number t=0

    global number start=0

    global number end=0

    global number rot=0

    on click

    lerping=0

    --- set start to rot

    --- set end to rot+45

    --- set t to 0

    --- set lerping to 1

    lerping=1

    --- set t to min(0, t+dt)

    --- set rot to lerp(start, end, t)

    --- if t = 1

    ------ set lerping to 0

    Loading images at runtime would require a different plugin that lets a unique image be used per instance.

  • In psuedo events it should be this:

    On click

    --- set viewport size to (layoutwidth, layoutheight)

    --- wait 0 seconds

    --- snapshot canvas as png

    On snapshot

    --- browser: invoke download snapshoturl

    --- set viewport size to (640, 480)

    The wait is so the runtime has a chance to do the change, since it's delayed till the end of a tick.

    If it doesn't work, then i guess it doesn't work. I don't know if the scaling mode, the export method, or anything else has a bearing on it not working. I've had it work in the cases I've tested, but I don't recall what they were.

  • Why not

    X=int(mouse.x/64)*64

    Y=...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here’s the latest one. There are other older ones.

    It’s not really a shame. It seems there is a lot of differing requirements for pathfinding that can’t be wrapped up in one plugin.

  • Set the window size that big before taking the snapshot. You may need to wait a tick first, and when it’s done sit the window size back. I think the action is set canvas size.

    Just use the vanilla c2 features, the paster object is not needed

  • Nothing I suppose. It’s just an alternate way to do it. Personally I don’t use plugins/behaviors as much since they don’t do exactly what I want most of the time. I just find it more painless to just implement it from scratch instead of bending a behavior to my will.

  • No, no problems. It’s great for repeating textures like that. It should be as fast as sprites, perhaps negligibly faster.

  • What they did was probably pretty simple. Each grid was a node and nodes separated by a wall weren’t connected.

    So then it was just a connected mesh of nodes that the path finding was done on.

    I guess what I propose is to do the path finding with events. You can look at any of my astar pathfinding example capx floating around the forum. The only thing that differs from any of them, wether they are on a square grid, hex grid, mesh or even with thin walls between nodes, is how neighboring nodes are picked.

    Or instead of just using those capx you can look at the red blob games blog. It has fantastic interactive tutorials for doing pathfinding algorithms.

    • Post link icon

    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.

    • Post link icon

    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.

    • Post link icon

    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.