|
Post by NASH7777 on Dec 20, 2004 16:08:22 GMT -5
Okay I'm always looking for ways to improve the enemies AI, And I think I've hit the jackpot as to the stage where I'm at now. You could customize the enemy as to move towards the party by checking the xy etc...but that's a pain and it also has the problem of enemies will run into walls and get "stuck" there. So it's best to have the premade script for it. But then there comes the problem of when you have that... all scripts after it stop here's how we work around it.
Apply together Call Script [enemy action01] Event Actions-To Party 30F (frames can be whatever you want) Apply in order
With this you can have the enemy attacking or changing color or whatever, as they chase the party.
Now here comes my newest outbreak in the AI. Let's say I want the enemy to chase the party for a while then run away for a while...or move randomly for a while etc... well you can't do it because once you have the "to party" script it will not accept any more commands. But here's how...
You need an extra variable for the event. I'll call it "act" for now. This will start at zero for their default actions. So in the script have the apply together with Call Script [enemy actions01] and a script [enemy movement01] apply in order. Now in the Enemy movement script it will check what "act" is and if it is blah have move to party 30f, if blahblah away from party 10f etc... Now this doesn't fix are problem yet as once they get in this act they still can't get out of it. So we need to add to the enemy action script loop. At the end, after it's done it's attacking or whatever, have it check the conditions you want for the new action. Ex: If e1hp<3 then act=2. Then if the act is different then the current action have it Duplicate the event at the exact same spot. Then erase the current event. This will Cause it to re-go through the actions (on a different event really now) and have a new motion.
This will be extremely helpful in my stealth game as the Enemies can just wonder, then if you trigger any loud noises it will alert them and they may wonder faster or even come to the party at a certain speed. Or if they get scared or something they could run, etc...
Improving your enemies to make a challenge, Brock Nash ;D
|
|
|
Post by Dungeon Warden on Dec 20, 2004 18:02:11 GMT -5
Wow, Nash. That's a great idea. Since I'm not making a Action RPG, the info isn't helpful for me, but it should help all those people that are. I am seriously thinking of making an Action RPG sometime. You have inspired me Nash.
|
|
|
Post by Jugem on Dec 20, 2004 18:31:20 GMT -5
Now here comes my newest outbreak in the AI. Let's say I want the enemy to chase the party for a while then run away for a while...or move randomly for a while etc... well you can't do it because once you have the "to party" script it will not accept any more commands. But here's how... Not really an outbreak, since I've already accomplished this. But it's an alternate method that is probably simpler than how I did it. So nice work in figuring it out.
|
|
|
Post by NASH7777 on Dec 20, 2004 18:53:33 GMT -5
Jugem- Well you couldn't have accomplished it withought having the enemies get "stuck", otherwise it would have been the same way.
|
|
|
Post by Jugem on Dec 20, 2004 18:56:28 GMT -5
Jugem- Well you couldn't have accomplished it withought having the enemies get "stuck", otherwise it would have been the same way. Actually, I did accomplish this without having the enemies get stuck. And it was a different way. I just did it in a way that would allow me to change the AI however I want with little extra work. But it comes at the cost of a lot more scripting.
|
|
|
Post by vespuleth on Dec 20, 2004 21:22:25 GMT -5
to keep an event from sticking, all you have to do is write in a check that takes place every step interval (each step takes a certain amount of time, set the check to cycle every 'that amount of time') that says if the event hasnt moved, to change directions.
|
|
|
Post by NASH7777 on Dec 20, 2004 21:40:53 GMT -5
No this doesn't work because as soon as you tell it to move the event a spot it won't except any other scripts until it has finished moving.
|
|
|
Post by vespuleth on Dec 21, 2004 13:55:54 GMT -5
apply together.
|
|
|
Post by The zoradude on Dec 21, 2004 14:52:10 GMT -5
Hmmm, thank you Nash this info is very VERY helpful for something.....
|
|
|
Post by NASH7777 on Dec 21, 2004 16:38:14 GMT -5
Planning something are you....
Oh btw when you have a script running liek "to Party 30f" in the other script make sure you don't have the party doing anything with moving them. This will screw everything up.
|
|
|
Post by The zoradude on Dec 22, 2004 12:12:47 GMT -5
Yeah since I'm on Christmas brak I've had time to work and I have alrady completly set up a BS for my Action RPG, The Dragon War. I finished it this morning, now all I have to do is make the game! Which I alrady have laid out the story for it and every thing, It is going to have a shocker near the end,(well I plan it that way any way).... Too bad I have no way of getting it so other people can play it....
|
|
|
Post by NASH7777 on Dec 22, 2004 12:29:59 GMT -5
Could just mail it to Doan, and he could put it up zoradude.
Okay here are some I deas for what you may want to script for their AI.
Scared- will run from party fast Normal- will wonder aimlessly Wait- will hold ground Confused- move aimlessly fast Attack- move to party fast and attack
Then for each of these you could set a condition to trigger these. They may get scared after their hp is so low. Or may confused after a loud crash or something. Really anything you want. This will be like for my Stealth game. If you step on a cracked floor. All enemies within a certain range may be startled and leave their posting spots to start searching. Or they may fall asleep after being undisturbed for so long.
|
|
|
Post by The zoradude on Dec 22, 2004 12:47:00 GMT -5
Yeah, I can't wait to get it done! I mainly went for story over gameplay on it though, oh well. But really I hope people don't think I'm Speciesist because of this game because in it your supposed to kill the human race because, The dragons think they have destroyed the world with their pointless wars over land enough so the dragons want to put an end to it, but......
Well you'd have to play the game to find out any more for your self.... Trust me it gets werid.
|
|
|
Post by Doan the Nado on Dec 26, 2004 1:29:07 GMT -5
Sounds like a good custom AI system, Nash. Congrats on your Helpful Post of the Week.
To zoradude: your game idea sounds intriguing, but I encourage you to begin a thread in the "Our Created Games" forum to discuss it. This thread really isn't the place for that.
|
|
|
Post by NASH7777 on Dec 26, 2004 9:27:11 GMT -5
Thanks Doa, yeah I'm always looking to improve the enemy AI as I'm more of an active battle system person. Heck I may never create a game with the actual battle system...maybe an edited one. Yaaaay Post of the week! I'm so happy... *tear trickles down
|
|
|
Post by The zoradude on Dec 27, 2004 11:43:24 GMT -5
To Doan: Oh sorry dude, That is all I really want to say about it anyway...
To Nash: Okay I can't get the Move to party AI to work here is my script
Script branch Repeat Apply together Event-Move to party 25F wait 45F event-effects-spear Apply in order Script Branch end
All that is happening is the event is getting moved to the party. What is wrong?
|
|
|
Post by NASH7777 on Dec 27, 2004 11:48:06 GMT -5
Lol, follow the example I gave... You can't have the "to party" script before it's other actions. And you need to have the enemies actions called from a seperate script.
Apply together call enemy actions To Party 30 F Apply in order
|
|
|
Post by The zoradude on Dec 27, 2004 12:10:47 GMT -5
Oh See I tried calling it but I didn't put it first and it is kind of hard just to think of it out of nowhere at home....
|
|
|
Post by NASH7777 on Mar 24, 2005 22:30:56 GMT -5
Ok Jay asked me if this was possible and I thought up how to do it. It's not exactly enemy AI but a Party Assistant!!!!!
Imagine this, as your running around a map (ACBS game of course), there is you other member running around with you attacking enemies or doing it's own thing! You could make it either so you could give it commands or give it it's own AI. I'll show the AI way.
Pretty much your "friend" will need what I'm gunna call a "Mood" variable or basically an action. Make an event that has a page for every mood. Basically the moods will be like, Normal, slow, attack, etc...
In the events first page, it's defualt mood of 0. Have its action script like this: @@@ Action Script for Mood 1
Apply together call [mood check1] Enemy:Movement: To Party #frames apply in order @@@
Then for the [mood check1] script have it like this: @@@ ood Check SB Repeat if Flag0 = off ~Load event info ~Make x1=eventx ~Make y1=eventy ~Make z1=eventz
~control event: enemy1 ~Load event info ~Make x2=eventx ~Make y2=eventy ~Make z2=eventz
~call [distance check] (will compare xyz1 to xyz of 2 for distance) ~SB distancexy < Whatever range number you want here> ~~make mood = 2(attack mood) ~~control event: current ~~duplicate even ~~remove current event ~~force script end ~SB end
~control event: enemy2.... (repeat for all the enemy’s you have) @@@ Then in your second page for mood two which we'll say is attak have the event no longer follow party but run whatever attack script ya want and a new mood check!
|
|
|
Post by NASH7777 on Mar 30, 2005 12:19:32 GMT -5
Did nobody find that last post interesting?! I mean come on that would be sweet to have a partner running around you attacking and stuff. Anyways If anybody wants me to come up with some sort of AI script or something I can. :-)
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Mar 30, 2005 12:24:51 GMT -5
It seems cool, but I have no use for it. I'm sure someone will. The same's happening to me with my tutorial on how to modify the DBS to have all your own formulas.
|
|