User Tag List

Results 1 to 7 of 7

Thread: About enemies and respawns systems.

  1. #1
    Clicker Fusion 2.5 (Steam)
    AlexK's Avatar
    Join Date
    Feb 2018
    Location
    Moscow
    Posts
    13
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb About enemies and respawns systems.

    Hi, working on the first ctf project now – top-down action like thing. Experimenting with different enemies and their respawn code I found some variants working but become too unstable and overall lame. So now I faced two questions that I cant figure out myself:


    1. For enemies I tried using separate invisible objects as collision masks. Mainly for smooth collisions with each other and level obstacles. But if putting those with one test enemy and basic damage mechanic works well, using it with aoe damage and multiply enemies being respawned by different respawn object turned into total disaster. Like enemies sprites begin to swap poisons on wrong collision objects or separate from them or freeze alone and other bad things like that. I tried to use ID values but that doesnt work well in the end.

    So, is there other valid stable methods for collision objects for enemies? Or probably valid enemy movement systems instead of that ( Im using simple bouncing ball, direction - player).

    2. For respawns, simple ones work fine, but I have little idea how to make more complex, for example:
    A) respawn for unlimited ( or huge number) of enemy waves with number and type progression.
    Ive made such but limited with one enemy type for wave and limited respawn points on a zone by about 10, also working terrible with current enemies collision objects and aoe damage.
    B) respawns that sets number of different enemies and then checks if they died for new spawn ( for specific resp point from all of them on the level )
    C) how to make proper time delays for large groups of respawned enemies to avoid overlays between them

    Will be grateful for any help, advice, extensions or examples on these points.

  2. #2
    Clicker Fusion 2.5 DeveloperiOS Export Module
    butterfingers's Avatar
    Join Date
    Apr 2012
    Location
    London
    Posts
    135
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Without seeing what you have so far, it's kind of hard to help you out.
    You're saying "I tried to use ID values but that doesnt work well in the end." - but this probably the best way to solve the problem, so it'd be handy to see what you're doing at the moment, and maybe help you with what is going wrong?

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)
    coler123's Avatar
    Join Date
    Sep 2014
    Location
    Milky Way
    Posts
    49
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    1.You have two options:

    A.You can try embedded collision (best option for me) look it up here in the forums.

    B. Make a loop to create all the enemies at the start of the frame and make sure you set an unique ID for each

    >Start of Frame
    -start loop "create_enemies" as many time as you want

    >on loop "create_enemies"
    -Create Enemy or Create enemy by name (something like Create "enemy_"+random(5) if you have enemies like enemy_1 , enemy_2 and so on)
    -Set value A or ID whatever you have it called and set it to the index value of loop "create_enemies".
    -Create the Sensor you have for collision
    -Set Value A or ID of the sensor to loop index as well.

    Now to make sure the sensor stays with its partner do this
    >If ID of Sensor = ID of enemy
    -Set Enemy position to Sensor or the other way around whatever you want and need.

    2.

    A. if you want to create more enemies you have to the same but a little bit different

    >on loop "respawn_enemies"
    -Create enemy
    -set ID to SAVEDINDEX_VALUE ( for this when you start the level save the amount of enemies to this value and add 1 every time you create a new enemy)
    -Create sensor
    -Set ID to ID of Enemy
    -Add 1 to SAVEDINDEX_VALUE

    With this you can create as many enemies as you want

    B. For this you just have to save and control the amount of enemies you have in frame and also create a timer and when you kill all enemies or there are only 3 for example and you want 10 just run the loops for the amount desired

    Make sure you set the position of enemies inside the loop!! to a random position or a set one

  4. #4
    Clicker Fusion 2.5 DeveloperiOS Export Module
    butterfingers's Avatar
    Join Date
    Apr 2012
    Location
    London
    Posts
    135
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    You could just have a single collision detector and position it at each enemy object in turn, inside a foreach loop (that you use for movement, AI etc).
    This would mean you don't need to store, update and match loads of ID values, and makes spawning easier, because you don't need to save and increment the current ID you're using.

  5. #5
    Clicker Fusion 2.5 (Steam)
    AlexK's Avatar
    Join Date
    Feb 2018
    Location
    Moscow
    Posts
    13
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the answers!

    First about code Im trying now, its like: https://gyazo.com/7a8c3951aa68e99df002e7f89cadae04 ( as core fragment)
    for the main respawn, and for secondary respawn just simple: Every X time - Create Monster from X, Create Collision box from X
    These without ID values works fine until some of this monsters die, and there sprite objects (sometimes) jumps for another wrong collision boxes.
    And when any of these enemies take aoe damage same time, like: Create collision circle, if circle overlaps enemy - substruct hp; it most likely destroys collision box, but sprite object remains ( and somehow refuses to be deleted with separate special event - 441, 442 on the screen. And invisible undamageble c.boxes remain moving and acting without sprite objects)

    And then for mobs moving and death events are: https://gyazo.com/8ef7104f5b6a0cf53f8106ab32fc9300
    Collision boxes are now individual for each enemy and grouped as "Enemies". Values like Hp sets in those collision boxes and events like collisions with player or projectiles also works with group "Enemies".

    coler123, looked for embedded collision, thanks, didnt heared about it before. It looks promising but I doubt one thing. If I got it right, it wouldnt work for collisions between objects with similar collision systems. And I need monsters not to overlay and stack in one point.
    As for your examples I think they are close to what I try to use. Besides you write " >If ID of Sensor = ID of enemy " and I use mirrored code, as I remeber I tryed other variant and it doesnt work.
    Also you use Add value X in loop event which doesnt work for me also. As I understand fastloops executed somehow in one time moment and thoes Value +1 doesnt work then. But am right with that?

    butterfingers, I should try that! I cant do this before because values are stored in Collision boxes for scoping - for other events. But mb I should set Values to Sprite objects and only some of collisions for c.box

  6. #6
    Clicker Fusion 2.5 DeveloperiOS Export Module
    butterfingers's Avatar
    Join Date
    Apr 2012
    Location
    London
    Posts
    135
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    @AlexK

    TBF, the code is pretty hard to read as screenshots, since you can't hover the mouse and see what those groups are called etc.
    If you just post your MFA I'll take a look and give you a hand
    (I have no intention of stealing your code, got plenty projects of my own )

    Also you use Add value X in loop event which doesnt work for me also. As I understand fastloops executed somehow in one time moment and thoes Value +1 doesnt work then. But am right with that?
    No, Fastloops don't happen all at once, they happen 1 after the other. if you run a loop 5 times, all those 5 happen one after the other, but in the same update. So if ValA is 0 and you run a loop 5 times and on loop you do ValA+1, it'll be = 5 at the end of the loop.

    I cant do this before because values are stored in Collision boxes for scoping
    Yeah, understandable. I don't think there's anything inherently wrong with doing that, personally I just don't like having my variables for an enemy spread over a number of actives. Would rather have the collider _just_ be a collider, and keep all the variables for the enemy on the enemy himself.
    Like I say tho, your way isn't wrong, it's just different.

    But yeah, I'm happy to take a look at your MFA and make some suggestions if you want

  7. #7
    Clicker Fusion 2.5 (Steam)
    AlexK's Avatar
    Join Date
    Feb 2018
    Location
    Moscow
    Posts
    13
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ok, thanks, Ill pm you mfa, but its rather big and not user friendly)
    For all I can comment that what I use on screenshots mainly is:
    1. for respawn:
    Add +1 Value monster ID of respawn object
    Create Mob; set Val ID to Val monster ID(as group)
    Create C.Box; set Val ID to Val monster ID(as group)
    2. for enemies:
    a) if number of Mob Sprite Obj >0
    if Sprite overlaps C.Box then:
    C.Box look at Player
    Sprite set position to C.Box

    b) if C.Box hp Val < 1
    if C.Box overlaps Sprite
    if ID of Sprite = ID C.Box
    then destroy Sprite, destroy C.Box


    Hmm strange about loops and values, mb I messed up something than, but when I replace loops with regular events with same +Values it worked fine then.

Similar Threads

  1. performance problems on different Windows systems
    By jchristiansen in forum Fusion 2.5
    Replies: 4
    Last Post: 28th June 2015, 05:45 PM
  2. Replies: 15
    Last Post: 16th September 2014, 11:15 PM
  3. Opinions on Text Systems
    By Vandas in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 2nd February 2008, 03:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •