Posts by Psychoplasmics

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.

    That makes sense thank you! Good to know about the animation object to get a better grasp on whats happening exactly. Hopefully this is a problem Clickteam can address with an update at some point with more control over the speed counter.

    In the meantime I've decided to just set animation frames manually with values. I thought there'd be problems but it was suprisingly easy to set up. Requires a couple events for each animation to set their number of frames and animation speed, but only takes few minutes and now I don't really need the built in animation system anymore.

    Not sure if I'm misunderstanding how animation speed works here or if there's something wrong.

    I have timer-based movements turned off and have my animation speed set to 25. I believe this should make each frame of an animation last 4 frames.
    It does, except when changing animation. When I switch from idle animation to walking animation the first frame of the walk lasts 5 frames, then the rest go 4. When I switch back to idle the first frame of the idle lasts 5 then the rest are 4.
    I tried increasing the animation speed to 26, but then every few frames last only 3, so thats the wrong setting.

    I'm pretty sure 25 is the correct setting for 4 frames per animation frame but why is that first frame lasting a frame longer? Doesn't seem to be the code either. I tried testing with simple code like:

    Button is not held: Set animation to idle
    Button is held: Set animation to walk

    Even with this simple code the problem still happens. Any ideas?

    The physics object is working but I'm still very interested in exploring ideas like these as I would switch off physics if we came up with a good enough alternative and its just cool exploring ideas that could maybe used for optimization in other ways. Not running code for every enemy for every frame is a great idea that I had thought of but thought would be harder setting up then what you just posted and would probably require loops. Didn't consider just mod and fixed values could do it. Even the "collides with" and "is overlapping" events might not be so hard on performance if they were only run on a portion of enemies at a time instead of all of them every frame.

    I haven't tried the flocking object but I had looked in to some old posts here about making flocking from scratch. I'll look in to it but I imagine I'd have similiar issues that I have with physics, using an extension that I don't have full control of the inner workings on and may have quirks I can't change. I usually try to avoid extensions unless a feature is competely impossible or way worse without the extension.

    Very interesting ideas! Trying these specific methods and numbers didn't have huge results, assuming I did them correctly, but it is an improvement. The enemies group in a little cloud instead of all directly on top each other. Not quite good enough on its own. But I do see how this sort of approach could get something close enough with some additonal layers of randomization, maybe some tweaks and different numbers, combining with other methods. This gets ideas flowing, I'll keep experimenting and see if it leads me anywhere.

    As of right now I'm still leaning more towards the physics object method above, the collision detection there is SO nice, but if this sort of approach could lead to solution thats even half as good I'd be willing to settle for the much less perfect result in exchange for the added control of not using a prebuilt unmodifiable physics engine. I'm gonna go back and forth messing with each and see which gets me to something I like first. Thanks guys!


    EDIT: A vague idea coming to me is that maybe the amount of enemies currently spawned and the order in which they are spawned could have an effect on values like the offset and veerSeed? So like a small number of enemies create a small cloud around the player but if a ton of enemies are spawned then they know to spread out in to a much larger cloud. Not sure exactly how or if that would work but feels like there's potential there. Spark any ideas for anyone?

    EDIT2: Maybe the player's distance and angle from enemies could also play a factor along with the amount of enemies and the order they were spawned in setting these numbers? Just spitballing ideas as the come.

    I guess to put it simply, what I'm trying to do is sort of fake collision detection between enemies without actually performing collision checks, and not running ForEach loops on them either if possible. Just some well performing way of telling an enemy there is probably another enemy in a spot or creating the illusion thats happening.

    Thank you! This seems to be working well for collision but I get so nervous working with the physics object as I've had bad experiences with it in the past. It seems to have little quirks that I can't do anything about since I can't access the code itself handling the physics. I really prefer the complete control over doing everything from scratch.

    I've had times where the physics object will insist on adding collision to an object that I don't want it to or objects sliding along backdrops/the edge of screen even though I've told them to stop moving. I also just don't feel I have as much control over things like setting an objects specific speed. The set velocity function has this very tiny window of a few numbers that are usuable and everything else is way too slow or way to fast.
    Also it sometimes seems like the frame rate fluctuating actually changes the way the physics function. Like I'll get a frame dip and then an object moves faster then its supposed to or clips through something.
    Also is it safe to combine physics with custom movement? I've felt in the past like these don't always combine well. Like a custom player movement with physics enemies create discrepancies so the player really needs to be on the physics engine too.

    I would love to use the physics object for just the collision to prevent overlap and then otherwise do everything custom but I'm not sure if thats wise.

    Maybe its just my inexperience with the physics object though and these things are all fixable problems. If this is really the only way to handle these collisions at a smooth frame rate then I guess I'll just go in on this and figure out how to make the stuff work.


    Right off the bat I'm facing an issue I'm not sure how to address. With my game I don't actually move the player, they are just a graphic in the center of the screen. Instead I move all of the enemies in the opposite direction the player is pressing to create the illusion that the player is moving and allowing them to keep moving in the same direction infinitely. But doing that with these physics enemies, they all get stuck on the left edge of the screen. I didn't tell them to stop when colliding with the screen edge. They just do it automatically and I can't seem to tell them not to. Weird things like this really make the physics object frustrating...


    EDIT: Fixed the screen edge issue by using "apply impulse" instead of changing coordinates. Also realized impulse can actually have decimal point allowing for a much wider variety of speeds. Looking like a lot of these issues I just complained about are probably easily fixable if I just keep experimenting with the physics object. Kind of annoying to have to change my design approach so much just to add collision detection but it looks like this is the way to go! So thanks so much for the advice! :)

    I am trying to make a game like Please login to see this link. with an extremely large amount of enemies, items, and projectiles on screen at once.

    The one issue I can't seem to figure out is preventing enemies from all gathering on top of each other without severely limiting how many I can spawn or plummeting the frame rate.

    I've kept their AI about as simple as it can possibly be:

    Always
    +Set direct to "ATan2(yPos( "Active" ) - 180, 320 - xPos( "Active" ))"
    +Add "Cos(direct( "Active" )) * 1" to xPos
    +Subtract "Sin(direct( "Active" )) * 1" from yPos
    +Set X Position to xPos
    +Set Y Position to yPos

    This is really all I need the enemies to do as far as AI. They move toward the player in the center of the screen, dont have any obstacles to collide with or anything.

    With these events alone I can spawn over 4000 enemies before the fps begins to dip below 60.
    Problem is they all gather on top of each other since there's no collision detection or anything.

    I have spent the last few days digging through this forum looking for a way to keep them from overlapping while keeping enemy count and frame rate as high as possible, but I haven't been able to find a solution thats good enough. Every method has sunk the possible enemy count down to around 100 or less before frame rate starts dipping below 60 and thats just the enemies alone, keep in mind I'd still need tons of item drops and projectiles as well. Look at the video of Vampire Survivors I linked above to get an idea of what I'm trying to do.

    So does anyone have any ideas? I was thinking the solution might not even *necessarily* be collision detection. I'm assuming thats whats needed, but maybe since enemies dont need to collide with walls or anything, maybe there's some other more perfomance friendly way of telling them "don't stand on top of each other".
    I found an interesting approach Please login to see this link. that doesn't even use the "collides with" or "is overlapping" functions, instead using coordinates and variables, but this example is really old and still not quite well performing enough.
    But it got me thinking that there might be some kind of creative solution to this problem.

    Or I don't know, maybe a collision event is required. I'm open to whatever approach, I just want to get as close to the amount of stuff on screen as Vampire Survivors that CTF2.5 is capable of pulling off at 60 fps.

    Awesome thank you! This will do. If anyone is aware of a way of doing this without the surface object I would like to avoid extensions, but if not this way works fine.
    One question about this surface object though. Is there any way to distinguish different lines with different events within the same surface object? Like if I wanted one line for line of sight detection and another line for hitscan detection, could I have them both within the same surface or would I need two surface objects for that? If the latter, how performance friendly is it to have multiple? Not that I need to, but would it be feasible to have like a dozen surface objects at the same time or would that kill performance?

    So I'm using the following code to draw a line from one object to another:

    Always:
    Set object "Line" X Scale to "Distance(X( "A" ), Y( "A" ), X( "B" ), Y( "B" ))"
    Set object "Line" angle to "ATan2(Y( "A" ) - Y( "B" ), X( "B" ) - X( "A" ))"

    The problem is when aiming any direction other than right, the line becomes slightly off center as you can see in the image below. I want the start of the line to always be attached to the white pixel in the center of the blue box and the end of the line to always be attached to the other white pixel. I've attached an example of the problem. Any ideas?

    So I've attached an animated GIF to try and explain this better.

    Basically I would like to be able to attach a smaller object to a larger object, and have the smaller object's angle and position change correctly as the bigger object's angle is changed.
    Imagine the bigger object is a room and the smaller object is a chair in that room. When rotating the room, the chair would change position and angle to stay in the correct spot within that room.
    If my explanation is poorly worded, just look at the GIF and it should make sense. Anyone got any ideas on how I can pull it off? Thanks!

    That did it. Thanks a ton! Can't believe I didn't try that. I thought that without the decimals it would just round to the nearest number so the fact that some results were as much as 5 off made me think that couldn't be the issue. Guess that probably relates to Mod or something. Either way, working perfect now! Thanks again!

    So I found some equations for detecting the 2nd Sunday in March and 1st Sunday in November.
    (Day of month = 14 - (1+Y*5/4) mod 7)
    (Day of month = 7 - (1 + 5*Y/4) mod 7)
    Found here: Please login to see this link.

    When entering these in to google it gives me the correct date. But using the same equations in CTF does not.

    14 - (1+2019*5/4) mod 7
    Google= 9.25
    CTF=10

    14 - (1+2020*5/4) mod 7
    Google= 8
    CTF=9

    14 - (1+2021*5/4) mod 7
    Google= 13.75
    CTF=8

    14 - (1+2022*5/4) mod 7
    Google= 12.5
    CTF=14

    14 - (1+2023*5/4) mod 7
    Google= 11.25
    CTF=13

    14 - (1+2024*5/4) mod 7
    Google= 10
    CTF=12

    14 - (1+2025*5/4) mod 7
    Google= 8.75
    CTF=11


    I know Mod works differently in CTF than it does in other programs but am not sure of the specifics. Anyone here able to determine what the offset is and what adjustments I can make to the equation to make it work?

    Whoops! So I figured out that I need to put the number of their width rather than OWidth. So:

    Set X Scale to: ( X Right Frame - X( "Active" ) ) / ( 32)

    New issues! The object does not always stay attached to the right edge. Some of the in between steps has it jump back. Also it can not go smaller than it's default size. Any solutions for these?

    EDIT: Just saw the floating point thing you added to the post! It works perfect now! Thanks so much!!!

    The first event loads the file:
    INI > Loading and Saving > New/Load/Change File > "Apppath$ + "savefile.ini""
    Then set each value to a value you've saved in the file:
    Player> Set value "HP" to "GetItemValue( "Ini++ v1.5 Object", "Stats", "Health", 100 )"

    You can replace "Start of Frame" with whatever you want your load event to be. If you're wanting to do it from the main menu you could do something like:

    On Frame 1 "Main Menu":
    User clicks button "Load Game":
    >Set Global Value A to 1.
    >Go to Frame 2.

    On Frame 2 "Game":
    >Global Value A=1
    INI > Loading and Saving > New/Load/Change File > "Apppath$ + "savefile.ini""
    INI > Set current group to "Stats"
    Player> Set value "HP" to "GetItemValue( "Ini++ v1.5 Object", "Stats", "Health", 100 )"
    Set Global Value A to 0

    Saving the player's Health would be like this. You would do the same thing for every value you want to save.

    Start of Frame:
    INI > Loading and Saving > New/Load/Change File > "Apppath$ + "savefile.ini""
    INI > Set current group to "Stats"
    Player> Set value "HP" to "GetItemValue( "Ini++ v1.5 Object", "Stats", "Health", 100 )"

    Player gets hit:
    Player > Subtract 10 from value "HP"
    INI > Current Group > Set Value > Set value "Health" to Player's value "HP"

    Save Event:
    INI > Loading and Saving > Save file

    So I am using the Physics-Bouncing Ball movement and trying to change its angle using a fast loop like this:

    Repeat while Right is pressed
    >Run Loop "Turn" 10 Times

    On Loop "Turn"
    >Set Object angle to Object Angle + 1

    This normally works fine, but with Physics-Bouncing Ball the object only turns by 1 regardless of how many times the loop is run.
    I've tried removing the object from the physics engine and removing it's movement setting during the loop, then adding it back once the loop has finished. This works, but once it is added back, it's angle resets to 0. So that's not an option either.
    Is there any other way to achieve this with physics?

    Okay so I checked out that example file. While the Blowfish object is present in it, it does not seem to be in use from what I can tell. The PDF included mentions that Blowfish will be covered in future tutorials which I can't find. I tried just using the "Encrypt File" option on the .arr after saving it but that doesn't seem to do anything. Anyone know where I can find a Blowfish tutorial for Array files?

    Okay so I assume loading would be something like:

    Set Z dimension index to 1
    Set Y dimension index to 1
    Perform score loading event
    Set Z dimension index to 2
    Set Y dimension to 1
    Begin coin loading event

    Am I understanding right?

    EDIT: Also thank you! Will check out that example file! I've heard there are sites that let you decrypt blowfish using its encryption key. How does the Array select it's encryption key? And is there any way for player to obtain that key through the save file?