A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: [SMALL TEST] Ai possible move directions.

  1. #1
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976

    [SMALL TEST] Ai possible move directions.

    Hey guys/gals,

    Just started working in flash again. And on a project i started so long ago which i am going to finish if it kills me. And you know how it is when you haven't worked on something for a while you tend to want to start again and redo all your code. So thats what i started to do this weekend But instead of coding back up to the stages i was up to and ending up with the same result i thought i might throw a couple of test's together and get them working and then piece it together when they are all working perfectly

    Well my first test is trying to get the character ai to detect the next possible moves properly and error free.

    So here is the first of many test's here.

    Test 1

    What happens is when you click one of the arrows the character should move in that direction 1 tile and then display the next possible moves. What i want you guys to do for me is test it a little and let me know if arrows appear where their not supposed to. And anything that doesn’t appear to work properly.

    That’s it for know i think.

    Thanks in Advance

  2. #2
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    moved his little purple arse around everywhere and found not problems.
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  3. #3
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Haha thanks blink.

  4. #4
    Senior Member TheLostGuru's Avatar
    Join Date
    Aug 2004
    Location
    I live on this webpage...
    Posts
    784
    worked nicely, looks promising!
    "If I have seen further it is by standing on the shoulders of giants." Isaac Newton
    ------------------------------------------------------------------------------

  5. #5
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Thanks TheLostGuru, the project is massive and have been working on the idea on and off for quite sometime now. Just figured i would re write what i have and post my progress to keep me motivated. And finish this game!

  6. #6
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,180
    Hey hooligan,
    It seems to be working fine Love the purple character Have you tried placing in higher tiles to see if the swapdepths are fully working? There seems to be something wrong with the leaf (is that how you spel it?) on his head when walking from right to left, but that's just minor detail
    And oh yeah, why are you using those arrows to move? It might get rather boring if the project will consist of a lot of moving around and stuff. Especialy since the walking animation is a bit long aswell.

    SaphuA

  7. #7
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Thanks for the advice Suphua,

    Yeah i actually have made a fully working iso engine with all the graphics done and the depth swapping. Its actually an old engine i used to use and just redone it. Looks similar to the flash mmorpg dofus not sure if you have seen it. The reason i am using arrows at the moment is just to illurstrate the ai detecting which ways are possible moves. In the next step i am going to remove them an let the ai make decisions on its own. Its was just put in place for me to see if the ai wouldnt do anything funny before i write the decision making script. Becase this will be a heavily ai based game i want to make sure its working perfecto.

    Thanks for the replies

  8. #8
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,180
    Aaahh
    Well, I don't know how compplicated your maps are going to be. But if you're planning to add AI into an ISO engine, wouldn't it be better to just a pathfinding system? It would do the whole wall-checking and movement stuff all at the same time. And even if your maps aren't that complicated you might still want to add an easy version of a pathfinding system, you could update it every tile. Or you could make the 'robot' patrol between certain points or anything.

    Just idea's
    ~sph

  9. #9
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    True i should and now i think about it i will thanks for the ideas Saphua ill post a path finding demo in the next couple of days for you guys to test

    Ow yeah and the maps arnt to complex so it should be pretty standard stuff. Now which cd did i put my old path finding stuff on...

  10. #10
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Ok guys another couple of quick test's for ya. Im pretty sure they work fine but just to be sure ill post them for some tests.

    The first test is pretty much the same thing as before accept the character cant walk in the opposite direction only if its the only possible direction.

    Test 1

    And the second one is the same thing accept the user doesnt click the arrows a new direction is randomly chosen at each new tile and work under the same rules of not beening able to go in the opposite direction accept if its the only option.

    Test 2

    Thanks in Advance

  11. #11
    Senior Member UnknownGuy's Avatar
    Join Date
    Jul 2003
    Location
    Canada
    Posts
    1,361
    They both work perfectly for me. Nice job.

  12. #12
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,180
    Yup the second test makes it a lot closer to looking like an actual CPU character

    A thing you could do to improve it, is to disallow him to make u-shaped movements (unless there's no other way offcourse). A sample of an u-shaped movement would be: up, right, down. This will make it look more realistic imho. So once he has moved up, and right, it should first check if he can walk up or right again before he check's if he can walk down, and all are not possible it'll move back left.
    Last edited by SaphuA; 08-17-2005 at 06:44 AM.

  13. #13
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    If you wish to make it move more realistic then I have used this system:
    *when you find new direction, also find random number of steps
    *char will continue on same direction until he hits the wall in that direction or number of steps runs out

    More steps you give, more char will move in straight lines. If you make steps=1 then you get same thing you have now.

  14. #14
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Tonypa: Thanks tony i think i will do it that way. Because its starting to make me dizzy watching this dude walk in cricles

    Suphua: Yeah it would proabably be best if i make it not do uturns. Im trying to make its movement as realistic as possible. I have also made a heap of other actions besides walking that the character will do that i am throwing together at the moment.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center