How to implement realistic controller stick input in AGM?

Hello everyone, I’d like to discuss the issue of controller stick mapping with you all. Since AGM (Action Game Maker) is designed for creating action games, players naturally prefer using a controller, and a good feel is crucial for the gameplay experience.

I’ve previously discussed this briefly with Mr. BAZ via email.

Currently, in AGM, the input mapping for the joystick treats it as a button mapping rather than a true analog stick. This means that any deadzone value set in the mapping is completely ineffective. It fails to provide the subtle variations needed for proper stick recognition, which is a significant problem.

For example:

A very slight push of the stick immediately triggers the button press. There’s no way to set a deadzone threshold to determine how far the stick must be pushed before recognition occurs.

Even worse, there is severe diagonal input leakage. A tiny tilt of the stick is immediately registered as pressing “down.”


This is simply unacceptable for action games.

I tested numerous side-scrolling action games, and in most of them, the diagonal input leakage only occurs when the stick is pushed significantly downward, which is both reasonable and intuitive.

Currently, AGM’s stick mapping cannot easily implement this basic functionality. Therefore, I considered using GDScript to handle true analog stick operations independently.

However, I’ve encountered many issues during this process. Typically, in Godot, setting up a stick via GDScript requires binding to the player’s underlying code. But my player is built entirely using VS (VisualScript). I haven’t yet found a way to make the character respond to the stick’s up/down/left/right movements on the board. How should this be executed?

Since I can’t resolve this on my own, I’d like to discuss it here with everyone.

Is there a way in AGM to achieve true stick adaptation? This is extremely important for action games.

Here is the joystick code configured for Godot. The system backend can detect the joystick, but binding it to the player’s input mappings is another matter entirely. Plus, I’m not sure if, once bound, it will be treated as a button input just like the default AGM behavior… :crying_cat:

extends Node

@export var dead_zone:float = 0.08
@export var diagonal_threshold:float = 0.5

var joy_id:int = -1

func _ready():
	_scan_joypad()

func _scan_joypad():
	var joy_list = Input.get_connected_joypads()
	if not joy_list.is_empty():
		joy_id = joy_list[0]

func _process(_delta):
	if joy_id == -1:
		_scan_joypad()
		return

	var raw_x = Input.get_joy_axis(joy_id, 0)
	var raw_y = Input.get_joy_axis(joy_id, 1)
	var stick_vec = Vector2(raw_x, raw_y)

	# Release all actions every frame
	Input.action_release("UP")
	Input.action_release("DOWN")
	Input.action_release("LEFT")
	Input.action_release("RIGHT")

	if stick_vec.length() < dead_zone:
		return

	var normal = stick_vec.normalized()
	var strength = stick_vec.length()

	if strength >= diagonal_threshold:
		if abs(normal.y) > abs(normal.x):
			if normal.y < 0:
				Input.action_press("UP", true)
			else:
				Input.action_press("DOWN", true)
		else:
			if normal.x < 0:
				Input.action_press("LEFT", true)
			else:
				Input.action_press("RIGHT", true)

func bind_joy_device(target_id:int):
	joy_id = target_id