Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

[MMF] Making RPG Enemies.


Airaxen

Recommended Posts

Well it's been a long and hard journey to get to where I am now. But other than some problems being swept under the rug I've hit what is probably going to be the hardest thing for me to figure out.

Now I must point out the following assumptions:

There is already some system that denotes what skills an enemy can use.

These skills are given a class that specifies what it can target. Either yourself, or someone you want to whack.

Some classes of skills like ones that just target a friendly ally will universally be beneficial.

Well I'm not sure how to tackle this problem of making a simple AI. I think it'd be something vastly probability based with lots of random number generating. But I don't know how to make it so an enemy who has a few skills is able to decide which one to use over the other. I'd rather not make it so it is just random in what gets used.

I'd like to give more information but that's really all I have at the moment. Any thoughts or suggestions would be helpful.

Link to comment
Share on other sites

Hmm...well, do your attacks have "elemental" values? IE: Hitting is a physical move, so it's tag is 1, while Fire Magic is a fire move, so it has a tag of 4.

If that were the case, you could devise a system like so...

Monster 1's turn...

*Generate (Random value between 1 & 7)

-------Value 0

***Attack guy with lowest HP

-------Value 1

***Healing move (if they have one)

-------Value 2

***Attack guy who just attacked Monster 1

******Check elemental tag of guy. If Monster 1 has an attack that's strong against it, use that. Otherwise, use strongest attack OR random.

--------Value 3

***Defend

--------Value 4

***Attack strongest guy

--------------------------

...etc, etc.

Additionally, you might use "magic" points. You know how in RPGs players can only use an attack a certain amount of times without healing their magic points? Maybe you could set up a hidden counter for each monster; when it's used an attack a certain amount of times, temporarily disable it and force it to use another.

Link to comment
Share on other sites

Ah I forgot to include that. I didn't want to do elemental stuff or magic/physical split just to make things simple.

I'd like to have the system be a bit 'smarter' than the one you proposed but it probably is the most easy to make. I do like the sound of temporarily disabling a skill. That is an interesting concept I haven't thought of before.

Link to comment
Share on other sites

Hmm...well, it doesn't necessarily have to be one type of attack = one random value. For instance, values 0 through 5 could all be "attack weakest character", while only values 6 & 7 cause the monster to heal. Skewing the actions for different monsters would produce more interesting/varied enemies.

Link to comment
Share on other sites

That's true. That is almost the precursor to what I'd like to do. Making the decision on how to act not on random chance but on something else. It's that something else I can't figure out or maybe random chance made to look cunning is the best I can do.

Link to comment
Share on other sites

Is there attack and defence? One would be to apply their strengths and to defend their weaknesses, of course. But there should be an element of "what weaknesses and strengths do the player characters have"? If a Player Character has a weakness to fire, the enemy/enemies should be able to exploit that (not really something I see all that much of in RPGs, and I'd like to).

Link to comment
Share on other sites

It is possible to attack and defend. I do not have the elemental chart built into the game, mostly to keep things simple.

However I do want to make the AI 'smart' in the sense that how it selects its targets is going to be effective. Like picking on the person that has the most supportive skills when they're healthy. Switching to the target that has the most attack power when health starts to get low to try and get rid of a threat, et cetera.

Link to comment
Share on other sites

Hmm, for what you're looking for, you could always have a seperate set of events based on health. For example-

Health >75

+ Heath <= 100

+ Generate random value

Then you could have separate decisions for each set of health intervals. So if it's between 75 and 100 like I posted you could have it attack the supportive person. But under the event for something like under 25, you could have it attack the strongest person. Hope you sorta understood what I meant.

Link to comment
Share on other sites

Ah yeah...That'd be pretty good actually. I suppose I could expand on it and in some cases instead of health intervals certain conditions like the number of players or their status could lead into other actions.

But that reminds me. I'm not entirely sure how I should go about programming the AI. One thought was to try and make it very broad and general enough to use a single mass of code to control everything. But I have a feeling I'll be programming the individual AI for each enemy instead. Regardless, any thoughts on that?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...