User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: "Inactive if far from Window" still runs events?

  1. #1
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    353
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    "Inactive if far from Window" still runs events?

    I'm working on a platformer style game where a lot of the tiles that the player and enemies walk on are Active Objects (Blocks).

    The blocks are of a certain size so that about 250 to 450 can be on screen at once. When there are many of these "Active Blocks" on screen the game lags severely (minus 20 FPS!) when scrolling.

    If I open the block's properties and set "Inactive if far from Window" to "YES" the frame rate is restored to its maximum of about 58-60 FPS (set at 60). Everything looks good.

    But, now the enemies that are off screen fall through the blocks, but NOT the background obstacles. Its as if "Inactive" state just disables object collisions, but continues through its normal event loops.

    To clarify, my game uses an event-based platform movement, not the built in movement. But when an object goes off screen and becomes "Inactive" it continues to fall through other Active objects that it should register a collision.

    If the object becomes "Inactive" shouldn't it NOT move at all? If it disables collisions, why would it still run through its events that check for collisions? What exactly does "Inactive" mean if the object still calculates all its alterable values and movement events? Does it JUST disable collisions and animations?

    Also, is there a way to set the distance that the objects become "Inactive" at? I want some object interaction to occur outside the window, but only to about a screen's width away. The default property seems to "Inactivate" objects about 20 pixels away from the screen edge, which is a very short distance.

    Any event based work around to the above wouldn't fix the Frame Rate issue, and would only further strain the game's speed. I've ticked "Load on Call" and set "Maximum objects" to "20000" and can't think of what else I could do to increase frame rate.

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: "Inactive if far from Window" still runs events?

    Quote Originally Posted by JimJam
    But, now the enemies that are off screen fall through the blocks, but NOT the background obstacles. Its as if "Inactive" state just disables object collisions, but continues through its normal event loops.
    What did you expect it to do? It totally censors them out of the event loop like a cuss word.

    If you want you can apply the same property to the enemies.
    Working as fast as I can on Fusion 3

  3. #3
    No Products Registered

    Join Date
    Mar 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: "Inactive if far from Window" still runs events?

    I have just had this issue myself. This will be a little away from what you actually ask about, but maybe it's helpful anyway!

    First, the basic.. You should use HWA version, and set the Display Mode to some Direct thing.. Im using Direct3D 9, and that is a great improvement from Standard.

    Next, you probably have a lot of fastloops. You should replace as many as possible with ForEach loop. Its a super extension!

    Thirdly, in my game, I got this crazy idea to create a big, invisible box that is NOT following the frame. I then simply added "Enemy is overlapping BigInvisibleBox" in all of the enemy movement events. The idea with this was to prevent them to move while out of the window. The idea is similar to "Enemy is in play area", but for some reason, stuff often stop working while using this.

    And then the last idea, that really improved my game, was to replace the enemies with EnemyCreatorObjects. Here again, EnemyCreatorObject is overlapping BigInvisibleBox = Create Enemy at EnemyCreatorObject (and then also destroy EnemyCreatorObject). This way, its no enemies in front of your character unless they have been in the frame.


    Hopefully something useful here! It could be a lot of extra work tho, at least it was for me. But it was worth it, my game does not lag anymore.. Or at least not on my PC.

  4. #4
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    353
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: "Inactive if far from Window" still runs events?

    I see what you did. I have most of the features in place that you mentioned.

    My objects on screen are not manipulated by Fastloops, so there are actually ZERO fastloops running during average play.

    I do use the EnemyCreatorObject method. This is the only time I use Fastloops, other than the level renderer (which takes place only at Frame Start). I call a "Creation" loop ONCE to create and set properties (used like a function) as the enemies approach the screen.

    You do NOT have to use a Big Invisible Active to detect enemy distance to screen. There is an event in MMF2... something along the lines of "Object is within X pixels of window edge." Use a negative number to judge the distance off screen. This saves you the RAM used for a huge active object with its own Values.

    I also agree about using Direct3D 9. It is better, but I also want the game to run well on systems without Direct3D 9.

    For example, I have a copy of "The Knytt" source which I have been studying for reference. I have modified "The Kyntt" to include realtime scrolling as a test. "The Kyntt" uses STANDARD display mode, and runs at steady 50 FPS with 4750 Objects in frame! Even when I filled the entire screen with 200+ active objects and scrolled around rapidly, the frame rate never dropped!

    My game runs at less than 40 FPS with 400 objects in frame on STANDARD display! And it has a LOT to do with what memory saving options you select (like Load on Call and Inactive if far from Window).

    I just think that if Kyntt can run fast on STANDARD display mode with 4000+ objects, then so should my application!

    While your method of making them NOT move when off screen does work in theory, my only problem with that is that the enemies can tend to "cluster" together if they all pause in the same spot at the same distance off screen.

    The other problem with that is that it would be apparent to the player that the enemies who walk of screen do not walk back on screen, and that by walking forward you would see them waiting just off screen as you pass! This would appear odd in my opinion.

    My main concern is what distance from the screen edge do Objects become "Inactive" and is there any way to increase or decrease it?

  5. #5
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    353
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: "Inactive if far from Window" still runs events?

    Quote Originally Posted by LB
    What did you expect it to do? It totally censors them out of the event loop like a cuss word.

    If you want you can apply the same property to the enemies.
    Thats the thing, it does NOT censor them from the event loop. It JUST disables Active-on-Active collisions. They still react to Background collisions, and still run all of their behaviors and events. They do not STOP moving. If I created an active object that calculated Pi to one million digits in Alterable Value A that was off screen, it would still calculate Pi to one million digits! It just wouldn't register collisions with other actives!

  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: "Inactive if far from Window" still runs events?

    Do you have an example of this? I tried to replicate it but I couldn't.
    Working as fast as I can on Fusion 3

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: "Inactive if far from Window" still runs events?

    To avoid further confusion, here are the facts:

    If "Inactivate objects outside the window" is set to Yes, this happens when the object is outside the display area:

    * Pre-build movements stops (like the bouncing ball or platform movement)
    * The animations doesn't play
    * Background overlap conditions won't work (even if "handle background collisions even out of window" is enabled)
    * Events related to the object still work completely normally, custom movements will e.g. continue to work (apart from the background collision checks of course)
    * Overlaps with other objects are still registered, even if "Inactivate objects outside the window" is set to "Yes" for both objects.

    Personally, I think sub-event support would solve this. In that case, you could just wrap all your events inside a single "object is within display area" condition. MMF3 perhaps

  8. #8
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: "Inactive if far from Window" still runs events?

    A sub-event workaround for this case would be ForEach + Group.
    Working as fast as I can on Fusion 3

  9. #9
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    353
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: "Inactive if far from Window" still runs events?

    Quote Originally Posted by Nifflas
    To avoid further confusion, here are the facts:

    If "Inactivate objects outside the window" is set to Yes, this happens when the object is outside the display area:

    * Pre-build movements stops (like the bouncing ball or platform movement)
    * The animations doesn't play
    * Background overlap conditions won't work (even if "handle background collisions even out of window" is enabled)
    * Events related to the object still work completely normally, custom movements will e.g. continue to work (apart from the background collision checks of course)
    * Overlaps with other objects are still registered, even if "Inactivate objects outside the window" is set to "Yes" for both objects.

    Personally, I think sub-event support would solve this. In that case, you could just wrap all your events inside a single "object is within display area" condition. MMF3 perhaps
    Thats odd. Because in my game engine, the objects fall through the Active object blocks, but don't fall through the Background object blocks... How would you explain that? The overlaps with Object do NOT work if one, or both, are set to "Yes." But background collisions still work even if I move 3 or 4 screens away.

    A sub-event workaround for this case would be ForEach + Group.
    How would I do this? Could you explain how, and what it would do? I have never used the For Each object yet.

  10. #10
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: "Inactive if far from Window" still runs events?

    Well, you would run a ForEach loop for the objects and have a couple events on the loop; one to enable the group, and one to disable it if the current object is not on screen. Then in the group you do your movement and collisions and everything else you want to do for the objects on screen.
    Working as fast as I can on Fusion 3

Page 1 of 2 1 2 LastLast

Similar Threads

  1. [BUG] Ini object interferes with "Play sample from file" events
    By Strife in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 3rd September 2013, 03:21 PM
  2. iOS Video: "stopped" and "paused" events don't work?
    By smart_fr in forum iOS Export Module Version 2.0
    Replies: 0
    Last Post: 25th August 2012, 01:03 AM
  3. App runs when "built" on my device, but crashes once archived!
    By BrashMonkey in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 17th December 2011, 07:50 AM
  4. Suggestion: "Find and Replace" feature for events
    By Sebaceous in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 19th May 2009, 04:55 PM
  5. "Internal error! Objects or events..."
    By RayMarble in forum The Games Factory 2 - Technical Support
    Replies: 6
    Last Post: 2nd November 2008, 06:30 PM

Posting Permissions

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