jwilkins's Forum Posts

  • I would use option 1. It's the safest option, because mixing Platform with other behaviors or directly changing its position may cause different issues.

    Use Timer behavior to reset maximum speed after a knockback.

    Start a Timer for 0.3 seconds, set max speed to 200, apply vector. On Timer event set max speed back to 50.

    I played with my bottom option a bit more and got it to work better, I have a "MaxWalkSpeed" variable that is checked against the platform objects speed, if the player is moving slower than the MaxWalkSpeed value, the input doesn't go off. This prevents the player from moving themselves faster than the walk speed, but lets me set the actual platform Max Speed to a much higher value.

    I haven't tested it as rigorously as I'd like though so I will keep your idea in mind in case this ends up having too many issues.

    I'm honestly a bit surprised this wasn't considered when the platform behavior was developed, SO many games hit players with forces that exceed the speeds of their characters movement, why there isn't a built in option to do that is beyond me.

  • So, firstly I need to note I am not using the built-in Platform behavior of Construct2, rather I am using the "Platform2" behavior by Colludium, which has mostly the same actions and events, but includes collision filtering. This is going to factor into why I cannot use the Bullet behavior to accomplish my goal.

    So my game is a brawler (Think River City Ransom) and I want attacks to register knockback. i.e. I smack you with a club, your horizontal speed gets updated to move you backward.

    This almost works out-of-the-box, except for one issue, the knockback is limited to the object-being-knocked-back's MaxSpeed value. I.e. I smack you for 200 knockback speed, but your maxpeed value is set for a measly walking speed of 50, thus throttling that big smack to a measly whiff.

    There are a couple of obvious ideas that come to mind that I have tried so let me explain why they won't work:

    1. Update the MaxSpeed value on hits: This is a no-go. How do we know when to reset the MaxSpeed to walking speed? We could wait until the player stops or goes slower than the walking speed, but this takes control away from the player during these moments when they'd rather "lean in" to the momentum or push back against.

    2. Throw in the Bullet Behavior and update that instead: I tried this and it worked really beautifully until we collided with the Solid2 (Platform2 solids) objects, it clips through and once the bullet behavior stops moving, it traps the character in the solid or jumps them to the top.

    My last option is to run a check before the players Platform2 Control Input fires, to see if they are exceeding a "walkspeed" local variable. This would effectively be a secondary MaxSpeed value, and then I would set the MaxSpeed to an amount above what I expect the highest knockback value to be. In practice I am not happy with the results of this, so I'd love to hear other suggestions.

  • Oh wow, I don't know how I never noticed that picking condition before! I have a lot of animations I will have to set up that image point for, but that's minor, I think this will work, thank you!

  • Thanks for the reply!

    In this case BBoxtop is going to give me the same result as Y, so those could be interchangeable. The origin is the top-left of the Tiled Background, so regardless of angle both will be the same. The image is just to show how I currently check if the player is on top of the tiled background, and how that doesn't work if the object is angled.

    I did consider your approach of using "overlap at offset", but for reasons that are too long winded to get into here, that's not an option. Asumme that the player object we need to check for is possibly always overlapping the tiled background, and is large enough that we need to be checking a specific point rather than the collision data of the player object.

    Now, the easy way to do this of course would be to pin a single pixel object to the player at the correct relative location for the check, and if I have to I will do just that. But I'd really rather not as my player objects already have a lot of pinned objects I am keeping track of, and because my player objects are also enemy objects there are a lot of them in each layout, so adding this overlap checker object can add a lot more objects to the layout.

    I'd really rather use some math on the check to determine if the relative point is empty or not in other words.

  • I'm struggling to explain this well so I have included an image to help explain:

    So I'm using tiled backgrounds for collision boxes in my game. I know they're not ideal for more complicated collision detection, but 95% of the surfaces in my game are flat rectangles, so normally this will work fine.

    I do want to use some 45 degree angled slopes though, and this is where we run into a problem. Collisions still work fine, but I run a check for a certain function that determines if a player can do something based on if they're Y position is greater than the tiled background they're on top of. If the tiled background is not angled, then it works fine, but if it's angled of course then the player can be below the tiled background's Y while still being on top of it.

    I'm sure there is some math I could do to figure out if the player is above the object based on their X position and the angle of tiled background they're on top of, but I am having trouble figuring that math out.

    I'm also sure there is a seemingly simpler way to do this that does not involve a math check, but I'd rather not go that route due to the complexity of associated systems.

  • > In your experience, do wait commands or system hiccups potentially contribute to this as well?

    No, I didn't have this problem. But I had to deactivate all groups of events that create random objects, particles, have "Every random(N) seconds" in them etc. Only when the seeded level generation is finished, I activate those groups.

    Good to know, this helps me narrow it down a bit more! Thank you so much.

  • It's hard to tell what can be the problem, but from my experience with this plugin, you should avoid doing anything else that can utilize random generator until you finish building the level.

    Don't create any particles, don't use choose() or random() expressions in other events that can run during or before dungeon generation.

    That is actually really helpful! It is possible I have interference then from things like enemy routines. I'm going to try isolating that stuff and see if I can eliminate the issue there.

    In your experience, do wait commands or system hiccups potentially contribute to this as well? Thank you so much for replying!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I know this is a long shot, but I am having an issue with this plugin (or I am creating an issue with it): construct.net/en/forum/extending-construct-2/addons-29/plugin-seedrandom-53718

    I'm using this plugin to freeze the seed in order to generate rooms without having to save them.

    The system works by building a dungeon map in an array. The array stores a room seed value for each room. When the player moves rooms in the dungeon, the game is simply regenerating the layout based on the world seed value + the room seed value, which it sets via this plugin.

    Most of the time, this works fine. But probably 3/10 times it generates the same room differently, despite having the same seed. My gut feeling is that this might be caused due to delays in the generator process. I have 2 functions in the process that use "Wait 0 seconds" to give the process a moment to finish up what it is doing, and my assumption is that if the device you are playing on hiccups or slows down during this, it generates a different room.

    The problem is that I am having a lot of trouble rewriting that aspect of the generator, and I am also worried that I'm going to do all of this and find out that this isn't the case. What other variables commonly could be interfering with the seed generation to cause this?

  • Probably would get more help if you just linked the youtube video with the appropriate time stamp :)

  • This is a complicated, multi-faceted question that you aren't going to get one simple answer to. You need to research how procedural generation is done as there are many approaches.

    For biomes/minecraft style generation here is a good breakdown of the concepts: procjam.com/tutorials/en/ooze

    While it's not biome based, Rex does provide some dungeon generation:

    c2rexplugins.weebly.com/map.html

    You may want to consider Seed generation as well, that tutorial link above covers it a bit, just know that there are Construct2 plugins that can "freeze" your seed so that you always generate the same terrain.

    You'll also need to look into how to store the terrain your generator built, probably by writing to an Array object.

  • Currently my game uses the Tint as a layer effect for slightly changing the colors when a room is "dark", additionally, some of my rooms are "flooded", and anything under the Y position of the water line is layered underneath a Tile object that uses the Water Background effect to create a ripple distortion.

    Individually, these 2 effects work perfectly.

    However, in rooms that are both "dark" and "flooded", objects underwater exhibit a weird, unintended double-image effect to them. In this case, one of the double images has both the Tint and the Water Background effect applied correctly, but the second double image only has the tint applied. If it helps, the second image that does not have the Water Background effect applied always appears behind the correct version.

    Does anyone know what could be causing this?

  • The simplest thing I can think of for this (admittedly I have not implemented it myself) is to differentiate between the overlapping instances in some way (possibly pick by highest UID for example) then lower the speed of one of the two picked instances. This will mean the instances "bob" back and forth in speed, decelerating when they overlap another instance with a higher UID, but accelerating when not, but if you want a quick and dirty method this should work.

  • Thanks guys! I haven't had a chance to try implementing this but I should have enough advice to go off of now.

  • I am terrible with advanced math, and while I can mostly get by, I would appreciate some help with understanding how to use qarp to calculate stat curves in an action RPG.

    The scenario is that I have spells that need to exist for a certain duration dependent on the players Wisdom. Currently I just spawn the spell, then start a timer for it based on the casters Wisdom stat. Currently this looks like "Set timer to: Player.Wisdom*0.05 Seconds".

    This is not great game design as it means spells stick on the screen for minutes at a time if you cast with a high wisdom stat, so I want to implement a curve to this so that the higher your Wisdom stat is, the less of an effect it has on the timer. The stat range is anywhere from 1 to 9999.

    So I believe that would start looking like:

    qarp(1, 9999, c, Player.Wisdom)

    And I think that the "c" value is the rate of the curve, but I don't quite understand that part, or what the value should look like there, is it a decimal value as well or something else? And if anyone can explain this in a way that makes sense to me it would be appreciated. Thank you!

    Tagged:

  • After you picked some instances, in a sub-event you can do "For each Object order by Object.X" and only process the first instance, after that stop the loop.

    Or, depending on how these instances are positioned, you may be able to use "Pick nearest to" event, for example, to pick the leftmost instance, pick nearest to (-10000, layoutHeight/2) or something similar.

    Perfect! I knew that there was a way to do this, I just didn't know it was nested inside of the "For Each Object (Order)" command. Thanks!