jwilkins's Recent Forum Activity

  • 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!

  • 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 :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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!

jwilkins's avatar

jwilkins

Member since 17 Dec, 2016

None one is following jwilkins yet!

Trophy Case

  • 8-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

12/44
How to earn trophies