I need help making a fighting game called "Trex"
And i need help with making the scipts for a cpu Fighter. It's a simple game just so that he reacts to movements of the player...
For example : If player moves towards the cpu, the cpu will then move toward the player and hit him. If player moves away from the cpu, the cpu will then chase the player.
Somthing like that :3
Offline
The difficulty of making your desired A.I ultimately depends on the complexity of the sensing. It seems like you always want the A.I to head towards the player. A very simple solution would be to have the A.I sprite always point towards the player and move a certain # of steps. The A.I could then punch the player if it is within a certain distance to the player. [if distance to sprite___< #, perform punch action, costume switch, etc.]. However, it is fairly likely that your fighting game will be platforming-based instead of an over-the-top view. You could have the A.I's x-position change be influenced by the player sprite's x-position, and have the A.I jump if the player's y-position is a certain amount greater than it.
Offline
AI is immensely difficult to program to a level where it could beat the player but it is possible. I personally find the best way is to programme ready-made "combo's" into it. Not only will it make the AI seem better, but also it means instead of reacting to the players movements it controls it's own every now and then which makes it seem more natural ( and less robot-like )
Offline
Prestige wrote:
AI is immensely difficult to program to a level where it could beat the player but it is possible. I personally find the best way is to programme ready-made "combo's" into it. Not only will it make the AI seem better, but also it means instead of reacting to the players movements it controls it's own every now and then which makes it seem more natural ( and less robot-like )
It's not hard to have it beat the player, it's harder to make them between unbeatable and doing nothing.
Basically, you need it to carry out certain actions based on attributes, like distance to player, players velocity(or direction), health etc. The hard thing is making sure all posibilities result in a move, otherwise it just stands there until a criteria is met. The one you asked for would be simple, as it'd point towards and move towards the player whenever a movement key is pressed(or always)
Offline