2D One on one combat - Streetfighter style

Started by
17 comments, last by Redline 21 years, 8 months ago
quote:Original post by mtaber
... if someone is jumping in the air at you, Ryu would execute a high kick, but Balrog would do an uppercut...

Ryu doing a high kick?... unless the player is jump-dropping about 45deg or less... I would rather go for light dragon punch. Balrog uppercut?? Do you play Street Fighter 2? Are you saying Sagat's Tiger Uppercut?
quote:... standard difficulty dictates that the computer must wait 1.00 seconds before reacting. Difficulty ranges from 0 to 100, with each point deducting 1/100th of a second from the reaction time. Anything above 90 or so should be essentially impossible because humans can only react so fast.

Good point. But I don't think 'standard' difficulty need to wait for a second? The player could give them nice combos.
quote: After that point, the computer reacts faster than you to the point that an instant after you try a move, the computer would execute the appropriate counter move, making the game impossible to win at those levels except through extreme luck.

It depends on the player skill. Since every move got its own delay, you could use that advantage to trick the computer.. even if the computer have zero delay on the AI.


[EDIT] Ooops... I guess you mean Balrog normal punch. But this is only effective when the player is high-up above.


[edited by - DerekSaw on July 31, 2002 10:06:42 PM]
"after many years of singularity, i'm still searching on the event horizon"
Advertisement
DerekSaw, what I meant was if someone jumped at you and was really close. When that happened and you executed a heavy kick with Ryu, he would kick almost straight up.

Redline, you can change the parameters of the game very easily and still use inheritance. When you call the constructor to Character, then call character.init(CHARACTER_TYPE_1). In the init function, you can read data from a configuration file, describing CHARACTER_TYPE_1. If you abstract the attributes enough, like for instance you said move velocity, then all of them will have that attribute. You just define them differently in the data file. I think you''re making it more complicated than you have to.

Looking for an honest video game publisher? Visit www.gamethoughts.com
Shameless plug: Game Thoughts
quote:Original post by mtaber
DerekSaw, what I meant was if someone jumped at you and was really close. When that happened and you executed a heavy kick with Ryu, he would kick almost straight up.

Redline, you can change the parameters of the game very easily and still use inheritance. When you call the constructor to Character, then call character.init(CHARACTER_TYPE_1). In the init function, you can read data from a configuration file, describing CHARACTER_TYPE_1. If you abstract the attributes enough, like for instance you said move velocity, then all of them will have that attribute. You just define them differently in the data file. I think you're making it more complicated than you have to.

Looking for an honest video game publisher? Visit www.gamethoughts.com


Indeed, that would work fairly well, and I have been considering this fact and what you have said and overall it would probably make it easier. In the end I suppose I was simply didn't like the idea of distributing and .exe to update the game.

[EDIT] That is, if I wanted to add characters to the game etc.



[edited by - Redline on August 3, 2002 10:53:00 AM]
about AI...
you shouldn't write a perfect set of AI responses.. first of all it's damn boring and it's hard to do as well (almost impossible?)
Currently I use a simple AI in my game that just performs a random move depending on it's actual status, distance from enemy and if enemy is turned with back to AI or if AI is turned back to enemy.
So I have got something like:
if distance<50
random=rand()%100;
if random<30 callkick
else if random<60 call punch
else call nothing

It works very well if you take into accout that it doesn't need all that much effort to create. Additionally by using lots of randoms AI behaviour isn't predictable and it's fun to see what it does.
This AI is for an easy level. For more advance AI I want to add:
-for medium level - checking what enemy does and takeing it into account while performing own actions
-for hard level - additionally measure exact distance between AI and enemy and perform attacks/moves that will work best from this distance, also takeing into account enemy move.

So while easy level enemy is dumb and can be beaten quite easily, while bringing a lot of fun into game(because it doesn't wait 1sec between moves like someone proposed), medium and hard levels of CPU AI should be much harder to beat, but still keep a lot of randomness.

To define moves I use a state-machine which works very fine. Althrought I hardcode everything so there's no possibility to create characters by someone from outside. I have got also a more complex collision/hit detection system, which not only tells me if there was a hit or not, but also checks how exact a hit was and use a different actions for it. (for example a poor hit, while takeing some hitpoitns from enemy and makeing him go back a lil might still come as a bad move, because enemy will have a chance to start his counterattack before we finish our attack and get a chance to do something. Of course it's not the case if you make a good hit, then you can try a combo, or your enemy falls down if hit was really good)

[edited by - MirekCz on August 3, 2002 11:10:48 AM]
With best regards, Mirek Czerwiñski
quote:Original post by MirekCz
about AI...
you shouldn''t write a perfect set of AI responses.. first of all it''s damn boring and it''s hard to do as well (almost impossible?)
Currently I use a simple AI in my game that just performs a random move depending on it''s actual status, distance from enemy and if enemy is turned with back to AI or if AI is turned back to enemy.
So I have got something like:
if distance<50
random=rand()%100;
if random<30 callkick
else if random<60 call punch
else call nothing

