The Raspberry Pi is the 'real web srver'
You can install the normal WAMP/LAMP package -as well as- have an MQTT broker/server running.
If you are not using an MQTT or subscribe and publish type of approach.. you will be wasting resources..
And depending on how many 'machines' you add to your platform.. you may have to have multiple 'servers' (depends on how many connections and request/response delays)
As each 'ESP' will constantly/continually be polling (querying) the database to see if there is a 'credit' that has been added for that machine.
No? ok.. I'll try again.. in 100 milliseconds!! (or whatever threshold you eventually set.. but I would imagine it would need to be fairly frequent to be a usable system)...
Now times that (above) by however many machines/esp's you plan on adding the projects.. (all constantly polling/asking if they been given any credits!??)
The difference between the two approaches is that:
In your current/shared approached you are:
- calling your friends house to see if he is home
- his mom answers
- You ask
- she says no, hes not home
- you hang up, and call right back to see if your friend is home yet/again
*** rinse/repeat..
In an MQTT/ subscribe & response system/approach you are:
- calling your friends house to see if he is home
- his mom answers
- You ask
- she says no, hes not home... BUT... as soon as he gets in, I'll have him CALL YOU.
Make sense?
1 approach is clearly more efficient than the other.
Now...
taking your project, and removing the 'game' portion..
this is nothing more than a simple MQTT (subscribe & publish) project that is done all the time.
This MQTT system can also be 'cloud based' (FYI).. they have many free services (not sure on any limits)***
A bunch of ESP 'clients' are connected to this subscribe and response platform/service...
anytime there is something one of the 'subscribers' needs to know.. data is 'published'.. and any client listening will get alerted.
That 'alerted' subscriber (ESP module) will then simple trigger a relay or whatever that is connected to it..
This whole project could be done in a weekend if you have the hardware. 