jwilkins's Recent Forum Activity

  • That could be, the AI accepts instruction mostly from one source (a general "AIUpdate" Function) but does occasionally have to get instruction outside of that routine, which might be the culprit. Glancing through my events I don't see any that should be updating the animation externally, but that doesn't mean its not there.

    I'll keep that in mind if this rears its head again, for now the force "Start Animation" is working with no consequences.

  • lionz sorry, I should clarify, this is in regards to the current animations "Is Playing" value, specifically the one the debugger displays when inspecting the instance in question:

    My understanding is that the debugger value is always updating to the current animation in real time, that is what it appears to be doing at least, and while "Is Playing" remains true most of the time, randomly it does turn false when switching to the attack animation.

    Bandaid Solution in case anyone has this same issue in the future

    While I have no clue what is setting this value to false and stopping my animation from playing, I was able to "fix" the problem by putting a "Start Animation from Current Frame" action after the "Set Animation" action.

    To be clear, this shouldn't be necessary. The existing code works 95% of the time, but after adding this "Start Animation" action and running the game at 10x speed for an hour with an AI controlled enemy attacking a dummy, I haven't seen the issue pop back up. The debugger still shows the "Is Playing" value being set to false randomly, but this bandaid bypasses that.

  • I have this long standing, very random bug in my game I am trying to pinpoint with no luck.

    The short version is that when an enemy switches to their attack animation, very occasionally their animation freezes. Through the debugger I discovered this happens because SOMETHING is setting "Is Playing" to False.

    But here's the thing, to my knowledge the only action that can do that is "Stop Animation", and I do not use that action anywhere for any object (including these enemies) in my project.

    Searching the entire project for "stop animation" only gives me results for some disabled code I kept around for reference.

    Is there something else that can manipulate "Is Playing" that I am not aware of? Anything that might help me here would be greatly appreciated, this bug has been sitting there, randomly occuring, for months now.

  • This is pretty easy to test, just use the Advanced Random behavior to update the seed, then save (either using the debug save option or the plugin) close the game, then load the save.

    If you look in the debugger, the PRNG Seed is no longer whatever you updated it to be using Advanced Random. This of course ends up affecting everything that is tied to random generation.

    Now, I could get around this pretty easily by just updating the seed again after a load, but previously I didn't need to do this, and I am worried it could create issues if you save/load at just the wrong time. Am I actually just missing something and this is always how it worked and I've broken something elsewhere?

    Tagged:

  • I've got a top-down layout that uses seed generation and a tilemap to infinitely generate terrain. Whenever the player reaches an invisible edge of the layout, their position is reset and the tilemap is repopulated with their new offset co-ordinates.

    Terrain cannot be modified by the player, so I don't store any of the terrain information in an array or anything.

    I do want to include "fog of war" (FoW) though, hiding undiscovered tiles until the player gets close enough to them.

    I can't simply place a FoW layer that erases tiles the player gets near because the entire layout is being re-generated constantly. Instead I need to store the offset positions of cleared tiles, and I'm curious what is the most efficient way of doing this? I could make an array and place in every tiles offset X and Y, but that array will quickly get massive as its expected the player will be uncovering tens of thousands (if not more) tiles during their exploration.

    Suggestions? Thanks!

  • You do not have permission to view this post

  • I'm building an NES/GBC style game, so it uses spritefonts. Currently, I am building all the menu/UI/dialog text to pull from a language array, where it simply pulls using a key word. For example, it might find the keyword "currency_menu" and return "Gold".

    To me this should work pretty well if I choose to ever localize in the future, theoretically I can just load a new language into the array, and switch the spritefonts for ones with the languages alphabet.

    Does this make sense? Is this a bad idea? I've never considered building for future localization until now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As a quick update, oosyrag's suggestion worked pretty well, though I didn't use the container idea. Mainly because this only needs to be checked during lane changes, so I create a "LaneChecker" object in the function that checks to see if the lane the player is trying to move into is obstruction free. This object is created, positioned, and sized based on the players position and VectorX values, and then I just check to see if it is overlapping anything in the new lane.

    Regardless of if it is or isn't, the object is destroyed immediately at the end of the checker function.

    Thanks for the suggestion oosyrag! It's much more consistent than the old patch-job I had, and it was easy to test by simply not destroying the lanechecker object at the end of the function and changing its sprite based on whether it would allow a lane change or not.

  • That makes sense, its not quite as self contained as I'd hoped but it does seem straighforward, I'll try it out and see how it goes!

  • This is conceptually a little complicated so here's a screenshot of the project:

    So this project uses the Platform behavior in conjunction with the Solid collision filter/tags. You can see in the screenshot above that there are 7 "lanes" of collision/depth, and the player object only collides with solids tagged with the lane theyre in.

    This works fine, but we run into edge-case issues when switching lanes. Currently the game does the following to move lanes up down:

    1. First, it calls a function that checks if the position above/below the player in the lane theyre trying to move to is free.
    2. Next, it initiates a tween that moves the player either up or down lanes, and temporarily disables the lane collision checking while the tween is active.
    3. Finally, when the tween is finished the game updates the collision filter for the player object to check for collisions in the lane the player has moved to.

    If the player is standing still, this works fine. We run into problems when the player is moving left/right during a lane change, because during the tween the player continues to move left/right, and the position they end up at when the tween ends and re-initiates collisions could include a solid the player is now stuck in.

    Up until now I've been able to slightly combat this issue by checking directly above/below the player and slightly in front of them as well, but this has only lessened the frequency of this issue, it still occurs.

    I could of course stop the players horizontal movement during the lane change tween, but this makes movement really clunky and unsatisfying, so that's not ideal.

    Any suggestions on how to accomplish this would be appreciated, if I could predict the range of locations the player could end up at during step 1, then I feel like I could eliminate this issue, but I don't know how to do that or if there is a better alternative. Thank you!

  • dop2000 Thank you so much for linking this! I was trying to find any information about this issue but didn't run into that post. Turning worker mode off does seem to help, though I'll keep poking at it to make sure.

  • I recently "finished" upgrading my project from C2 to C3. This project involves a function based control mapping system. I.E. Players select a pre-made control type (Keyboard, Gamepad1, Gamepad2, etc) and then whenever a key or gamepad input is used, the game checks if that is the currently selected input and then runs the appropriate actions.

    For instance, pressing the attack Key or pressing the attack gamepad button will eventually lead to the same set of actions nested in a function.

    This was working perfectly, until I upgraded to C3. Keyboard controls are still as responsive as ever, but the gamepad controls regularly "eat" inputs in a really unsatisfying way. Having Steam open at the same time seems to make this worse, but even closed the issue still persists.

    Basically, sometimes you press a button and the action does not occur, or rarely it seems to duplicate (though this could just be my perception). This occurs both for button press and button release events.

    I'm doubtful the issue is performance, mainly because keyboard controls are unaffected, but also the game doesn't dip below 60FPS and rarely uses more than 30% CPU according to the debugger.

    Anyone had a similar issue before? Any idea what I should be looking for?

    I don't know if it matters, but I have not replaced my C2 Functions with the C3 built-in functions.

    Tagged:

jwilkins's avatar

jwilkins

Member since 17 Dec, 2016

None one is following jwilkins yet!

Trophy Case

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

11/44
How to earn trophies