Adventure Game Studio

AGS Support => Modules, Plugins & Tools => Topic started by: Gord10 on Wed 13/04/2005 20:36:02

Title: Ahmet's AGS Fight Game 2009
Post by: Gord10 on Wed 13/04/2005 20:36:02
2005 version is obsolete and unavailable.
Please see my recent post for the 2009 version. (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=20327.msg515108#msg515108)

---

Hello,
I'm sorry if I'm posting this to the wrong place :(
Have you played The Great Stroke Off and seen the mini fight game, Drunken Violent Bums, in the arcade saloon?
I've released the source code of that fighting game. Because many people asked me how I could script it with AGS. I think this source code will help people for adding AI and key pressing commands.

(http://www.2dadventure.com/ags/fightgame.PNG)

http://www.adventuregamestudio.co.uk/games.php?action=detail&id=544

Special thanks to Barbarian for helping with some debugging. I know this game isn't perfect (especially the graphics :P), I hope someone develops the scripts more. You can ask me everything you want. ahmetkeles_16@hotmail.com or akk13us@yahoo.com

The moving scripts for the enemy AI character:

if ((character[EGO].x < character[ENE].x) && (IsTimerExpired(1)==1)){
 int ran=Random(3);
 if (ran==0) {
 MoveCharacterStraight(ENE,character[ENE].x-30,character[ENE].y);
 SetTimer(1,10);
 }
 if (ran==1) {
 MoveCharacterStraight(ENE,character[ENE].x-10,character[ENE].y);
 SetTimer(1,10);
 }
 if (ran==2) {
 MoveCharacterStraight(ENE,character[ENE].x+30,character[ENE].y);
 SetTimer(1,10);
 }
 if (ran==3) {
 MoveCharacterStraight(ENE,character[ENE].x-10,character[ENE].y);
 SetTimer(1,10);
 }
}
 
if (character[ENE].x>270) {
 MoveCharacterStraight(ENE,character[ENE].x-20,character[ENE].y);
   }
if (character[EGO].x>290) {
 MoveCharacterStraight(EGO,character[EGO].x-20,character[ENE].y);
   }

if (character[EGO].x<30) {
 MoveCharacterStraight(EGO,character[EGO].x+20,character[ENE].y);
   }



They are the hitting and insulting of the enemy AI.

if (GetGlobalInt(204)==0) {
int ran=Random(18);
//if (IsTimerExpired(2)==0) {
if ((character[EGO].x+40 >=character[ENE].x) && (character[EGO].x<character[ENE].y)) {

 if (ran==0) {
 SetGlobalInt(200,GetGlobalInt(200)-1);
 MoveCharacterStraight(EGO,character[EGO].x-8,character[EGO].y);
 AnimateCharacter(ENE,8,10,0);
 Wait(10);
AnimateCharacter(ENE,0,10,0);
if(character[EGO].x>270) MoveCharacter(EGO,character[EGO].x-30,character[EGO].y);
 SetTimer(2,30);
 }
 if (ran==1) {
 SetGlobalInt(200,GetGlobalInt(200)-1);
 MoveCharacterStraight(EGO,character[EGO].x-8,character[EGO].y);
 AnimateCharacter(ENE,9,10,0);
   Wait(10);
AnimateCharacter(ENE,0,10,0);
   if(character[EGO].x>270) MoveCharacter(EGO,character[EGO].x-30,character[EGO].y);
 SetTimer(2,30);
}
 if (ran==2) {
 SetGlobalInt(200,GetGlobalInt(200)-1);
 MoveCharacterStraight(EGO,character[EGO].x-8,character[EGO].y);
 AnimateCharacter(ENE,8,10,0);
   Wait(10);
AnimateCharacter(ENE,0,10,0);
if(character[EGO].x>270) MoveCharacter(EGO,character[EGO].x-30,character[EGO].y);
 SetTimer(2,30);
 }
 if (ran==3) {
 AnimateCharacter(ENE,8,10,0);
   Wait(10);
AnimateCharacter(ENE,0,10,0);
if(character[EGO].x>270) MoveCharacter(EGO,character[EGO].x-30,character[EGO].y);
 SetTimer(2,30);
}
if (ran==4) {
 AnimateCharacter(ENE,9,10,0);
   Wait(10);
AnimateCharacter(ENE,0,10,0);
if(character[EGO].x>270) MoveCharacter(EGO,character[EGO].x-30,character[EGO].y);
 SetTimer(2,30);
}
if (ran==5) {
 AnimateCharacter(ENE,8,10,0);
   Wait(10);
AnimateCharacter(ENE,0,10,0);
if(character[EGO].x>270) MoveCharacter(EGO,character[EGO].x-30,character[EGO].y);
 SetTimer(2,30);
}
if (ran==6) {
 MoveCharacterStraight(ENE,character[ENE].x+40,character[ENE].y);
 SetTimer(2,30);
}
if (ran==7) {
 MoveCharacterStraight(ENE,character[ENE].x+40,character[ENE].y);
 SetTimer(2,30);
}
if (ran==8) {
 MoveCharacterStraight(ENE,character[ENE].x+40,character[ENE].y);
 SetTimer(2,30);
}
if (ran==9) {
 DisplaySpeechBackground(ENE,"Stupid!");
 MoveCharacterStraight(ENE,character[ENE].x+10,character[ENE].y);
 SetTimer(2,30);
}
if (ran==10) {
 MoveCharacterStraight(ENE,character[ENE].x+40,character[ENE].y);
 DisplaySpeechBackground(ENE,"You will die!");
 SetTimer(2,30);
}
if (ran==12) {
   AnimateCharacter(ENE,8,10,0);
   Wait(10);
AnimateCharacter(ENE,0,10,0);
if(character[EGO].x>270) MoveCharacter(EGO,character[EGO].x-30,character[EGO].y);
   }
//}
}

if((character[EGO].x>200) && (character[ENE].x>200)) {
 MoveCharacter(EGO,character[ENE].x-40,character[EGO].y);
 }

}


You can see more in the source code.
Title: Re: Ahmet's AGS Fight Game-Source Code
Post by: Ubel on Wed 13/04/2005 21:07:02
Hmm... Couldn't get it work with version 2.62. Did you make this with 2.7?

Also I think it would be good idea to move this to Technical Archive. ;DÃ,  Cause I'm sure there are lots of people who would find this very interesting.
Title: Re: Ahmet's AGS Fight Game-Source Code
Post by: Gord10 on Wed 13/04/2005 21:21:41
Quote from: Pablo on Wed 13/04/2005 21:07:02
Hmm... Couldn't get it work with version 2.62. Did you make this with 2.7?
No, made with 2.62.509, November 2004. I'll check why it didn't work.

Quote
Also I think it would be good idea to move this to Technical Archive. ;D  Cause I'm sure there are lots of people who would find this very interesting.
Yeah, guess you are right.
Title: Re: Ahmet's AGS Fight Game-Source Code
Post by: Ponch on Wed 13/04/2005 22:28:24
Cool! Thanks for this. I just downloaded it and will take a look at the code over the weekend. Thanks for letting everyone in on this!

- Ponch
Title: Re: Ahmet's AGS Fight Game-Source Code
Post by: Gord10 on Fri 15/04/2005 19:37:44
Thanks :)
Anyone could run the game? Otherwise I will release another version made with 2.7.
Title: Re: Ahmet's AGS Fight Game-Source Code
Post by: TerranRich on Fri 15/04/2005 20:01:18
Please release a 2.7 version if you could, as many people will be upgraded to it once it's finally released. I know I will. If I use this in my upcoming game, I will definitely credit you. :) This is awesome!
Title: Re: Ahmet's AGS Fight Game-Source Code
Post by: Gord10 on Fri 15/04/2005 21:59:30
OK, I will release the new version made with v2.7 as soon as possible.

Edit: Try this: http://www.2dadventure.com/ags/ahmetfightsc27.zip
I hope it works now.
Title: Re: Ahmet's AGS Fight Game-Source Code
Post by: Nine Toes on Sat 16/04/2005 08:53:39
Hmm... interesting.

I could make use of this in my game.  Thanks for the inspiration, Blue. :)
Title: Re: Ahmet's AGS Fight Game-Source Code
Post by: on Mon 18/04/2005 19:16:55
What keybuttons am I suppose to use with this game?  ???
Title: Re: Ahmet's AGS Fight Game-Source Code
Post by: Gord10 on Mon 18/04/2005 20:02:02
Arrow keys: Move
Z: Kick
X: Punch
C: Enable defence mode
V: Disable defence mode

P.S: I'm going to release a template version.
Title: Re: Ahmet's AGS Fight Game-Source Code
Post by: Gord10 on Wed 20/04/2005 15:27:30
The template version released:
http://www.geocities.com/akk13us/fight.zip
Title: Re: Ahmet's AGS Fight Game-Source Code
Post by: proximity on Thu 09/06/2005 08:03:38
i noticed why script didn't work.
in second script,  line 3:
//if (IsTimerExpired(2)==0) {  ----> // is deactivating this line and also in line 82:

//}  ------->  // is deactivating bracket

if you fix these lines the script will work 
Title: Re: Ahmet's AGS Fight Game-Source Code
Post by: Gord10 on Thu 09/06/2005 14:37:04
Thanks :)
Title: Re: Ahmet's AGS Fight Game
Post by: neelhound on Sat 28/10/2006 10:07:16
thanks, but if i was going to make the game, and use different character views to yours, would the scripting change?

