Author Topic: interactive fight as IJ FoA  (Read 188 times)

interactive fight as IJ FoA
« on: 11 Feb 2019, 09:43 »
I would like to do an interative fight similar as Indiana Jones and the Fate of Atlantis. I have the sprites, but I don't know how to do the fight. There are any module or plugin to do this?

Re: interactive fight as IJ FoA
« Reply #1 on: 15 Feb 2019, 15:44 »
There was this "Fight Game", which also was released with source code, but it's old and maybe script is not very up-to-date:
NOTE: download link is leading to the AGS Archives torrent.

Anyway, I don't have any script ready myself, but a while ago I wrote a post with recommendation on how to approach similar task. I will citate it here, in hope that it will be something to start with:

Coding is not only about knowing the programming language, but first of all about writing algorithms and structuring your program.
Complex algorithms are usually broken into smaller parts, to make it easier to understand and code.

My biggest advice to anyone who begins to learn programming and wants to make something complex, like fighting in this topic:
First, write down what you'd like to have "on paper". At this stage there's no need to go into much details, just rough outline. What objects would you like to have on screen, how these objects act, how player is supposed to act.
Second, try to break the whole scene down to smaller tasks, and learn to make these one by one, separately. After you did, you will be able to combine complex scene out of those pieces.

For example, you want to have QFG-like combat. This involves a picture of a player that swings sword (or does other stuff) by player's command and picture of enemy that does actions by AI command. Essentially this means that there is some visual character that receives commands from a source. Source can be either player or AI script.

Try following: make a simplier scene (perhaps in a test game), where you have a character on screen, that runs animations when player presses a button. Learn how to test when action ends, so that player could not run new actions before that.

Then make another scene where same character is controlled by a script. Learn how to make it launch same actions randomly, by a timer.
It may be important to learn how to "detach" animation script from AI script, to make them independent of each other. This way you will be able to connect same AI script to multiple characters.

Next step: teach AI to react on opponent's actions. You do not have to have actual opponent for that. Implement "imaginary" opponent. For example, remember what opponent is doing (defending, attacking, etc) in a variable, put a text on screen telling that to make it easier for you, and let player change that imaginary action by key press. Make AI react to this variable: when you set it to "attack" - AI should defend, and vice versa (or other variants).

Fourth scene could be where two characters stand face to face. They may be even both controlled by AI. Make them fight with each other using techniques you learnt in previous three scenes.

After you succeed in this, move on to combat rules and GUI part, with health, winning and loosing conditions, and so forth.
« Last Edit: 15 Feb 2019, 15:45 by Crimson Wizard »