It works very well if you take into accout that it doesn''t need all that much effort to create. Additionally by using lots of randoms AI behaviour isn''t predictable and it''s fun to see what it does.
This AI is for an easy level. For more advance AI I want to add:
-for medium level - checking what enemy does and takeing it into account while performing own actions
-for hard level - additionally measure exact distance between AI and enemy and perform attacks/moves that will work best from this distance, also takeing into account enemy move.


I agree, I wouldn''t hardcode AI response at all...ever, it would simply make the characters uninteresting. The points you bring up are valid and the technique seems simple but effective.

quote:

So while easy level enemy is dumb and can be beaten quite easily, while bringing a lot of fun into game(because it doesn''t wait 1sec between moves like someone proposed), medium and hard levels of CPU AI should be much harder to beat, but still keep a lot of randomness.

To define moves I use a state-machine which works very fine. Althrought I hardcode everything so there''s no possibility to create characters by someone from outside. I have got also a more complex collision/hit detection system, which not only tells me if there was a hit or not, but also checks how exact a hit was and use a different actions for it. (for example a poor hit, while takeing some hitpoitns from enemy and makeing him go back a lil might still come as a bad move, because enemy will have a chance to start his counterattack before we finish our attack and get a chance to do something. Of course it''s not the case if you make a good hit, then you can try a combo, or your enemy falls down if hit was really good)

[edited by - MirekCz on August 3, 2002 11:10:48 AM]



At this point in time I was thinking of implementing a simple vector/array of rects that define the hit locations on the characters (on a per frame basis of course), that way I avoid CPU intensive per-pixel collision detection and I get pretty much all the flexibility I need, and can add something similar to yours such as hit location detection (which is really neccessary if I want to play different animations depending on where they are hit).

Can I ask what type of method you used to implement your base game logic? That is, how do you detect when states in characters are to change? As you may have read, I am thinking of using a trigger list atm, which is made up of function pointers.
Well I use a set of animations and depending on situation (standing, kneeing, flying) I allow only some specific animations to be started (upon key input).
I have got also a possibility to play more complex animations created from 2/3 smaller ones.
With best regards, Mirek Czerwiñski
It's possible to define a base player class and implement it almost completely in a data file. It would be much cleaner then what you propose, and still not have to distribute an exe. Might be worth noting that the exe is probably gonna be one of the smallest parts of your game, and in the real world, is almost always going to be redistributed along with any kind of patch.

Implementing a sort of scripting language as you propose would be very mod friendly (then again, so is what I suggest), and allow people to perhaps download custom fighting techniques and modify them to their liking.

Maybe you should consider having only one charachter to choose from, which is completely customizable, effectively leaving the AI to the people who play your game. Appealing to people who know a little more then average about martial arts and maybe AI might give your game its own little niche, it's going to need to be something special to get attention anyways.


[My site|SGI STL|Bjarne FAQ|C++ FAQ Lite|MSDN|Jargon]
Ripped off from various people

[edited by - wild_pointer on August 6, 2002 8:03:48 AM]
[size=2]
quote:Original post by wild_pointer
It''s possible to define a base player class and implement it almost completely in a data file. It would be much cleaner then what you propose, and still not have to distribute an exe. Might be worth noting that the exe is probably gonna be one of the smallest parts of your game, and in the real world, is almost always going to be redistributed along with any kind of patch.


Referring to the action functions? I could certainly use the states information data to create a generic movement function that uses the velocities to move the character around on the screen.

quote:
Implementing a sort of scripting language as you propose would be very mod friendly (then again, so is what I suggest), and allow people to perhaps download custom fighting techniques and modify them to their liking.


ATM I am thinking mainly of my sanity . To make it even easier I would probably have to create some sort of tool to help design the characters

quote:
Maybe you should consider having only one charachter to choose from, which is completely customizable, effectively leaving the AI to the people who play your game. Appealing to people who know a little more then average about martial arts and maybe AI might give your game its own little niche, it''s going to need to be something special to get attention anyways.


Hmm, and interesting idea. But then, people would still need to create the animations to go with those moves that they create.

quote:Original post by MirekCz
Well I use a set of animations and depending on situation (standing, kneeing, flying) I allow only some specific animations to be started (upon key input).
I have got also a possibility to play more complex animations created from 2/3 smaller ones.


Yeah, that sounds pretty good, but does it give you enough flexibility with your characters? I am thinking of being able to chain up states here (on a stack etc) so I could a group of actions played out.

This topic is closed to new replies.

Advertisement