Funky Koval's Recent Forum Activity

  • [quote:3rex9113]But by that logic wouldn't ceil(1.9) return 1?

    Mistake on my part. I meant "not less".

  • I'm aware of how the ceiling function works. It returns the smallest integer not larger than the input. In the example I posted, ceil(0/2) gives 1. 0 divided by 2 is 0, which is an integer, so ceil should return 0.

    EDIT:

    I see what you mean. Whenever a number formated as a non-integer is passed to ceil, it takes the next one, even if that was a whole number. Ceil (1.0) will give 2. I still consider that wrong behavior, since even written as 1.0, 1 is an integer.

    Additionally, the floor function works as expected. floor(1.0) will give 1, not 0.

    Thanks for the explanation.

  • Posted. Bug 3305933 for those interested.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok. Found the issue. It has to do with the ceil function.

    If

    ceil(0)=0

    and

    0/2=0

    then

    ceil(0/2)=0

    right?

    Well, for Construct, ceil(0/2) is actually 1.

    And that's causing the Distortion Map to actually pull values out of the array's range...

  • I'm aware that Construct array are 1-indexed, that's why all of the distortion array coordinates have a +1, like so:

    X Distortion: Array((floor(LoopIndex/2)+1),((ceil(LoopIndex/2)-(LoopIndex/2))*2+1),1)

    I'll try the nested loops approach, though. Thanks for the help.

  • I have a sprite with a 1x1 distortion map. The vertex positions are thus (0,0) (0,1) (1,0) (1,1). Four points in total. I also have a 2x2x3 array which stores precalcualted distortion values. X is Column, Y is Row, Z is distortion in X,Y and Z. Since I have 4 points, I have a looping event (looping 4 times) which updates each vertex with the proper distortion values. The problem is, no matter what I do, the last row never acquires the displacement values at all. They are in the array.

    For"" from 0 to (Sprite.MeshRows+1)*(Sprite.MeshCols+1)-1

    ->

    Set Absolute Displacement at

    Row: floor(LoopIndex/2)

    Col: (ceil(LoopIndex/2)-(LoopIndex/2))*2

    X Distortion: Array((floor(LoopIndex/2)+1),((ceil(LoopIndex/2)-(LoopIndex/2))*2+1),1)

    Y Distortion: Array((floor(LoopIndex/2)+1),((ceil(LoopIndex/2)-(LoopIndex/2))*2+1),2)

    Z Distortion: Array((floor(LoopIndex/2)+1),((ceil(LoopIndex/2)-(LoopIndex/2))*2+1),3)

    The formulae seem correct to me. The only way I found to mitigate the problem, was to add another row to the distortion map - basically adding empty space to the sprite and doubling its height -then my second row would acquire the distortion values while the third one would not.

    Any help would be most apprectiated. Thanks.

  • The problem doesn't seem to be related to the codec. I've just tried an uncompressed AVI, but the issue persists.

  • I'm having a problem with the AVI object. Basically, I need to play a movie file then skip to the next layout and then exit the game.

    I'm using the Timer behaviour to check the time passed since layout start, and as soon as it reaches the duration of the AVI file, I tell it to switch to the next layout. The problem is the AVI object does not dissapear - it is still visible on top of my second layout. In addition, when the second layout finishes and the game is supposed to exit, it crashes with a program error, which seems to be AVI-related - without the AVI object, the game exits fine. I've already tried various forum suggestions, such as disabling the XAudio2 object, but it doesn't help.

    I'm running Windows XP 64-bit with Service Pack 2 and the latest stable Construct. Tried it with the .44 unstable build, but the problem persists. The video was encoded in Mpeg-4.

    Any solutions would be much appreciated.

  • The Destroy action for the AVI object seems to be missing.

Funky Koval's avatar

Funky Koval

Member since 28 Mar, 2010

None one is following Funky Koval yet!

Trophy Case

  • 14-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies