gdquest-demos/godot-open-rpg

Auto battle

W0ots opened this issue · 1 comments

W0ots commented

Hi,
How can I make a autobattle system please?
Thanks :)

Hi,
Could you ask for godot support on a support channel? For example, you can join the Godot discord community or another one here: https://godotengine.org/community
Auto battle systems are a question of AI decision-making and at the basic level, you have the AI pick a command based on some conditions. In OpenRPG, on each turn, instead of waiting for the player's input, you'd have nodes like you have on the AI, that define a condition and an action. Here's the base interface for our AI system:

extends Node

class_name BattlerAI

func choose_action(actor : Battler, battlers : Array = []):
	# Select an action to perform in combat
	# Can be based on state of the actor
	pass
	
func choose_target(actor : Battler, action : CombatAction, battlers : Array = []):
	# Chooses a target to perform an action on
	pass

You have the battlers' AI inherit from that, and then the way they choose an action and a target is a big question, there's a lot to say there.

I invite you to discuss that e.g. on Discord or something. I'll close the issue for now.