Output feedback from the game

Hi, i want to do something strange with the videogame i want to create for a cabinet. For example i want that when in the game you turn a light on, a light in reality, otutisde the cabinet turn on.
I think the better idea for doing this is to use the “vibrations part of the controller” that normally is a motor that requiered energy to start. If i put a condition in the game that make the joypad vibrate i can send that energy to an Arduino and than do whatever i want.
Im very noob with Gdevelop. my question are two: is there another way to send out an electricity input, or something i can use to trigger, from the game?
The other question is more simple:
I’ve download the gamepad extension for gdvelop5 for connect a ps4 controller how can i use it in my scene? I really dont know how to set it.
Thank for all
Sorry for bad English

One possible way would be to have a local web server running a custom application that will receive network data from the game and then pass commands to a connected arduino. If you use an RPi you can skip the arduino and connect to gpio pins on the RPi.
What do you mean by cabinet? Arcade cabinet?

1 Like

Yes arcade cabinet.
I dont want to use internet because i want to move the cabinet, and i want that work everywhere.
I dont know how to how a raspberry Pi work. I know is possible to make an arcade cabinet with raspberry and maybe is possible to export the game make with Gdevelop to be played with a raspberry. For me is not a problem also put a notebook inside the cabinet i think is better than a raspberry. The question is i have to use vibration of the joypad for have a “physical” outside input that trigger something like a light or not?

Thanks to all

If you are going to use a laptop to run the game you could try to run a web server (it can also be an MQTT server) on that laptop and then have the laptop control an arduino with will turn lights on or off.

The issue here is getting the game to communicate with the physical world and at this point this is not supported, e.g. no serial port access or bluetooth. GDevelop can handle networking quite fine either in plain HTTP requests or WebRTC & MQTT.

1 Like

Check the “multiplayer platformer with gamepads” example.

If the entire screen in the cabinet is not visible to the player, you can change the brightness of a rectangle in the game and read it with a simple phototransistor at the arduino.
Should be simpler and provide more outputs than a vibration sensor.

I think it would also be possible to send a HTTP requests from the Game to a webserver on an ESP8266 that runs as a wifi hotspot.

Very good idea Jack! Thank you.
I know that is possibile to use a color sensor whit arduino, maybe is better than phototransistor to have more output.