Matpneumatos Wrote:I liked the concept of RCR even though i've never heard of it, which is weird, i thought i was an expert when it comes to NES games, turns out i'm not. Anyway, i like the idea of having a beat' em up that lets you go back to previous levels, i have implemented that before, i just haven't released anything like that yet, and it could be a great concept for a porn game, and i had some plans for a racing game, but it had no vehicles, it was similar to a 3D Sonic game but not as fast, so it had furry girls and some human girls racing on foot, girls like an anthro tigress or a mare, because i once saw an image of epona from Zelda ocarina of time and Link using a carrot as a dildo on her, and since carrots make her go faster i thought it was a good idea using some sort of dildo as a turbo or something like that, but it would still need some AI and Artificial intelligence is one of my weakest points at the moment, and i think it would be easier to make some AI for a Beat 'em up, since i have done it before.
Actually, I've made AI for many brawler games and I feel like my AI is very good, so if you feel AI is a weakness of yours, it would be better to use mine. The method is not really a trade secret or anything, though I'm always surprised at how bad other people's brawler AI can be, so I'll share it here for everyone.
The main movement engine is divided into 4 phases. Phase 1 is for when the fighter is the farthest distance away from its target. During phase 1, the fighter moves towards the exact x,y coordinate of the target. During phase 1, the current target constantly updates to the closest possible target if there are multiple opponents. Generally the AI starts in phase 1 and returns to phase 1 if the target becomes too distant.
Once the fighter gets closer to a target, it switches to phase 2. Phase 2 commits to moving towards a specific target. Phase 2 calculates a randomized offset point near the target for the fighter to move towards. The amount of randomization depends on the character, for example, a character with long range attacks should try to keep its y offset pretty close to the target's real y position, since it's likely to be able to hit the target before the target can hit it, but if the fighter has short range attacks, it should try to stay out of the target's lateral attack range until it gets close. Once the offset point has been calculated, the fighter switches to phase 3, which moves toward the offset point. In the original version, the offset is determined by the distance to the target. For example, if the fighter is already on the left side of the target, the offset point will be on the left side. If the target is very close to the fighter (which may happen when the AI goes to phase 2 after an attack) the offset can be either in front of or behind the target or "above" or "below" in the y axis. This makes the AI look like it's dodging attacks, or permits the AI to try and circle around to the rear of the player. Phase 2 lasts for only one moment, then switches to phase 3.
Phase 3 moves towards the offset point established by phase 2. They are separated so that the AI is not creating new offset points constantly. Phase 3 updates the offset point to account for movement of the target, so it will move to target.x+offset.x; target.y+offset.y and not to an absolute x,y coordinate. If the AI character has access to dash abilities, it will use them if appropriate. Typically, if the target+offset is more than a certain distance away and within a cone reachable by dashing, the AI will dash to reach it. Games with the "hopping" mechanic would also use hops to reach target+offset if appropriate. For games with jumping, there is a jump timer. While the character is on the ground, the jump timer counts down. If it's zero, the AI will jump in a direction that takes it closer to target+offset.
One the fighter reaches a certain distance away from target+offset (not target), it will switch to phase 4. Phase 4 will attempt to move toward a set offset point based on the fighter's available attacks. For example, a character with a short weapon like a knife would move very close to the target, while a character with a long weapon like a spear would try to keep some distance. However, the AI should not try to move exactly to target.x,target.y unless it has some kind of special contact-attack or an attack centered on itself, such as a spinning attack.
In general, the AI attacks opportunistically and will initiate an attack any time there is something in its range. There are certain situations where this is not desirable, such as if the AI should get to a special position to use a super move, but it's the best choice for most situations. Generally, you do not want to limit the AI to attacking during a specific phase, because it may get stuck in a particular phase and savvy players will exploit this behavior. Sometimes, it's more beneficial to keep pressing the attack from the current position, but sometimes it's better to reset the position and try again, but I've never felt like calculating exactly when or why for the AI, so after an attack completes, the fighter switches to phase 2 or phase 4 with a 50% chance of either.
In some of my games, there is a phase 5 where the AI runs away from the player.
For some characters, you need the AI to work differently, like the shooter robots from Super Defense Force and Space Amazon Brawler try to stay away from their targets. This is usually achievable by giving them very distance offset values during phase 2 and phase 4, but they need a little extra help when they get too close to the edge. In Rune Star, zombies and giant robots will be in phase 4 at all times, which gives them a little extra flavor and makes them a little easier to fight since they also have extra armor.
You may have noticed that the ASV Brawler AI cannot actually "see" you or what you are doing, so it has no capacity to intelligently dodge attacks. Nonetheless, it can be difficult to hit sometimes.
You can sample the most recent version of the ASV Brawler AI here:
http://www.newgrounds.com/dump/item/6b4 ... e844d4e6f9 "Duel: Perfect Rival" is the AI without any bonuses or penalties, exactly the same stats as the player but with the fake reaction time turned off. The duels before it have worse stats, the duels after it have super powers, like Psion always has maximum energy. The most recent complete game to use the ASV Brawler AI is FireArm:
http://www.newgrounds.com/portal/view/602455 The original game to use the ASV Brawler AI is Rune Star:
http://bluecloak.net/ace/RUNESTARDownload.html which is not a flash game, you have to download it to play. The Rune Star exe did not work on newer versions of windows for a long time, but, be still my heart, it totally works on Windows 10!