Posts by robofish126

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.

    Translucent pixels are certainly possible. I use them extensively. Though I personally find Fusion's graphics editor a bit confusing when it comes to the alpha channel, as you need to edit the alpha channel separately from the graphics,

    If it's not working for you, try doing what I do and create your graphic in an external program with translucent pixels already in it (saved as a 32-bit PNG) and import it into the graphics editor. That way the alpha channel will be automatically imported from the file and will be correct.


    Also ensure that your active object has translucency enabled in the properties. There's a checkbox for it (I can't remember what it's called exactly and I'm not at my PC currently)

    Creating an Alpha Channel then using the Selection Tool over the dot while set to 1% opacity worked, thanks!

    That said I don't understand why you need the Alpha Channel. What is the point of having the option to paint dots at X% opacity in regular mode when it only seems to actually take effect when done within a created Alpha Channel?

    If your goal is to use that object merely to check for collisions/overlaps, why don't you make it invisible ? A "solid" object, even when is not visible, can indeed be used to trigger collisions and/or overlaps.

    You can use the same object to check for collisions/overlaps when and where needed. You don't have to create a new object to check for "new" collisions, just reuse what you have.

    I hope I have interpreted your question right..

    The object is basically a hollow board square with a number in the bottom-right corner and sometimes some icons. Its square outline and the number/icons are intended to be visible and in front of other objects, but in order to interact with other objects that fall within the 'hollow' in the center of the square I put a single pixel black dot as a jury-rigged fix. Now that I'm nearing completion of the project and doing polish I'm trying to clean that up.

    You are correct in what I should've done. Each board square already has an associated invisible 'checker' object that is used for a lot of information and collision/overlaps. I should've delegated all the square's functions to the checker and had the square object just be a visual display of certain information contained in the checker it overlaps. Unfortunately at this point making such a change would involve having to change dozens of lines of complicated code in ways whose effects could be unpredictable.

    By comparison if I could just make that one pixel be very translucent it would solve the issue at hand with no code changes required.

    I've been trying to make an object with partial transparency. Most of it should be opaque, but one little piece should be as translucent as possible, its just there to 'hook' and collide/overlap with other objects. However creating a pixel with an opacity of 1, which appears a hot pink in the editor, still immediately goes opaque when overlapping other objects. Am I misunderstanding how semi-transparency works?

    In 20-20 hindsight I should've offloaded all interactions to a separate invisible object but at this point doing that would be time-consuming and risking the creation of all manner of errors. Having it be partially transparent would make things a lot easier. Is that possible though?

    Suggestions:

    - make sure you don't reach the maximum number of objects defined in the Frame properties, try to increase it anyway (maximum is 30,000) as, as far as I remember, this number is used to allocate work buffers at runtime.

    - check the RAM used by the process in the Windows Task Manager, to see if there is a memory leak somewhere.

    Tried increasing objects to maximum. Unfortunately it didn't prevent crash, nor even show signs of slowing it down. Speaking of there is no rhyme or reason as to when it crashes. I've seen it as early as 173 moves and as late as 367 moves.

    Looked at task manager and I'm not seeing any obvious fluctuations before or during the freeze.

    In any case I managed to find the most recent file version to not have the crash issue and will have to work from there.


    Edit: I identified the line of code that caused the problem and why it caused it. It was a line that had "if a board square is 8 or greater, do Loop X for each board square" where Loop X was supposed to set values of 8 to 11 to a value below 8, but it failed to consider the possibility of an atypical event that could set a square to a value of 12 or 13 instead. Which means the first time that atypical event happens it means the loop that is supposed to trigger only once just gets triggered over and over. I'm surprised that this didn't pop up in the Profiler... I guess I would've needed to leave it in the partially frozen state long enough for it to become the dominant time-wasting element of the runtime.

    If I understand correctly won't event viewer only help if its a crash out of the game entirely?

    Please login to see this link.

    Ultimate full screen: switch from / to full screen may freeze. If extensions uses multi-thread, then this maybe a dead lock. But according to[/quote]

    I have Ultimate Full Screen included but it hasn't been active when the game malfunctions.

    Guess it maybe something about control groups disabled and not re-enabled correctly?

    What do you mean by control groups? I don't recognize this terminology with respect to clickteam fusion 2.5, or why it could cause looping animation to stop looping.

    Edit: Checked and even reducing the most time consuming component that runs hundreds of loops many of which have subloops to have 98% fewer loops has no impact.

    Besides the infinite loop, this may also because of some corner case extension didn't take into account.

    You can check the event viewer, which should record the module name that caused the crash.

    Event viewer? Where is that?

    Though again as far as I can tell its not crashing in the sense of "the program stops working". It is a partial crash. Animations freeze, certain key commands don't respond at all, and others don't work properly like "cancel ability doesn't refund ability cost". But the program continues to run. Indeed I can exit to the level select menu and reenter the level and it works fine.

    Do you have any thoughts on what mechanism could cause all sprite animations to stop working and various other malfunctions but NOT crash the entire program?

    One of my concerns remains that if this is some sort of memory crud buildup issue that its possible new events aren't the cause of the problem but are the straw that broke the camel's back, that accelerated the failure state to happen before a typical level ends... its possible it was always building up to the freeze but I just won/lost levels before it could reach that point.

    Edit: Did some more testing. New objects can spawn and have animation, but some of them just immediately destroy themselves. I also checked that more obvious 'new' culprit wasn't the driver.

    It will display in the middle of the screen
    Please login to see this attachment.

    Good to know. The issue is that whatever is happening my game it isn't a 'hard' crash that brings that up. Some specific things seem to break, including sprite animation. I was hoping that the latter was indicative of a specific error, like maybe memory issues?

    In that regard I took the most time intensive component of the program and had it run 10 times as many loops, but it didn't cause the program to crash. Indeed I got a new high score getting further than ever before.

    What the title says. My game has crashed twice so far, at about 10 and 15 minutes respectively. Either time the effect was:

    1: All sprite animations freeze. (outside of the crash those sprites which are animated loop perpetually without issue)

    2: The main player movement action (D-pad or left control stick) becomes completely unresponsive.

    3: Other actions continues to work, such as abilities, jumping to level select.

    I checked debug and there is no accumulation of objects. It is possible there is some kind of "locked in a loop" happening but wouldn't that jam everything? Meanwhile if it was just something causing the movement action to break that shouldn't affect the sprites. I'm currently testing what happens if it runs indefinitely and it keeps running for 30+ minutes and it hasn't crashed, though keep in mind its a turn-based game so not much new happens in that state other than checking if something should be happening.

    I can look for culprits especially in the most recent code but given the "it works fine for 10-15 minutes" it will be both slow to test, slow to verify, and if its more of a 'straw that broke the camel's back' it might not be due to any specific code but an aggregate. If I knew what was breaking or how to detect it then I could have a better understanding of what might be causing the break.

    Any thoughts on what that might be?

    My game has the player object not actually move on a static frame that does not scroll. Pressing the directional keys shifts the positions of enemies, not the player.

    My understanding is that the layer toolbar allows you to make it so background object be made to wrap around as you scroll through a level, and through use of multiple layers and scrolling coefficients induce a Parallax Scrolling effect. Is there a way to compel those effects in a static frame that is not actually scrolling?

    I was able to implement such an effect another way, but through the means of having 9 background objects arranged in a 3x3 grid centered on the frame, with them moving like the enemies but having a column or row get 'flipped'. However that is both complicated and seems to occasionally glitch. I think I might be able to fix that by having a single gigantic background object with a repeating pattern that 'recenters', but even then it feels like it'd be simpler if I could just use the game's native 'wrap the background around' functions rather than weird work arounds.

    Is it possible that the player sometimes overlaps more than one enemy? And that the code is getting the scale info from one of the enemies and incorrectly applying it to all enemies? That could explain the above.


    Please login to see this picture.

    If I understand correctly, Alterable Value A is always equal to Scale. In that case, why not just use Scale? As in, force animation frame to (scale("enemy") - scale("player")+0.4)*10. Using the scale directly is more guaranteed to have the most up-to-date value, and it would make the code more readable than using unnamed altVals anyway. Does using scale directly make any difference?



    Does forcing the number to be an integer (eg. round(scale("enemy") - scale("player")+0.4)*10)) make any difference? I don't know how the scaling works in your game, but maybe certain objects have slightly different scales than you expect (eg. 1.2001 instead of 1.2 or something like that ) which might be causing rounding errors somewhere.

    I was able to fix it! In summation:

    1: It happens even when the enemy never overlaps with a player during the run.

    2: Using Scale instead of A didn't help.

    3: I shifted things from A=Scale and thus a decimal to A=10*Scale and thus always an integer. This works... but it means scale no longer does. Players and enemies that are A=10 to A=19 remain the same size, abruptly doubling when they hit A=20, becoming invisible at A=9. That problem is why I shifted to A=Scale in the first place, only to subsequently discover the new error.

    4: However going back to A=Integer and shifting the conversion from Scale=A/10 to Scale=A*0.1 worked. I guess CF2.5 division does some sort of rounding that multiplication does not.

    Have you checked what value your getting that's setting the animation frame? I'd put one enemy on the screen and have a counter set to the same value that the animation frame is set to -just to make sure it's putting out the value you expect. If you put out an example it would be easier to check what's going on.

    Good idea! I went ahead and setup events to check, while manipulating player scale, and viewing enemy in debug mode. It turns out most enemies were consistently off by one, which I fixed by shifting to "+0.4" in the equation, but certain ones remain in error. Here's one enemy I tested:

    Player ScaleEnemy ScaleCounter Result ReturnedFrame ReturnedAppearance
    1.11.254X
    1.21.244X (should be !!!)
    1.31.232!!
    1.41.221!
    1.51.210O
    1.61.2-3.33e-150O

    Somehow seemingly "force frame to #" and "force frame to #+1" are returning the same frame, but only for some Enemies but not others. Where it jumps varies from case to case, I've seen X jump to !!, !!! jump to !, and !! jump to O.

    I remain mystified now that its seemingly doing the correct computation but sometimes a computation shift of 1 results in a frame shift of 2. Will continue to test tomorrow.


    Edit:

    I went ahead and did an even more direct test:

    Please login to see this attachment.

    Adding more animation frames didn't help either:

    C ValueFrame #V vs #Relation
    101 Greater
    211 Greater
    33Equal
    431 Greater
    541 Greater
    651 Greater
    77Equal
    871 Greater
    981 Greater

    There is no consistency. It'll jump from 'equal' to '1 greater' and back on multiple occasions even when there should be matching frame for either query.

    Edit 3: Shifting it from "force animation frame" to a system where each state (O, !, !!, !!!, X) is its own animation seems to have similar problems, and often additional issues. Does CF2.5 not like decimals or something?

    I've been making a game where you can 'eat' enemies that have a smaller or same scale than you but die if you touch enemies of a higher scale, with both the player and enemy objects having Alterable Value A equal their Scale.

    I've been trying to make the enemy's appearance (dictated by forced animation frame) differ depending on if they're safe to touch (O), fatal to touch (X), or currently safe but dangerously close to being too big (! to !!!), using code like this:

    Please login to see this attachment.

    Enemies seem to get 'stuck' at a given frame before adjusting, such as from ! to !!!, or from O to X. I've tried many variants:

    *Setting it to trigger when relevant changes to the game state happen, every 0.1 seconds, or Always like the above.

    *Separating the 'force to frame 1-5" into five separate lines, or a single one like the above.

    *Using an Each Loop, or spreading values to Enemies then doing a Loop equal to Enemy count targeting each enemy that matches the Loop Index, using a Global Value to separate the game state change line from the line that activates the Loop, or just not using Loops at all.

    *I implemented options to 'freeze' the game and to shift the Player's scale and Alterable Value A while leaving everything else static or to check A values by mousing over the object. Such only corroborated the errors and confirmed the mismatch between values and what the calculation should produce but not how to fix.

    I can't figure out what's the problem. Is it a scoping error? Something about using forced animation frames? I notice that it seems to most consistently work when there are only a few enemies, but not sure why it'd break down with more.

    I think your B approach is the best one, at least if I understand you correctly. That's the one I always use, although I use a flag instead. Is_Destroyed = Off: object is still alive. You can use it in combination with ForEach loops, and have the condition in the event that start the loop, that way it will only start a loop with the objects that are not yet destroyed.

    Checking flags is very cheap, performance-wise, so while you might not like the inconvenience, you at least don't need to worry about the performance cost. Checking altVals is cheap too, but flags are even cheaper.

    You might also want to move enemies to some other 'garbage' layer when you destroy them. That would make them automatically immune from any subsequent is overlapping checks, without any extra conditions required.


    Thanks for the suggestion to use flags, keeps it more performance efficient at least.

    It'll be tedious, but doesn't have to be particularly error-prone.

    Just use Find All (ctrl-shift-F) to hunt down every last occurrence of the global value. To keep things straightforward, add something unique like "QQWWQ" to the beginning of it, so that the Find All will find it, and only it. Then go through each entry, pasting over it with the AltVal. Then, once Find All no longer finds any entries for "QQWWQ...", you can safely delete the global value.


    Using Find All was helpful, thanks!

    If I understand correctly issuing an order to destroy a unit only happens at 'garbage collection' when CF2.5 reaches the bottom of your lines of code and wraps around.

    This was creating problems for my code, as it is able to finish an entire 'turn' that includes "player moves and kills an enemy unit" and "check for what Enemy units still exist, in order to decide rules for Enemy unit spawning for this turn" in one go-through. Since the destroyed enemy is only removed at the end, the code falsely insists the destroyed unit is still present when doing the latter check.

    I was able to identify several means to bypass this, but which they have issues I don't like:

    A: Having "every fraction of a second" built in to require the code to progress the timeliness of action to action, which creates a 'delay' long enough to shuffle past the end and force garbage collection. This doesn't work for my needs because "every fraction of a second" doesn't play well with fast loops.

    B: Have destroyed units be made 'legally dead' by making the condition that destroys them also set their Alterable Variable K=1, then make their K=1 a condition for things like "check what Enemy units still exist". This works, but necessarily requires tacking on K=1 condition to every possible event a 'live' unit might interact with, and requiring every Per Enemy Fast Loop still have to waste energy looking at dead enemies.

    I can use method B if I have to, but if there is a clean way to make Destroy=Instant Death I'd prefer to use such instead. The fewer conditions and complexities in the code, the better.

    Is there a quick way to take all instances of code mentioning Global Variable X in a frame and replace it with code mentioning Alterable Value X of a singular Active Object?

    I'm cleaning up my code and realize I have global variables that don't need to be kept from frame to frame, and so would be better moved to an Active Object in the frame that acts as a storehouse for various values. Unfortunately at this point there is a lot of code, and making sure I've moved every reference of Global Variable XYZ to the corresponding Alterable Value XYZ would be both tedious and error prone. Is there any quick way to do so? I think its possible for moving code referencing Active Object A to Active Object B via the Replace by Another Object command, but I don't know about the same for globals.