Ahmet's AGS Fight Game 2009

Started by Gord10, Wed 13/04/2005 20:36:02

Previous topic - Next topic

Gord10

2005 version is obsolete and unavailable.
Please see my recent post for the 2009 version.

---

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.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:
Code: ags

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.
Code: ags

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.
Games are art!
My horror game, Self

Ubel

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.

Gord10

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.
Games are art!
My horror game, Self

Ponch

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

Gord10

Thanks :)
Anyone could run the game? Otherwise I will release another version made with 2.7.
Games are art!
My horror game, Self

TerranRich

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!
Status: Trying to come up with some ideas...

Gord10

#6
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.
Games are art!
My horror game, Self

Nine Toes

Hmm... interesting.

I could make use of this in my game.  Thanks for the inspiration, Blue. :)
Watch, I just killed this topic...

Fribbi AGDI joker

What keybuttons am I suppose to use with this game?  ???

Gord10

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.
Games are art!
My horror game, Self

Gord10

Games are art!
My horror game, Self

proximity

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 
Proximity Entertainment

Gord10

Games are art!
My horror game, Self

neelhound

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.

Gord10

@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. 
Games are art!
My horror game, Self

Theme

ags should have collision boxes editing and functions for sprites!
o/

Rui 'Trovatore' Pires

Suggest it in the techie forum, why don't you.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

seraphimdreamer777

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
Victory is my destiny

Gord10

Sure, feel free to use it :)
I think the date should be 7 April 2005; when "The Great Stroke-Off!" was released.
Games are art!
My horror game, Self

seraphimdreamer777

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
Victory is my destiny

Radiant

Er, "seal of quality"? :)

Also, "your studio (c) 200x yourself" doesn't really make sense. You're overdoing it.

Gord10

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).
Games are art!
My horror game, Self

seraphimdreamer777

O.K. I'll do that instead but is it O.K. to keep my seal it's up to you
Victory is my destiny

Gord10

I failed to understand the concept of this 'seal of quality' completely, but I think it is OK.
Games are art!
My horror game, Self

Dualnames

I've never seen this before. Anyway, i gave it a look and sures pays off. good job.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Radiant

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.

seraphimdreamer777

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
Victory is my destiny

Radiant


seraphimdreamer777

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.
Victory is my destiny

seraphimdreamer777

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.
Victory is my destiny

Gord10

#30
I have observed a high demand for a recent version of my AGS Fight Game.  Here it comes,




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
Games are art!
My horror game, Self

Crimson Wizard

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?

Gord10

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).
Games are art!
My horror game, Self

Crimson Wizard

Hmm... that explains, thank you.

SMF spam blocked by CleanTalk