r/pygame • u/parismav • Sep 28 '26
Online pygame "platform"
Hello,
I am planning to create a pygame game engine, where programming students can submit their bot classes to play said game. Think of a battleship game engine, where a student's bot contains the logic that chooses the next cell to be hit.
I would like to host a website/platform where students can go and submit their bots (.py files), and see how they match against eachother. Show a leaderboard, step-by-step game breakdown, and maybe even visualize games between bots.
Are there any backend/frontend (or full stack) apps where I could deploy something like this?
For example, I see that itch.io can host pygame games, but that doesn't necessarily come with a server side (to accept and maintain student bots) as far as I understand.
Railway on the other side, can host Flask backend apps but not the frontend (?)
I am fairly new to this, namely building a full stack app for pygame. Any tips appreciated!
7
u/oclafloptson Sep 28 '26
Given the questions that you're asking here I'm afraid that you have a lot to learn in this regard. It's not about pygame. You say that this is for students so I assume it will not be a profitable endeavor. That's probably going to make web services which will host this API for you prohibitively expensive, or at least costly, if you plan to use it more than once in a given monthly period
It's going to be much better to self host this from a local machine. Especially since you're admittedly allowing the use of bots. One of your students WILL cheat in some costly way and I doubt that you'll really be able to prevent it
I would suggest that you look into alternatives. It sounds like what you're imagining is probably overkill
2
u/TheEyebal Sep 28 '26
So you want to put your pygame on a webpage correct?
I used pygbag for a bit and hosted it on vercel here on some examples.
Honestly not really knowledgable with hosting using pygame I just know that one. You can also look into web assembly
1
u/tune_rcvr Sep 28 '26
Have you considered the security implications of running submitted .py files? Seems very risky. A safer solution is to expose the game mechanics via an API and let the students run their scripts locally against it. You could provide them a thin client so they don't have to implement the async call pattern themselves. This is what I do for my games.