NoticEmpire's Recent Forum Activity

  • I've been looking up my issue some more and it seems like setting the playback rate should fix the problem, but it just isn't working for me. Any help?

  • Hello, I'm looking for a way to keep the timescale audio property on for my project, while also being able to play specific audio at 1.0 speed when the timescale is at 0.

    This is because while I like the slowed down audio effect at lower timescales, I still want to be able to have normal audio play during a pause screen.

    Setting the playback rate to 1.0 doesn't do anything.

    Any help is appreciated!

  • Unfortunately this requires walls to have their angles be the determinant in the bounce calculation, which doesn't work for tilemaps. It also doesn't work for sprites that are collided from all sides and not just the ones the angle calculation would determine the bounce for.

  • alextro I don't want it to be random though. I want it to bounce at the correct angle similar to the bounce off solid option in the bullet behavior.

  • I'm using CustomMovement for my bullets in my game instead of the Bullet behavior for the added collision control with steps (without it any extremely fast bullets go through walls and stuff) but I can't seem to figure out how to replicate the bounce effect.

    Any tips?

  • Can we have some more context? It's hard to pinpoint a cause with so little information.

  • I shrunk the bounding box to be perfectly on the sides of the collision box and that seems to have fixed it. Thank you!

  • Thanks again, seems to be working for the most part but when multiple sprites overlap I encounter issues still.

    Here the table on the left slips under the table below it, and the table behind renders below the table under the table in front of it. The table on the right also slips under stuff it is supposed to be standing on.

    While the change in the code seemed to fix most issues of the player rendering incorrectly, here is the player being rendered behind a table it is above.

    I thought this might be due to the origin points not being at the bottom of the sprite, but they are in this screenshot and the problem still occurs regardless.

    Edit: I should also mention I'm using the BBox collision method instead of the default overlapping.

  • The image isn't loading in my previous post, here is what the code looks like.

  • newt I understand how to sort the z-order, I also understand how to change an object's z-order based on their Y. I'm not doing this in my case because the z-order is affected by a z-axis as well as a y-axis.

    alextro My objects all have different widths and heights and my game isn't isometric, although your formula is quite clean, I really wish it'd work for me :(

    R0J0hound I've tried your sorting algorithm designed for my perspective, and while it works in the capx you sent, it seems to function incorrectly when I try to implement it myself. Since it works for you, there is evidently something I am doing wrong.

    "SOLID_SPRITES_Family" would be equivalent to "Sprite" in your example, and "SOLID_SPRITECOMPARATOR_Family" would be equivalent to "other" in your example.

    The main issue that arose was that some objects just wouldn't sort correctly, and would be placed under ones they should be over. The other issue was that sorting wouldn't occur unless the collision boxes actually overlapped.

    In my game the collision boxes do not cover the full sprite due to how the collision works with incorporating the z-axis. I thought this was potentially the problem, so when testing I made the collision boxes cover the entire sprite like in your example, which didn't fix it.

    I thought potentially it was because the origin point was not at the very bottom of a sprite like in your example. I moved it to the bottom, which did not fix it.

    You may notice that my sorting method is not a 1:1 copy of yours, this is because the z-axis is more positive the higher up an object is in my game. In your example, the z-axis is more negative the higher up an object is. To fix this, I just made the references to the z-level in the algorithm flip (instead of -sprite.z it'd be +sprite.z, I doubt these changes are the cause but I thought they were worth mentioning).

    In the portion where you set dy, using yy, I just do the yy calculation there. I don't think that would affect anything besides performance. I also add z to y instead since z is positive in my case.

    I didn't have an sy value prior to implementing your system, so I added it and set it accordingly for the sprites I was testing with.

    Just so it is easy to understand the difference in variable names, yy is just y+z (in your case it was set to y-z, but I can't do that), z is z (but positive), sy is length, and sz is trueHeight.

    The alternate family has the same sprites as the main, and all its variables are properly synced with the main. SCz is equivalent to z, SCtrueHeight is equivalent to trueHeight, etc.

    Any idea what I've done wrong? Once again, if I've explained poorly and you need clarification please let me know. I really appreciate how helpful you've been.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • R0J0hound Are you familiar with ways to order objects along the z-order that takes into account multiple variables and overlapping?

    (for the sake of clarity z-level refers to my custom 3d system's z-plane, z-order refers to the order in which sprites are rendered in construct)

    I've tried to do a For-Each ordered loop which takes into account the y-level of objects to place them correctly in the z-order. This works for objects with a z-level of 0, but once I start stacking objects on top of each other in the 3d z-plane or increase the z from 0 (eg. bottom object has a z of 0 but height of 10, and top has a z of 10 and height of 5, the one with the height of 5 rests on the one with height of 10) this obviously breaks the display because it considers the y level of the object, and as the top object has a lower y value, it gets displayed BEHIND the object it is on top of.

    (this would render the top box behind the bottom box)

    So the solution would be to incorporate the z-level into the calculation, correct? Well no, because if I set it to order based off y+z, if the object is slightly behind the equivalent of the bottom object's origin point when factoring in the z-axis, it will STILL BE DISPLAYED BEHIND despite being on TOP of the object.

    So rather than place objects in the z-order based off a simple calculation of values, would I have to check objects overlapping at an offset determined by the different in z-level, then check of one of the them has a higher z than the other's z+height?

    YES! I WOULD! And it works when using the custom sorting function with rexrainbow's zsort plugin.

    But only sometimes! If a large number of sprites overlap, the ordering breaks.

    Here is the code, I'm aware it's not efficient but I was trying to avoid using if-else since in rexrainbow's example he doesn't use it for some reason.

    I'm at my wits end trying to fix this stupid bug. It has nothing to do with the actual collisions or functionality of 3d which has been perfect for me so far.

    I know this is a weird question to ask and I apologize if I should have opened a separate post. Please, if anyone is capable of helping in the slightest or needs more clarifying information, let me know.

  • In case anyone else wants to implement a 2.5d game with a z-axis, the system proposed with two families absolutely works.

    Apologies if the perspective or the visuals look a bit wonky, this is just a test room.

    The Z-Axis IS possible :)

NoticEmpire's avatar

NoticEmpire

Member since 23 Aug, 2018

None one is following NoticEmpire yet!

Trophy Case

  • 6-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

9/44
How to earn trophies