R0J0hound's Recent Forum Activity

  • Should be the same with the same file. But I don’t know what the editor is doing. Anyways, keep at it. Maybe you’ll spot the difference. I’m not at a computer so I won’t be able to help.

  • I can’t debug it. So if it’s the same file I’m guessing it should give the same result as the hex editor. If it’s completely different then it seems like a different file or something is completely off.

  • Just use a grid hash or a AABB tree or something if you want it to work with objects being positioned anywhere. Or since you’re building the quad tree on the fly you could guess the bounding box of all the objects, build the quad tree and anything out of bounds is put into a simple list and the correct bounding box size is calculated for the next frame. If things are moving the new bounding box would still be a guess but it would be pretty close.

  • Roughly you’d load the file into the binaryData object instead of text. Then you can access individual bytes. You’d have to convert the byte value to hex to display as text. Then after changing the hex text you’d have to convert back.

    So something like this.

    Start of layout
    — Ajax: set response to binary BinaryData
    — Ajax: request url “” as “data”
    
    Ajax: on “data” loaded
    Repeat BinaryData.ByteLength times
    — text: append function.byte2hex(BinaryData.GetInt8(loopindex))
    
    On function: updateBinaryFromText
    — repeat len(text.text)/2 times
    — binaryData: set int8 at loopindex to function.hex2byte(mid(text.text, loopindex*2,2))
    
    
    On function: byte2hex
    Parameter byte
    — set return mid(“0123456789ABCDEF”, int(byte/16),1)&mid(“0123456789ABCDEF”, byte%16,1)
    
    On function: hex2byte
    Parameter hex
    — set return to find(“0123456789ABCDEF”, left(hex,1))*16+ find(“0123456789ABCDEF”, right(hex,1))
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Basically this?

    function hex2dec(hex)
     — var num=0
     — repeat len(hex) times
     — — num = num*16+max(0, find(“0123456789abcdef”, mid(hex,loopindex,1))
    — return num

    Btw your example is odd to me. W isn’t a hex digit.

  • Some tests of different physics integration methods with different timesteps. I included the platform behavior too to compare, but it just uses whatever dt currently is. It draws a nice graph to compare time vs y. The speed of the jump has to do with the timestep used, so it can be ignored.

    https://www.dropbox.com/scl/fi/sluu3khqb1b0vzw5de0lu/integrationTests.capx?rlkey=0jjkfkcaww1evb03bs4fj9mpu&dl=0

    The results show that leapfrog, velocity verlet, and the platform behavior in c3 all have matching curves.

    You could do similar tests for the 8dir behavior vs an event based one.

  • It’s on Wikipedia.

  • The verlet you’re thinking of is slightly different. It infers velocity from position change which does work well for ropes and cloth.

    Anyways it’s something you can test either way.

  • Your math is off I think. Should be:

    (ScreenWidth-windowWidth)/2

    But You’re doing:

    (ScreenWidth-windowWidth/2)

  • Looks like that method is called leapfrog integration. It averages out changes to acceleration from frame to frame.

    Most behaviors use velocity verlet integration. Which handles constant acceleration motion perfectly no matter the timestep.

    When acceleration changes from frame to frame I don’t think there’s a silver bullet integration method to make it frame rate independent.

  • You mean something like this?

    Repeat 4 times

    — dx= round(cos(loopindex*90))

    — dy= round(sin(loopindex*90))

  • One way would be to only change the variable with a function or custom action. So when you call that you’d know the variable is getting changed.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound