tulamide's Recent Forum Activity

  • dps is a complex theme.

    It involves the player's hit rate and strength, and the enemy's defense:

    If the player hits 1 time per second with a strength of 20, the dps is 20. If the enemy has a defense of 50%, it will take 10 hp per second.

    If you change the player's hit speed to 5 times per second, the dps is 100 and the enemy would take 50 hp per second.

    Or instead change the strength to 10, the dps is 10 and the enemy would take 5 hp per second.

    Or change the defense to 20%, dps would still be 20, but enemy would take 16 hp per second.

    Another way would be to not have any strength on the player's side, but let the enemy suffer as long as it collides with the player. Then you'd do something like

    + As long as they collide

    -> reduce enemy's hp by 20 * TimeDelta

    This would let lose the enemy 20 hp per second as long as they collide, no matter how often the player actually hits (animation-wise)

    I don't know much about ticks and how they work.

    This post was once written to help people using "else", but deeply explains a tick also :)

  • So this is what I found out:

    The issue occurs if the display size and the window client size don't match. This happens when you set the window size in the application properties to a value higher than screen size minus something (couldn't find out how much exactly is subtracted and why; it's 38 pixel in height for Bartosh, but 20 pixel on my FullHD resolution). It happens because Windows interferes and changes the size for the window, but Construct isn't aware of the size changing.

    For example, I set a height of 1080 in the properties. Construct will set the display height to this value also, but the real height is 1060. This difference of n pixel seem to provoke the zoom issue.

    There's a solution: I provide a cap showing a way of changing the size safely without using the application properties. You still can't set the window larger than the screen size (minus something^^), but who would want to do this anyway? But you won't have that issue anymore, even if you go past the screen resolution (it simply detects the "real" values, after Windows interfered)

    zoomIssueSolved.cap

  • It really is hard to tell, where that issue comes from. But I never heard of any other application producing it, so it might be a CC-specific one.

    when you use the window/sysinfo object to change the resolution it makes it smaller than max client resolution

    such as : my display high is 1050, and that is what the system info says, but when it changes my window size, it sets it to 1012 witch I take it is the safest resolution to run at before the offset happens.

    I can tell for sure that setting the client size is pure windows api calls (I know that, because I implemented them). I guess Win catches the calls and somehow reserves some pixels for the task bar, if the height gets higher than the resolution. But that really is wild guessing.

    I'm currently testing a few other things related. Will report soon, found some crazy behaviors.

  • The sine behavior just sets the sprite's properties. You can reset them by just entering the original values. For example, if sine behavior changes the sprite's angle, add a pv 'startAngle' to the sprite, set it to Sprite.Angle at start of layout, then whenever needed, set Sprite.Angle = 'startAngle'.

  • It's not the layer effects, it's the combination of demands that provoke this error. With resizing disabled the display is forced to stay at 640x480 while zooming forces to show a greater or smaller area and somehow this leads to the unwanted effect. (At least that's happening to me, when I go past 1920x1080 without any layer effects)

    You don't have that issue when using the window- and sysinfo-objects for changing window sizes, but it is a hassle to fake a smaller display size in the window and keep the aspect ratio.

  • And here's another (maybe more lightweighted) way: unique_random.cap

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's good news for C2 users. But to be honest, it is not one of the most important features to have, at least for me. <img src="smileys/smiley17.gif" border="0" align="middle" />

  • I'm not sure how you've set up your math. In general, clamp the un-timedelta'd (yeah what a word) values and apply timedelta afterwards. For example, if you'd like to have a gravity value between 100*TimeDelta and 200* TimeDelta, it should read

    clamp(undelta'd gravity value, 100, 200) * TimeDelta

  • I don't know why. But you can use the canvas object for rotated text. Here's an example:

    rotateText.cap

  • Transferring from the graphics card's VRAM to RAM needs 1 tick. So you have to delay the copying to the image manipulator by 1 tick each.

    Here's your changed cap: ImgManip_Canvas.cap

    You could also work with functions and call them delayed. I decided not to use them, because you can only delay a function in milliseconds, but you never know exactly how long a tick lasts. To avoid future issues with a function call coming too early or too late, I made it tickbased.

    EDIT: Wrong file linked. Corrected.

  • I want to share some general thoughts about logical operations. In conjunction with the translation of triggers to variables, it can greatly add to your event sheets being well arranged while covering even difficult parts.

    A logical or is not the same as in our language. If we say "red or blue" we really mean "either red or blue". But a logical or means "any of the conditions", even if both are true. This seems to not make a huge difference, but think about a real world example. Let's say, we want a shirt in "red or blue". We look around the shop and if a shirt is either red or blue, we try it. But with a logical or we would also look for a blue and red striped shirt.

    Consequence: A logical or evaluates to false only if both conditions are false (if there are no red shirts, no blue shierts and no red and blue striped shirts, in the real world example)

    There are situations, where you would need a logical or that behaves like "either a or b", to make it exclusive. That's called a logical exclusive or (XOR). Construct does not provide this, but you can do it with a combination of AND plus OR.

    (global('a') = 1 AND global('b') = 0) OR (global('b') = 1 AND global('a') = 0)

    it would exclusively be only true if either a = 1 or b = 1, but not when both = 1 or both = 0. Take care of the brackets, btw, they show Construct that you first want to logically operate both ANDs and then operate on those results.

    This works because AND only results to true if both conditions are true. Let us have a look at how the cpu sees such an evaluation.

    a = 0, b = 0 given:

    (global('a') = 1 AND global('b') = 0) OR (global('b') = 1 AND global('a') = 0)

    (FALSE AND TRUE) OR (FALSE AND TRUE) => FALSE OR FALSE => FALSE

    a = 1, b = 0 given:

    (global('a') = 1 AND global('b') = 0) OR (global('b') = 1 AND global('a') = 0)

    (TRUE AND TRUE) OR (FALSE AND FALSE) => TRUE OR FALSE => TRUE

    a = 1, b = 1 given:

    (global('a') = 1 AND global('b') = 0) OR (global('b') = 1 AND global('a') = 0)

    (TRUE AND FALSE) OR (TRUE AND FALSE) => FALSE OR FALSE => FALSE

    a = 0, b = 1 given:

    (global('a') = 1 AND global('b') = 0) OR (global('b') = 1 AND global('a') = 0)

    (FALSE AND FALSE) OR (TRUE AND TRUE) => FALSE OR TRUE => TRUE

    Another logical operation is NOT, which reverses to the opposite, so that TRUE Becomes FALSE and FALSE becmes TRUE. By decribing this, you may already notice that Construct does provide this only for complete conditions in the form of "invert condition". If you do this to the example above, it will exclusively become true if either both = 0, or both = 1.

    [inverted](global('a') = 1 AND global('b') = 0) OR (global('b') = 1 AND global('a') = 0)

    is the same as

    (global('a') = 0 AND global('b') = 0) OR (global('b') = 1 AND global('a') = 1)

    End of lesson ;)

  • There were some examples of how to do the "braid" thing (recording the player for later replay, just don't use it reversed), could help here as well. Just look for "braid" or "braid-like".

    Basically, sample the player's spatial data at fixed intervals (store them in s or an array or a hash table) then apply it to the npc with a delay.

    EDIT: Don't know exactly what you mean by stutter, but in case it means the npc could move with sharp transitions, you can work against that using lerp.

tulamide's avatar

tulamide

Member since 11 Sep, 2009

Twitter
tulamide has 3 followers

Trophy Case

  • 15-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

17/44
How to earn trophies