jwilkins's Forum Posts

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

  • Try Construct 3

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

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

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

  • I feel like this is more obvious than I am making it, but here goes.

    I have a group of instances I have picked based on a few parameters to make sure they are eligible for a certain function. I want to pick only those with the highest or lowest X position (there will almost certainly be several instances at the same X position, which is fine).

    I'm pretty sure I can do this by ordering the list I have made based on X position, but I am completely blanking on how I can accomplish that and could use some help.

  • Yeah I only read from the array once per relevant object at the beginning of the layout, and then write to it only once per relevant object at the end of a layout, or when an object is killed, so I don't foresee any of that being an issue. Thanks for the additional information!

  • AllanR Thank you! That is great to know, in that case I won't implement Bruno's solution since mine already works and based on your information, doesn't have a large enough impact to actually hinder my games performance.

  • brunopalermo That's a much more efficient idea, for some reason I had it in my head that because it's possible that a dungeon uses all 96 rooms, I should build it for that, but the changes of a dungeon actually building out all of those, and that a player explores all of those rooms, and that all of those rooms contain the maximum number of enemies is fairly slim.

    That said, I usually just look up array values based on an XYZ locations related to other values, I haven't looked up an array value based on an ID stored inside a cell, I'll hafta look into how I should do that.