Rhindon's Forum Posts

  • I THINK I discovered the issue. I must have manually set the instance values for all the JunctionCheck objects (which is the UID of each WallSlide object they're associated with) and then edited the maze further but did not update the UID values. As a result, the JunctionCheck variables are looking for a UID value NOT associated with the correct WallSlide object. I'm going to have to manually check this for each one to verify, but I already discovered one such discrepancy...

  • Heh, I did figure that might be the next step.

    I shall do that...

  • .CAPX: https://dl.dropboxusercontent.com/u/36080515/Pacman%20Rush%200-2-4.capx

    This may be a somewhat complicated/confusing issue, so I will try to be direct and clear. Please bear with me.

    I am working on a Pacman remix game. To make things more interesting, there are sections of the maze where the wall shift, creating alternate junctions at the opposite end of the wall that shifted. These sections of walls switch positions (moving back and forth) randomly and independently of each other. SO the chaos is real, my friends!

    I won't go into detail on how I make it work (you can review the .capx if you like), but I used sprites - the JunctionCheck objects - to identify which directions Pacman can travel at any given junction. (Yes, I tried to use the Solid behavior on the walls, themselves, but that proved problematic. Hence, this "convoluted" system.) With the WallSlide objects, the available directions open to Pacman or the Ghosts constantly changes every time the walls shift. For the most part, this system works...though I'd like to refine it a little.

    The problem I have discovered, which seems to have come after some other changes I made, is that there are times when the JunctionCheck objects do not always get their respective Boolean values updated/toggled every time the WallSlide object shifts. (I use an instance variable to identify which sliding wall the JunctionCheck objects are related to.)

    For instance, there is a corridor that runs north/south, and on the left side of the corridor, there is a section of the wall that shifts. It's in its "up" orientation. This means that the top part of the sliding wall is flush with the normal section of the wall. At the bottom end of the sliding wall, there is a junction where Pacman can move eastward.

    If you open up the .CAPX I provided above, here's how the process works (starting at event line 94).

    1. All WallSlide objects have their instance variable WallSlideTimer ticking down to zero.

    2. If the timer is <1, a warning will occur signaling that the wall is about to slide positions. (This works fine.)

    3a. If the timer is <0, reset the timer (to ensure this event only happens once while true) and set the instance Boolean variable IsSliding to true (this is to call on only the WallSlide instances that are ready to slide).

    3b. The instance variable LerpLowHigh is my check to tell the system when to shift the wall up/down or left/right (in relationship to another instance variable).

    4. While the Boolean variable IsSliding is true, the system will check to see when it has reached the end of its lerp transition. When it has, it will set IsSliding to false to ensure this process only happens once.

    5. When the lerp has finished its transition, it will call on all the JuctionCheck objects that are associated with it. Each JunctionCheck has two sets of variables: one that says what directions are available at any given time and another that says which of those directions are to be turned on or off when the walls have finished sliding. So if the direction North was open to travel at a junction, but then the wall slides, the N_open Boolean will be toggled to false (where it was previously true). It will only toggle the Boolean values if its respective (direction)_changable Boolean variable says it can be toggled (it must have a true value itself).

    6. Then, at lines 115 and 116, the position of the walls are updated accordingly.

    The only thing I cannot figure out is why the Boolean variables (ie: N_open) will sometimes not update properly even when the other JunctionCheck objects associated with the same wall will update just fine.

    I suspect the problem started when I added the IsSliding Boolean variable, but even if that's the case, I do not see how that could cause the problem. Alternatively, because there are so many JunctionCheck instance objects to deal with, it is somehow possible that some are not getting properly picked? (I have manually checked in the debug that all the instance objects are toggling, but occasionally they get "missed" and then end up with the opposite value than what they should have.)

    Someone with a keener eye than mine would be greatly appreciated.

    It's likely my understanding of how picking works or some other factor is escaping my grasp here...

    Thank you again for your patience and your help.

    PS: NO, I am not going to put this game up to sell. It will be free-to-play as I very clearly do not own the rights to Pacman. I'm doing this for my portfolio and to grow my game dev skills. ... Just because someone is GOING to ask and others already have.

  • Ashley - Thank you for the info. ...so much still to learn.

    I must admit I only use Chrome (I know better, but I don't usually test on Explorer or FireFox).

    I'll search so more for audio playback issues to see if I can find anything worthwhile.

    May I ask what events you speak of that caused issues in the past? Maybe that's what I'm doing and don't realize it... Though, I would be surprised if that's the case since I don't think I'm doing anything extraordinary...but then, I'm not adept at audio, either.

  • Here's my .CAPX.

    I'm just as confused. On occasion, it works just fine. No delay.

    Ashley, may I inquire what it is that I'm missing in this case, please?

  • ultrafop - Yeah, it was my understanding that all sounds are preload at the start of layout...but that doesn't seem to be the case after all.

    I go ahead and preload the sound file on a Start Of Layout event line, and then, on a new event line, I prevent the rest of the project from advancing until that sound has finished preloading. But, when I call on the sound file to play, it still has that split-second freeze-up. So that's what is confusing me.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • it is my understanding that all SOUNDS in the SOUNDS folder should be automatically preloaded so that playback is instantaneous. However, every time I go to play a sound effect there is a brief lockup/delay in the whole project when the audio file is first begun. I even added an event that tells all other actions to wait until audio preloading is complete. The ONLY sound effect in the whole project now is no more than 10-11 seconds long.

    What could be causing the audio (and the whole project) to delay/lockup upon initial playback?

    Thanks!

  • teacherpeter - Yeah, originally I thought it might be a For Each loop I had going... SOMETHING that was demanding a LOT of checks per tick.

  • .CAPX: https://www.dropbox.com/s/x0raalfkw3rku3z/Pacman%20Rush%200-2-1.capx?dl=0

    C2 RELEASE: r221 (stable)

    ISSUE: Prior to adding any events or objects for the Ghosts in my Pacman remix game, everything seemed to be operating okay in terms of overall game speed. But upon adding the Ghosts (there is supposed to be 16 total, 4 of each color), the CPU usage amps up to between 90-100%+.

    I toggled all event lines for the Ghosts as disabled, removed the Ghosts from the layout entirely...nothing helped. So I saved the .capx and restarted C2. At first, it seemed to work. But when I re-added all 16 Ghosts and re-enabled the event lines (incomplete as they are), the same problem resumes. After several seconds, the game seriously bogs down. It's playable, but the framerate hits near-bottom and is basically slugging.

    None of my past projects have really gotten so far to the point where I've encountered this problem seriously, and even those past projects had DOZENS of objects with particle effects, no less. So I'm at a loss as to what's causing this slowdown. Your insight would be greatly appreciated. Thank you.

    UPDATE: I think I have solved the problem.

    In the in group (line 111) "Ghosts At Junction", I added a condition that checks for the lerp value of the shifting walls and then told it only to update the junction values just once while true. I re-ran the game and it is still going fine after a couple minutes.

  • blackhornet - As always, the obvious eludes me. LOL Thank you, sir. I should be able to do that easily.

  • I'm working on a remix of Pacman.

    So far, I've got the control system for Pacman working fine.

    I'm using JunctionCheck objects to determine which direction Pacman can go next. Each instance of JunctionCheck has a variable for each direction which states if that direction (north, south, east, west) is true/available or false/not available. (I probably could have set it up in an array, too....ah, but that that's 20/20.

    But now I need to set up a system for the Ghosts which will be very much like the controls for Pacman, but which will be operated automatically instead of by the player/manually using the same JunctionCheck objects.

    My dilemma is that there will be a mixture of 1-4 directions to choose from and, obviously, each combination will be different. It will be easy enough to manually enter which directions are available for the A.I. ghosts to choose from (that's already set), but the number of directions to choose from will be tedious to enter in without creating too any event lines.

    What I'm after is something like this:

    Ghost On Overlap w/ JunctionCheck | Set GhostDirection to choose(Direction 1, Direction 2, ...)[/code:eyy2o9ri]
    BUT, the code will only list those directions which are true/available. If a path doesn't have and optional east path, then that won't be part of the list of options to choose from.
    
    Any suggestions on how I can do this concisely? Thanks for your help!
  • This post freakin' SAVED. MY. LIFE.

    THANK YOU!!!! I lost just a small amount of work versus the ENTIRE PROJECT!

  • LittleStain - I actually started doing that on line 199. And even for line 200 at one point. That didn't fix the issue. I've read the manual regarding how events work but it doesn't always seem to work 100% for absolutely every case. Meaning, there seems to be exceptions when the event line assumes "all instances that meet these conditions".

  • LittleStain - Thank you. I do believe I caught that shortly after my last comment. I did, actually, get it working by adding a For Each to event line 194. Go figure... I hate that I can't always tell when a For Each is needed. It has been my understanding that a condition like 194 automatically checks FOR EACH instance that meets the criteria and then equally does FOR EACH instance of any other related object that relates to those initially-selected instances as it goes down the sub-events. Ah well. I've got it worked out.

  • gumshoe2029 - Well, I don't have any toggling of variables going on. What I've got pictured above is all that's involved with this particular case. There are no other event lines in action. But, based on what you said, are there any other conditions that you see that might line up with what you are thinking?