[Ohrrpgce] SVN: james/12702 Implement very simple (random) hero AI for when a hero should attack aut

Ralph Versteegen teeemcee at gmail.com
Wed Jan 26 19:57:26 PST 2022


Ah yes, update_battle_menu ought to be called each tick so that players
can't bypass tag and cost requirements. I filed that as part of the Attack
Costs Megabug. Note the relevant part 8. about check_costs_as_weapon on
that issue, and what I proposed to do about it:

"Make 'check costs as weapon' not apply to attacks directly in a battle
menu, instead add a setting to attacks in the battle menu for whether to
apply costs. And set it automatically, from the 'check costs as weapon'
bit, for existing battle menu items."

On Thu, 27 Jan 2022 at 14:55, James Paige <Bob at hamsterrepublic.com> wrote:

> Those are excellent suggestions! And I'll fix my mis-use of valid_for_ai
> also.
>
> I think calling update_battle_menu() sounds like a good idea, and maybe we
> could consider it a bug that it doesn't get called each turn when a hero is
> under player control
>
>
>
>
> On Wed, Jan 26, 2022 at 9:14 AM Ralph Versteegen <teeemcee at gmail.com>
> wrote:
>
>> Fun! It can be expanded in various directions later. We could have a
>> setting in each spell list (or even each spell list slot) to say whether
>> the spell list/slot should be used by hero AI.
>>
>> I see some bugs in the battle menu code though.
>> You don't actually use valid_for_ai for anything! "WITH
>> *bspr.batmenu.items[randint(choice_count)]" is wrong.
>> You forgot to check .disabled, and it ignores .check_costs_as_weapon
>> (which is misnamed and has dubious effect), however currently .disabled is
>> only updated and .check_costs_as_weapon is only applied in
>> update_battle_menu(), which is called from inside battle_display() and
>> apparently is not called when a hero is under player control. I think maybe
>> you intentionally didn't want to use update_battle_menu, but only that
>> checks tag conditions, and I don't see a reason to duplicate that code in
>> update_battle_menu.
>>
>> Since valid_for_ai is a vector, you could just use v_remove to delete
>> options that fail atkallowed, and stop when none are left, then you can do
>> away with 'safety' entirely.
>>
>>
>> On Sun, 23 Jan 2022 at 04:22, James Paige <Bob at hamsterrepublic.com>
>> wrote:
>>
>>> Right now the hero just randomly picks any regular attack.
>>> I do plan to support picking from spell lists also
>>> I have no plans to support item use in automatic attacking mode
>>>
>>> I intend to keep hero AI very simple. I might add a mode that only ever
>>> uses the first valid attack, since I can see that being handy for cutscene
>>> battles, but any really fancy hero ai (like if ally hp is low, then use
>>> healing, or conserve MP if enemies are weak) will have to wait for
>>> battlescripting
>>>
>>> Also, known bug with both player controlled enemies, and auto controlled
>>> heroes is that they screw up the "ESC to go back" feature in turn-based
>>> battle mode. I'll find a fix for that soon though.
>>>
>>>
>>>
>>> On Sat, Jan 22, 2022 at 10:14 AM <subversion at hamsterrepublic.com> wrote:
>>>
>>>> james
>>>> 2022-01-22 07:14:27 -0800 (Sat, 22 Jan 2022)
>>>> 82
>>>> Implement very simple (random) hero AI for when a hero should attack
>>>> automatically
>>>> ---
>>>> U   wip/bmod.bi
>>>> U   wip/bmod.rbas
>>>>
>>>> _______________________________________________
>>>> Ohrrpgce mailing list
>>>> ohrrpgce at lists.motherhamster.org
>>>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>>>>
>>> _______________________________________________
>>> Ohrrpgce mailing list
>>> ohrrpgce at lists.motherhamster.org
>>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>>>
>> _______________________________________________
>> Ohrrpgce mailing list
>> ohrrpgce at lists.motherhamster.org
>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>>
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20220127/6ee8fd99/attachment.html>


More information about the Ohrrpgce mailing list