I am looking to create a simple online multiplayer game. Each player choose a number as their input and get a result based on simple calculations as their output. The code for the game itself is already created in VBA, but i am looking to make it online. Could i use Python for that, and do i need to create a website?
1 Answer
Online for public use or to share with someone specific (friend or someone else)?
If it is with a friend you could try rerouting traffic from your router to you PC with a specific port. Then create a simple website (with Flask for example, as it uses python) to make the game playable. Finally others could play the game by accessing your website through your public IP.
6 Comments
Aksel Skaar
Thanks! The game would be for friends through invitation, yes. How could i reroute traffic from my router to my PC? Would that be after i created a website?
Marcos Pires
You could create the website and have the backend of it running in your computer with your computer's local IP (that's the easy part). To reroute traffic you would have to access your router and create a rule that basically would say: all traffic that arrives to your public IP with a certain port (that you must define) is rerouted to your computer's local IP. (your computer would work as a server)
Aksel Skaar
Thanks again! This solution would mean that only my PC with my unique IP would be required to be able to play the game? And that i would have to program any new router that controls the net where i am set up? If yes, is there any way to make it more generale? So that it would work from any PC with any Router?
Marcos Pires
Unfortunately you would have to configure the router again for every new network you are connected yes. But if your friends are connected to the same network as you no rerouting would be needed, they would only need to access your local IP. (assuming the network you are connected allows it)
Aksel Skaar
My friends would always be connected to the same network as me. At a school for instance. Does that mean that no rerouting would be required and that no unique PC is needed, following your recommendations.
|