And is it possible for spells or something?

This sis awesome.
Title: Re: Ahmet's AGS Fight Game
Post by: Gord10 on Sun 12/11/2006 17:24:15
@Neelhound:
Yes, it is possible to use your own character views, sprites etc. You just need to replace your own scripts codes inside the default Fight Game codes. For example, if View 8 is executed in the default game when the player punches, you just need to replace AnimateCharacter(ENE,8,10,0); with AnimateCharacter(ENE,yourownnumbers,yourownnumbers,0);

But I must say these codes are for experienced AGS users; you can feel hardness if you are still beginner for AGS Script.

I Hope I could be helpful. 
Title: Re: Ahmet's AGS Fight Game
Post by: Theme on Mon 13/11/2006 20:01:25
ags should have collision boxes editing and functions for sprites!
o/
Title: Re: Ahmet's AGS Fight Game
Post by: Rui 'Trovatore' Pires on Tue 14/11/2006 09:22:06
Suggest it in the techie forum, why don't you.
Title: Re: Ahmet's AGS Fight Game
Post by: seraphimdreamer777 on Wed 14/11/2007 14:22:26
Hi I made an advanced version of the fight game with better graphics and music using the template to help me get a bit more familiar with AGS and was wondering if I could have permission to put it on this web site as my first completed project to show what I can do with AGS so far of course if I can. I'll add to the title the original copyright when the original version was released and the copyright for my version to make sure the original creator gets his credit so if its O.K. let me know and I'll put it on the web site if not then it's O.K. I'll just make someting from scratch later.Oh yea I almost forgot if I can I'll need to know the date the original fight game was made so I can put it on the title screen
Title: Re: Ahmet's AGS Fight Game
Post by: Gord10 on Wed 14/11/2007 19:34:08
Sure, feel free to use it :)
I think the date should be 7 April 2005; when "The Great Stroke-Off!" was released.
Title: Re: Ahmet's AGS Fight Game
Post by: seraphimdreamer777 on Thu 15/11/2007 00:27:01
I put this as copyright on the game in the title screen and the Seraphim Games seal of quality screen

Based on the fight game from The Great Stroke-Off (c) 2005 Barbarian
Cool Blue's Fight Game (c) 2005 CoolBlue-Gord10
Remix Version (c) 2007 Seraphim Games

Seraphim Games (c) 2007 Joseph Ray Williams Jr.

The last one appears on the seal of quality screen only

So is all the copyright text correct if so I'll add the game a few minutes after your reply
Title: Re: Ahmet's AGS Fight Game
Post by: Radiant on Thu 15/11/2007 00:51:58
Er, "seal of quality"? :)

Also, "your studio (c) 200x yourself" doesn't really make sense. You're overdoing it.
Title: Re: Ahmet's AGS Fight Game
Post by: Gord10 on Thu 15/11/2007 01:15:39
Also, as those are not commercial games, I don't think it would be too important to put a real copyright note.

It would be enough to write "Based on Gord10's "Ahmet's AGS Fight Game" from The Great Stroke-Off 2005 by Barbarian" on the credits (yes, I know this came up as a complex credits sentence).
Title: Re: Ahmet's AGS Fight Game
Post by: seraphimdreamer777 on Thu 15/11/2007 01:26:39
O.K. I'll do that instead but is it O.K. to keep my seal it's up to you
Title: Re: Ahmet's AGS Fight Game
Post by: Gord10 on Thu 15/11/2007 05:47:16
I failed to understand the concept of this 'seal of quality' completely, but I think it is OK.
Title: Re: Ahmet's AGS Fight Game
Post by: Dualnames on Thu 15/11/2007 07:44:09
I've never seen this before. Anyway, i gave it a look and sures pays off. good job.
Title: Re: Ahmet's AGS Fight Game
Post by: Radiant on Thu 15/11/2007 12:37:41
Quote from: seraphimdreamer777 on Thu 15/11/2007 01:26:39
O.K. I'll do that instead but is it O.K. to keep my seal it's up to you

Well, certainly you can keep the seal, but it does make you look rather silly. Generally, such seals are given by a respected authority in order to actually mean anything. You are just saying "hey, I'm me and I endorse my own message".

The above message officially approved by Radiant, from the Board of Radiant Message Board Message Quality.
Title: Re: Ahmet's AGS Fight Game
Post by: seraphimdreamer777 on Thu 15/11/2007 18:56:25
Sorry to bother you again but I'm done with the game but I don't have a Download URL
of which my friend told me was a website to host my game do you know what I should do from here
Title: Re: Ahmet's AGS Fight Game
Post by: Radiant on Thu 15/11/2007 19:25:25
This may help (http://en.wikipedia.org/wiki/Free_web_host).
Title: Re: Ahmet's AGS Fight Game
Post by: seraphimdreamer777 on Sat 17/11/2007 09:55:39
Well Gord10 Radiant its on the AGS page now and ready to download be sure to post here and tell me how you like it. It is listed as Ahmet's AGS Fight Game Remix thats the best name I could think of and I gave both of you credit you Gord10 for the Scripting Sound and Original graphics and you Radiant for Technical help and as far as I go Sound Music and Graphics.  thanx again! for giving me this opportunity Hope y'all like it.
Title: Re: Ahmet's AGS Fight Game
Post by: seraphimdreamer777 on Fri 25/04/2008 14:49:19
Hey I just upgraded to AGS 3.0.1 and was going through old templates and noticed I couldn't get the fight template to work so I was wondering if I maybe did something wrong or if it's just too old to work cause I already deleted my old AGS and was hoping to make another fight game this time with more characters and moves if it's possible with this template. So if it is too old then could you make one that works with the new AGS and if not do you know if there might be another fighting template I could use by someone else thanks in advance for any help.
Title: Re: Ahmet's AGS Fight Game 2009
Post by: Gord10 on Tue 20/10/2009 18:48:45
I have observed a high demand for a recent version of my AGS Fight Game.  Here it comes,



(http://coolbluefiles.net/ags_fight_game2.jpg)

This is the 2009 version of Ahmet's AGS Fight Game, which was originally coded for The Great Stroke-Off! in 2005. Instead of an update on the old scripts, I have decided to re-make everything.


Usage notes:
  *You need some basic AGS and coding knowledge in order to implement this source game into your own AGS game.    Variable and structure names are intelligible English words or physics terms.
  *Scripts are based on AGS room objects, instead of AGS characters.
  *Appoint your fighting character views into 'int player_view' and 'enemy_view' variables



The main difference between the 2005 and 2009 versions:
  2005 version was scripted by a highschool student,
  2009 version is made by a 3rd grade computer sciences student ^^

Other important differences:
  *Compatibility with the latest AGS
  *Basic Newton physics in order to maintain a more fluent gameplay
   (like acceleration and surface friction)
  *Stamina system: The player won't be able to keep attack buttons pressed
   and gain an unproportionate advantage
  *Comprehensible variables: Easier to understand the codes
  *Health and stamina bars
 
TO-DO's:
I believe this version is sufficient for a good fight scene in your adventure game, because of its simplicity, but I guess there will be developers who would need more advanced features like those;

 *Jumping enemy
 *Direction changes. Defaultly, player is on leftside and enemy is on rightside.
  It isn't possible yet player jumping over the enemy and the opponents changing sides.
 *Combo system
 *Crouchings
 

Terms of Use:
You may use this source game in your own (both freeware and commercial) projects, just don't forget to mention my name in credits.

Download source game (http://www.adventuregamestudio.co.uk/games.php?action=download&game=544)
Title: Re: Ahmet's AGS Fight Game 2009
Post by: Crimson Wizard on Tue 20/10/2009 21:40:38
Some time ago I started my own fighting project, being inspired by Quest Fighter games (well, rather by idea, not actual implementation :P) but it did not go futher initial scheming  ;) (mainly because I was going to participate in MAGS).

So, I have interest, why did you use Objects instead of Characters? What are advantages of doing so?
Title: Re: Ahmet's AGS Fight Game 2009
Post by: Gord10 on Tue 20/10/2009 22:04:00
It is true that the same game could be done character functions and properties, instead of room objects (as I understand, AGS character class is an inheritance of game object class). But the character class's own functions and properties are the ones that wouldn't be any use inside such a fight game.

Move and WalkSpeedX? I would be limited with integers, but I am storing the velocity as float, which gives me a more fluent fighter move. I would discard the moving functions of Characters and apply my own formulas for displacement. I feel like working with room objects gives me a wider coding perpective. The question would be "Why using Characters?", because I failed to see any advantage of using Characters (maybe we would want our fighters to have the same properties with the game characters, but it isn't such a hard thing to export them into the room objects).
Title: Re: Ahmet's AGS Fight Game 2009
Post by: Crimson Wizard on Tue 20/10/2009 22:10:42
Hmm... that explains, thank you.