User Tag List

Results 1 to 6 of 6

Thread: Multi-Part Enemies / Line of Sight

  1. #1
    No Products Registered

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

    Multi-Part Enemies / Line of Sight

    Can't really get the hang of this.

    Basically at the moment I've got multiple instances of my badguy object. For each badguy there's also an invisible "line of Sight" object. What I want is for the enemies to go into an "alert" behaviour when their personal line-of-sight is overlapping the player. So far everything works except that every enemy becomes alerted when only one spots the player.

    I've tried spreading values and testing for them but it doesn't seem to work. Can someone help me out?

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Kimera's Avatar
    Join Date
    Feb 2007
    Location
    Houston, TX
    Posts
    729
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Multi-Part Enemies / Line of Sight

    So they are borg? OK sorry. Can you post a sample?

    Another thought after a re-read.

    Many people, including myself, when starting out with spread values use it in something like Start of Frame or call it on a loop. This will not work if you add or remove any uses after calling. You will have to then recall. Many people use and Always, I like to manage it a bit.

    Sill post if you can and this does not help.

    Hope that helps...
    K

  3. #3
    No Products Registered

    Join Date
    Jan 2011
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Multi-Part Enemies / Line of Sight

    Ive also noticed this happen to one of my games when I duplicated the active objects rather than cloning them.
    Not sure if thats your issue or not, but figured I'd share.

  4. #4
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: Multi-Part Enemies / Line of Sight

    I'd be happy to make you an example but I just need a bit more info first...
    * Is there only one player object, or are there several?
    * What is the "line of sight object"? Is it a true line-of-sight (ie. do you want it blocked by obstacles?), or is it a circular radius or cone? (if it's one of the latter options, you'd be better off using maths instead of extra objects).

  5. #5
    No Products Registered

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

    Re: Multi-Part Enemies / Line of Sight

    Quote Originally Posted by MuddyMole
    I'd be happy to make you an example but I just need a bit more info first...
    * Is there only one player object, or are there several?
    * What is the "line of sight object"? Is it a true line-of-sight (ie. do you want it blocked by obstacles?), or is it a circular radius or cone? (if it's one of the latter options, you'd be better off using maths instead of extra objects).
    There is only one player object, so it's easy on that front. The line of sight object is literally a line between the player and the enemy, it is an active object stretched and rotated in such a way that one end is always touching the player and one end is always touching the corresponding enemy. Testing if the enemy can see the player is just a matter of seeing if the line is overlapping an obstacle or not. So yeah, it's proper.

    Cheers in advance, I eagerly await your response.

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: Multi-Part Enemies / Line of Sight

    Generally speaking, it's good to avoid using fastloops wherever possible, as they can affect framerate quite badly.
    MMF2 will automatically match objects for you, so there's really no need to use spread values / fastloops for something like this anyway.

    Here's a quick demo:
    http://cid-b1e7ee094271bbda.office.live.com/self.aspx/Public/LoSFeb11.mfa

    If your enemies have a limited vision range and field of view, it would be more efficient to check these first, and only distort the LoS objects if the other checks are ok. If you're using HWA it won't make much difference though, as scaling/rotating is so fast.

    I've included a version using spread values and fastloops.
    I did a quick test, and it looks like the version with fastloops is quite a bit faster in standard mode (which would include Flash), while the loop-free version is much faster in HWA.

Similar Threads

  1. multi line edit box- Line selection
    By richardh in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 27th December 2013, 07:08 PM
  2. Line of Sight example
    By Ryan in forum File Archive
    Replies: 4
    Last Post: 30th August 2010, 05:27 AM
  3. Line of Sight
    By Panchos in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 29th August 2010, 11:36 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
  •