nimos100's Forum Posts

  • If Textbox = Manuel

    ---Set Textbox = Auto

    Else

    If Textbox = Auto

    ---Set Textbox = Manual

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the clarification, think that was greatly needed

    However in what circumstances is the extra functionality of "On collision" a benefit or where is it intended to be used? At least in my experience I mostly used it with bullets hitting an enemy and then the bullet is destroyed. However you say that it needs to keep track of when the separation happens and touch again. Where as "Is overlapping" doesn't do this and just checks for an overlap, which is really what you need when a bullet hits an enemy for instant as the bullet most likely is destroyed.

    Im a bit uncertain how to formulate the question , but can you give an example where "On collision" would outshine "Is overlapping" meaning where the extra functionality is obvious or what to say? or if anyone else can? I would appreciate it, because im happy with the clarification, but sadly I still don't see the reason to use "On collision" over "Is overlapping", so an example would help me?

  • "Make sure collision conditions are the first condition in the top-level event"

    But then again you should put them first, since that will improve performances regardless of what is stated in r155 as some others have mentioned as well

    Ashley and those did some tests that are in r155, which clearly shows improvements, so something must have happened from there to now, because I doubt they would have missed this performance difference if they tested both of them back then, especially because in there tests they also uses a lot of objects and you don't really need any numbers to see that there is a difference between them.

  • i dont get it, can someone please post a image of how you must do this¿

    "Make sure collision conditions are the first condition in the top-level event"

    how it would look like in a event sheet?

    is

    is overlapping

    >>>> >damage = 0

    or

    is overlapping

    damage = 0

    can someone please explain me?

    As far as I understand it, it shouldn't matter, what is important is that you don't pick any objects first, since that is what should disable the collision cells and force brute force. So both your examples are correct or the way it should be according to r155.

  • Here is an example of how you can do it, I don't think it does exactly what you need, but it might give you some idea of how you can make it.

    It just uses as list where each attack type is stored (Light attack, Heavy attack) When the list reaches 4 attacks, it will call the function "Execute attack" and in that function you can specify what should happen when a certain combo is made. In my example it only deals with up to 4 "Light attacks" but should show you how you could make the others if that is what you need.

    Also it uses an automatic execute counter, so if the player haven't pressed any attack for 2 seconds it will just execute whatever attack combo is in the list. Anyway maybe It can give you some ideas of how to make what you want.

    [attachment=0:23imn4e4][/attachment:23imn4e4]

  • I think its easier to pick them if you convert it to Tile coordinates. That way you can just add integers values as distance to what you want to pick. Here is a very simple example:

    Now in this case I have just chosen a fixed point of the table at (2,2) but it would be the same if it weren't fixed, and then I use a Range variable to set the desired range.

    So you just have to convert the mouse click to a tile coordinate or the sprite thing you use, which you can do with PositionToTileX and PositionToTileY.

    Tilemap.PositionToTileX(Mouse.X)

    Tilemap.PositionToTileY(Mouse.Y)

  • This kind of depend on your design. But from what I get from looking at the game, you have the line in the middle and to this there are linked two other objects to the end, which if the player touches them they kill hims. So you could do it, so when you create the line and the end points, you store the UID of the line as a variable in the end points.

    Create Line
    
    Create End_point_1
    Set Parent_UID = Line.UID
    
    Create End_point_2
    Set Parent_UID = Line.UID
    
    On Collision Player with line
    Pick End_point_1.Parent_UID = Line.UID
    Pick End_point_2.Parent_UID = Line.UID
     [/code:32doi3q8]
    
    This way of doing it is not really the best way of doing it, but since you don't use families etc. and I guess you are fairly new to C2, if im not wrong, then this way is probably the easiest and then you can always change it later.
  • You have a picking problem, when the player collide with, for instant "Barritaentera" you destroy "Barritalzquierda" and "BarritalDereccha" as well. (Sick names btw ) But you never pick which of these to destroy, so it just automatically pick all of them and then destroy them. You have to pick the correct ones of "BarritalDereccha" and "Barritalzquierda" as well, and the same goes for all of your "On collision" events.

  • Think that's a good idea

  • Use Set animation "<The name of the animation>"

  • FYI to everyone: debug readings are not to be trusted. If you really want to run comparisons, make a spritefont readout and populate it with fps/cpu/objCount/etc.

    Anyway: When I experimented with this back a few months ago, my impression was that 'on collision' and 'is overlapping' tended to be similar to each other vis-a-vis CPU usage. However, when pushed really hard (bullet hell shooter with thousands of bullets), 'is overlapping' had pretty consistent performance, whereas 'on collision' seemed to cause more instances of stutter and slowdown, even if the average CPU/FPS was the same.

    I know that the readings are not 100% accurate, but I don't see the huge importance in that, as stated earlier, its not that important whether its 90.1% CPU Util or 91.3%. But that you can and will see a difference in performance and a severe FPS drop, which you don't have to measure really because you can see everything is lagging around.

    According to the r155 collision changes that someone posted earlier, not all of it seems to be working as stated there. It says that for optimal performance it is suggested that you put "Is overlapping" before any other picking condition to avoid C2 having to brute force collision checks. However in another program I made for testing collision, I get better performance (10-13 FPS improvement) when putting "Is overlapping" as the last condition, after Im done with the picking conditions, which should make it brute force and therefore give worse performance, but its the exact opposite from my experience at least. And that test is with 1700-2000 moving objects, so 10-13 fps is not a small increase.

    (After running it again, its actually more like 17-23 fps with 1740 object)

  • Each bullet has to check against enemies, each enemy has a separate left & right shield which when depleted, the collision is ignored and checks if it collides with the hull afterwards. Drones also check for collision to enable/disable some movement.

    Looking at your collision count in the screenshot, even though you have 1300+ objects, it doesn't actually do a lot of collision checks (approx. 115 / t). Which obvious is because it not 900-1200 bullets, but mostly all kinds of other objects. But you could try for fun to increase the fire rate of your ships and maybe set the bullet damage to 0 or something and just really let the ships fire like crazy to crank up the numbers of bullets and see how much performance drops and how quickly. Because with low amount of objects, you wont really see a huge difference. And 115 /t collisions are very low already, which ofc is just good that you don't need more.

  • >

    > > I find no difference between On collision or Is Overlap.

    > >

    >

    > That sounds weird, because there is no doubt when I test it that I get a huge difference in performance, do you have any data to show, that would be interesting to see?

    >

    > Like how many objects etc. would like to see that.

    >

    ~1400 objects peak, 60% CPU usage. No difference in CPU usage with On Col or Is Overlap. No difference in collision checks per tick.

    That makes no sense, that would kill/slow down my game if there was so many objects with "On collision". Can you do me another favour and run this program, or if anyone else could as well. And just disable "On collision" and enable "Is overlapping" and next try the other way around and screenshot the debug performance window. Because it seems strange that it would be that different. Have you done anything special with your "On collision"?.

    [attachment=0:dissnu67][/attachment:dissnu67]

    The results I get from this is these which uses 1024 objects:

  • > Its primarily the "On collision" under setup, try to disable that and let it run again. You shouldn't use "On collision" it is a performance killer

    >

    and what you suggest to replace "on collision" ?

    overlapping ?

    and what is the difference between them

    Yeah I would replace "On collision" with overlapping due to performance. I don't know what the difference is, but just that you loose performance using "On collision" it can easily be tested, just make a program as in my example.

  • nimos100 not sure but AFAIK the debbuger can add an overhead, to be really fair you also have to make them behave the exact same way too to really evaluate a waste between the two (is overllapping does not have to verify if it was already colliding with the same exact instance in the past, while on collision does, also not sure what happens if you have 2 collisions at the same time that occurs between 1 sprite2 and 2 sprite in the same tick between on collision and is overllaping).

    but that is interesting.

    Im not sure what you mean, what im showing is if you are testing for collisions using the two ways there are. Why waste is important im not sure, because if I increase the number of yellow squares the one using "On collision" will eventually drop in FPS due to amount of objects before the "Is overlapping". So im not looking for exact numbers, just that you can improve performance using one way over the other. Can you explain what you mean differently because Im not sure I understand what you mean?