User Tag List

Page 4 of 5 FirstFirst ... 2 3 4 5 LastLast
Results 31 to 40 of 45

Thread: Enemy AI

  1. #31
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure i have some ideas as to what might be causing this.
    Fist i need some more info on what you have done so far:

    Have you copy pasted the 'code' intlo your own application, or have you replicated it?
    Have you copy pasted the 'objects' ( enemy, Player, both AdvancedDirectionObjects ) intoo your own application, or haw you created new ones?
    Could you post a screenshot of your enemys ( object wich is using the AI code ) Animation Editor ( Stopped animation )?

  2. #32
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2012
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I replicated it changing the code to apply to all of my objects.
    I used my existing player and enemy objects and applied to code to those. I have both AdvancedDirectionObjects in my project.

    Here is the screen shot of the animation editor. I imagine this is what is causing the problem as I have a few animations.
    bear.jpg

  3. #33
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can doubble click Advanced Direction Objects from the Frame Editor, a popup window will appear and you will be able to punch in a number ( number of directions ).
    Make sure for "Advanced Direction Object 32" this number is 32, and for "Advanced Direction Object 360" the number is 360.
    ...
    My example was meant for and works for a game with a 'top down' view, where everything is seen right from above. Character seen from such a view do not need more than 1 animation direction for each animation seequence, because rotating the 1 direction ( by changing the angle of the object ) will result in new animation directions ( 360 possible directions to be specific ). Because of this my example did not support 'Animation directions'.
    ...
    Your Bear/ Enemy is not seen from a top-down view, and so rotating it wont make much sense ( bear will eventually end up lying on his back, or stand upside down with his face in the dirt ).
    I understand you need to be using Animation directions, so i have modifyed my example to support Animation Directions.
    ...
    Specifically what is changed from the old example:

    - Gave Enemy a new Alterable Value named "DirectionAngle_", wich 'is' the Enemies forward direction ( based on the degree system ).
    Whenever you want to change the direction of Enemy, use DirectionAngle_ to do so ( not animation direction )
    - All referances to 'Angle' ( in the Event Editor ) are replaced with referances to Enemies 'DirectionAngle_' ( Conditions 3 and 5 )

    And thats about it, the example now supports any number of animation directions you wis to add
    Nice Bear by the way
    ...
    Let me know how this works out
    Attached files Attached files

  4. #34
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jan 2012
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    King your AI detection example is SO much better than shooting objects! Even though this isn't my question I really appreciate your thorough explaination! I need to copy and save that post... very valuable!

  5. #35
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2012
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha thanks I've hand drawn all of the sprites in charcoal to give it a weird aesthetic

    I've copied all the code and changed the players code to the same as the bears so that it moves properly. Issue I'm having now is that the bear floats around like the enemies you made. How can I change it so that the bear is just walking sort of back and forth waiting for the player? Also the enemy only seems to react when the player is walking right in the middle of the bear and he does not really seem to chase the player for very long.

    Thanks a lot for your help I've learned so much

  6. #36
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Lucien View Post
    Issue I'm having now is that the bear floats around like the enemies you made. How can I change it so that the bear is just walking sort of back and forth waiting for the player?
    When you say 'float around' do you refer to how the Enemies are 'rotating' towards their target?
    Would you rather have the Enemies turn instantaniously towards their target, as opposed to rotating toward the target?

    When you say 'walk back and forth' do you mean Left Right in a straight line, or just back and forth between two points?

    Quote Originally Posted by Lucien View Post
    Also the enemy only seems to react when the player is walking right in the middle of the bear and he does not really seem to chase the player for very long.
    'My' enemies Pizza Slice Line Of Sight ( in my examples ) are relatively small in size because my Enemies are small.
    Your Enemies ( Bear ) looks very big, so the same LOS parameters i use for my small Enemies wont be ideal for your big Enemies.
    I descibes how you can change the size of the 'Pizza Slice' LOS on page 3 of this thread.

  7. #37
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2012
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh ok that makes sense lol. Well I'm not sure if the rotating works with my sprite because it only has 3 different stopped positions, I could add a forth if you think that would work better?

    What I mean by float is that the enemy doesn't use the walk animation to get from one area to another instead he is in the stopped position and floats. Once he finds the player he goes to walk animation.

    When I mean back and forth I mean in sort of straight line so that he doesn't float away. So he will always be in that area and will only stray once he has spotted the player.

    Thanks a lot

  8. #38
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im thinking you would need 'at least' 4 directions for every animation, like this:

    You can add as many animation directions as you want to make it look smoother ( example, diagonal directions ).
    I might be missunderstanding how you imagine your game and animations.
    ...
    Correct animation handeling is however not incorporated intoo my example. When the enemies in my examples change animation seequence, its only to illustrate that the enemies are 'seeing' the Player.
    You might want to completly disregard this animation change and delete Conditions 13 and 14, i think this should fix your animation problem.
    Also make sure the checkbox named 'loop animation' ( in the animation editor ) is checked, you need to do this for all directionsin the Walking animation.

    Just a piece of information:
    In my examples the Enemy objects are using the built in Bouncing Ball movement.
    Since theyr using a built in movement Animations 'Stopped' and 'Walking' are automarically changed to ( when Enemy is moving or stopped ).
    ...
    I also want to correct myself.
    Quote Originally Posted by King_Cool View Post
    Whenever you want to change the direction of Enemy, use DirectionAngle_ to do so ( not animation direction )
    This is not correct, when you want to change animation directions in my examples do so by changing the built in 'Animation direction' and not the DirectionAngle_ value.
    ...
    Firstly, before handeling any other issues, try and see if this will solve your animation problem.

  9. #39
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2012
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've fixed the animation by deleting the conditions and it the animations work properly. However I'm having issues with the radius. I have changed the radius to enable the enemy to find me but it is still struggling and I can't tell if the enemy is chasing the player or just moving around.

  10. #40
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When the Enemies are chasing the Player, they are allways moving towards the Player.
    How is the enemy struggeling?

    Easy way to check if and when the Enemies are chasing, do the following code:
    ( Remember that Enemies Flag1 is only ON when the Player is within their sight/ Line Of Sight/ Pizza Slice, otherwise its OFF )
    if Enemy Flag1 = ON--> Enemy, change ink effect to 'inverted'
    if Enemy Flag1 = OFF --> Enemy, change ink effect to 'none'

    Now if you run the application the Bears should change to a blue-ish color when Player is within their Line Of Sight.
    If Player is not within their Line Of Sight, the Bears will retur to their regular colors.

    How is this working for you, does there still appear to be a problem?

Page 4 of 5 FirstFirst ... 2 3 4 5 LastLast

Similar Threads

  1. Strange thing: If Enemy Alterable Value A = Enemy Alterable Value B
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 26th March 2012, 05:29 PM
  2. Enemy
    By Taceo in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 26th July 2010, 09:47 AM
  3. Enemy Help Please!
    By Gate001 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 6th June 2010, 01:54 AM
  4. Enemy HP
    By FlinkGigitty in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 22nd January 2010, 08:09 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
  •