When you're playing a game, on BYOND, you often notice the standard monster behavior is something along the lines of "walk towards any clients within 6 tiles of me, and when I'm facing them while only a tile away, make their HP go down a little bit."
AI needs to progress in BYOND, it's not really that hard, either. What they can to do be more of a challenge is perhaps keep trying to move to the player's back or side, dodge projectiles, and keep their distance a little more when they're wounded enough. Please reply with more that you can do to improve the A.I. Please, I want to start a list.
ID:1118000
Jan 8 2013, 2:18 pm
|
|
Yeah, I've already kinda taken a step up by making monsters dodge projectiles, it also has to do a little bit with mapping, too.
|
Here's the best AI tutorial in the community: http://www.byond.com/developer/Forum_account/EnemyAI
|
An easy way to "fake" AI is to include randomness in their movement. Programming mobs to mostly attack players, but sometimes step in random directions, lets them dodge bullets and take cover by accident.
It's sort of cheating, and I imagine it works better with swarms of kinda-dumb enemies rather than a single opponent. At least, that seemed to be the case in Doom. The monsters in that game would predictably zig-zag toward you. But, there were so many of them and they had such a variety of attacks and abilities, that the action was always interesting (often brutal). The bosses, on the other hand, were a total disappointment. They had the same basic AI as everything else, and so they were not very challenging on their own. It was really the map that determined how hard they were, and the original levels didn't do a great job. So I guess my point is, sophisticated AI is generally better than basic pseudo-random AI, but it is especially important for enemies that are supposed to be able to face a player one-on-one (or more!) |
There isn't much to it.
AI can vary greatly depending on what weapons a player has available. As most weapons on byond games involve walking within one tiles distance and removing health, or firing a projectile, there isn't much you can do, other than program your AI to avoid projectiles, when it can. |
In response to Xerif
|
|
i didn't really take that in but i'm sure ur right
|
Avoiding projectiles could be kind of fun. Once the projectile enters the mob's field of vision, queue up a proc to move out of the way if the projectile is moving towards it. Of course you wouldn't want your enemies to be able to dodge every attack, so maybe include a reaction_time variable that causes the dodge to pause for a few ticks before moving.
|
In response to Albro1
|
|
Albro1 wrote:
Avoiding projectiles could be kind of fun. Once the projectile enters the mob's field of vision, queue up a proc to move out of the way if the projectile is moving towards it. Of course you wouldn't want your enemies to be able to dodge every attack, so maybe include a reaction_time variable that causes the dodge to pause for a few ticks before moving. I think its worth noting where that "queue up" actually happens... |
Where it happens depends on how you are handling your AI. It is commonly a loop, and as such a check should be made in that loop or in a proc called by that loop to queue it up.
|
I'm going to be the devil's advocate on this one. Does a more complicated AI really make it any more interesting? Of course it gives your game a little more depth when the enemies can "think," but what does it really promote mechanics-wise?
In some games, the standard "Walk until close enough and attack player" AI works perfectly fine. It's basically what your project requires, more or less. In a normal zombie survival game, that's pretty much the entire behavior for zombies: Get to you as fast as possible and beat you to death. Not really much room for variation in that one. There's a time and place for both advanced AIs (Tactical Shooters and RTS') and simple AIs, (Zombie games and RPGs) but unless an advanced AI really does anything special in your game other than being slightly less predictable, then it's pretty much a waste of time and resources, in my opinion. |
GamerMania wrote:
AI needs to progress in BYOND, I agree, it's a little challenging for a lot of people but it's really not impossible for most people to use better AI. A small game I made recently used 2 extra rules. Maybe I could write it into a demo for people. Super simple but they're far more intelligent through 2 small changes. Rules: Melee Types : Walk towards player to make contact as long as they're in the enemies bounds. Ranged Types : Walk towards the player if they're not in range. Walk away if the player is closer than the range. Now you have to chance ranged types as they shoot. |
In response to Solomn Architect
|
|
Solomn Architect wrote:
I'm going to be the devil's advocate on this one. Does a more complicated AI really make it any more interesting? Of course it gives your game a little more depth when the enemies can "think," but what does it really promote mechanics-wise? You don't see my main point, which is that the AI is too easy to beat because all they do is walk up to you, and take away damage. They sit there and let you attack them, as well. The only reason that an AI using this formula would succeed if they made the player locked in to position while being attacked while also doing a lot of damage. How about instead of seeing wolves literally biting my ass, they like to come to my back side and push me down, or just attack me from behind? Why does every enemy in the game use this tactic? It's strange to see a wolf run up to me and bite me over and over again, and then see a demon just do the same thing. Every enemy needs its own tactic to make the game more challenging. |
In response to Solomn Architect
|
|
Solomn Architect wrote:
Does a more complicated AI really make it any more interesting? I think it does when you have AI teammates in particular. I've played some FPS games where you can have computer controlled guys on your side and its awesome when they are a little "smarter" than basic shoot-enemies thinking. Also, one of the biggest sources of frustration for me in NEStalgia was that your companions were so F-ing dumb! To me that is a great example of AI failure - you are supposed to even be able to tell them what to do to some extent (attack, defend, balanced, or conserve) but they would act totally stupid in certain situations. Like, I set my healer to "conserve" and it casts its most expensive healing spell at the end of a battle where we are about to win and thus don't get the full healing effect. Christ! Either let me make their moves directly or don't program them to be morons! |
I had came up with a very advanced AI, in my examples I could usually just plug it in to my different games('Cos I program modularly, meaning I could drag and drop mostly anything between my games to save time.) They had a brain, event system, aggro meters etc. Let's make an example of a shooting game:
Alright so the players are in a building and there are 3 AI's have 1 set to the leader, when an AI is in a group only 1 should use the brain operation to reduce lag. He'd be a normal assault gunner, another a shotgun medic, the third a sniper. Now you add in sight(If any mob is in line of sight[Including scopes even infared/radar]). Sight can be lowered by standing around cover, high grass, trees, crouched or basicly invisible prone/hiding. Hearing can go to if the mob is on certain ground, grass is muffled, dirt harder, cement/broken glass etc loud. Also sprinting/firing a weapon is obviously loud(Though you can add tricks like Far Cry to throw rocks in other directions to move them away). Normal running is still pretty loud, then there is sneak walking while standing, crouch movement, crouch sneaking, prone, and prone sneaking(The most quiet and unseen movement). The mobs will detect these and think about what to do. The main gunner with the brains has preset plans like a football game. One known there are people inside he could order the sniper to prone outside with a visual on the target with the medic and gunner sneak around to the back. They'd then have a coordinated assault; but say if the sniper is seen and gunned down the plan changes. Now the brain has to make a new plan; retreat to an empty room to allow the medic to heal himself and the gunner. Then he can decide whether to go room to room with the medic to overpower or to split up. So they're Aggro meter comes into play. They've seen the enemy, and seen which are hurt and how many and what weapons. So he calculates which are the strongest, which are the weakest and where. So he goes now another way around while the bigger guards are on the left side they broke in waiting they come in the left to the weaker and shoot up all the weaker guys until the big ones come then calculate they have too low of odds to win so retreat but the leader is shot and killed. Now the medic has the brains. He has now picked up stuff from the dead and in the house. He could decide to go outside and snipe the bigger guys, but his calculated best move is to flash bang the area as they come running in to finish him off then a frag grenade to take out the big guys. But aggro is still too high so he flanks them and his shotgun kills the injured. If you are more intermediate-advanced you unterstand all that and would know how to program it. Basicly one big brain proc/datum, an aggro proc, a team proc, a memory proc(For fastest layouts and everything about the enemies), a formation list/proc(For comming up with formations like surrounding, flanking: <v>^ arrow formations, long range hold back short range up front. Aggro to either divide and conquer by picking off stragglers, or attacking the biggest baddy first so the rest are easy. Audio and Visual to scout out all the enemies. Movements to protect say flag holders by boxing him in, or guards to pace buildings and when attacking they come back to pace when done. Aggro meter+brain calculations to see if you losing the battle to retreat and heal. Friendly aggro to put importance on your own members, like medics are extremely useful, also the leader/flag holder as before. Say for a Naruto game which I once implemented the brain constantly calculated the aggro, distance, landscape(Water guys will either make water or get near it for better attacks), though if its weak just take it out or don't even bother. If the aggro is over 2x it's own it'll retreat and call for help. Using attacks at perfect times, even combos. Having memories to remember you and call for backup to attack first, or knowing your attacks and knowing how to dodge now. So they learn the more they fight.Even getting your attention for another one to sneak attack then gang bang you. This system took me weeks, but damn it was worth it, and you could set there difficulty between 1-10, set there attacks and a certain variables, like distance, time to use, if it can trap, how much dmg etc. And like I said earlier water guys if outmatched would run to the water there home turf so they are stronger 'cos they remember the landscape(In chunks) even get away from it from lightning users 'cos on water the lightning does more damage. Or fighting a fire guys the water guys would make water so they couldn't light things on fire anymore. So I hope this gives you an idea on how advanced an AI can be. 5 of my most skilled players including me tried facing one AI on level 10 that had every attack we did and we did 32 times before finally killing it, 'cos they heal themselves, but level 1 is about as strong as a person who just joined the game 5-10 minutes prior. So have fun with it, make it as realistic and as smart as you can to the purpose that your using it for. And most people aren't like me, but when I made my Advanced AI system I made it modular, because a system that advanced and that perfect in my eyes. For one I wouldn't wanna keep redoing and 2 I would wanna see it in all my games just with some tweaks.I really hope this helps! And sorry for such a long message, it is just a very in-depth topic and really worth reading. |
In response to GamerMania
|
|
I think you misunderstand my point of being a "devil's advocate." I see your point very clearly, I personally agree that a more advanced AI is more interesting, however, I was sparking conversation and thought by presenting the notion that a complex AI isn't always required, nor does it always bring something new to the table for the player.
Also, sometimes you have to think about the creatures attacking the player as creatures themselves and not AI's. What kind of intelligence does this creature have? If it's a relatively simple monster, then it will probably run away when it's health gets low. Zombies are effectively brainless, so it makes sense that they would just attack you until one of you are dead. However, when it comes to actual people or intelligent creatures, obviously a more advanced AI should be used to simulate their intelligence as accurately as possible. (Running, Dodging, Taking cover, parrying attacks, ect.) |
You can make simple AI still be very challenging and fun. Look at some of the first Zelda games. Enemies usually kept patterns, but each had different strengths and weaknesses and abilities. Some enemies could fly, some could jump really high, some had shields, some shot projectiles. In the original Zelda, enemies didn't react too drastically to the player. This was different in Link to the Past where enemies would aim and charge at you. Both provided different challenges, and both are easy to replicate.
The problem with BYOND games is there is no variety in enemies or AI patterns. Aside from all of this, as others have already stated, AI companions are a completely different ballgame. Preferably, you'd like them to be smart enough to fight on the player's level, or close to it. At the very least, they need to not be a hindrance. |
I'm definitely interested to see what all people have to say about this, but no matter what they say there is hope. Enemies in Feed are above average, and I am determined to make enemies in the games I make better and better over time.