
Python Online Multiplayer Game Development Tutorial
video description
Date: 2022-03-14
Related videos
Comments and reviews: 10
Mick
This is not really a great tutorial. He basically just types everything out and keeps saying 'Don't worry, you'll understand it later', but he never actually explains anything later. Luckily most of the code is fairly self-explanatory.And some of that code is janky af. That line make_pos(read_pos) and then like a thousand brackets to convert a string to a tuple and back to a string.
Also nothing is commented so you have to do that all yourself but it also makes it impossible to come back to this code and re use it in future
On a more minor note, his names for variables are terrible 'p' and 'n' are basically textbook 'don't name your variables this' examples. Unfortunately this is the only tutorial like this I found so we have to make do.
reply
This is not really a great tutorial. He basically just types everything out and keeps saying 'Don't worry, you'll understand it later', but he never actually explains anything later. Luckily most of the code is fairly self-explanatory.And some of that code is janky af. That line make_pos(read_pos) and then like a thousand brackets to convert a string to a tuple and back to a string.
Also nothing is commented so you have to do that all yourself but it also makes it impossible to come back to this code and re use it in future
On a more minor note, his names for variables are terrible 'p' and 'n' are basically textbook 'don't name your variables this' examples. Unfortunately this is the only tutorial like this I found so we have to make do.
reply
Tristen
Thanks for a great tutrorial on Socket programming in Python.
Here's another way to handle to rules to RPC. First define the the rules like so:
self.rules = --
-R-: --R-: False, -P-: False, -S-: True-,-
-P-: --R-: True, -P-: False, -S-: False-,-
-S-: --R-: False, -P-: True, -S-: False--
-
# Note the rules only defines the winning combiniations.
Then the winner() method would be defined as:
def winner(self):-
p1 = self.moves[0].upper()[0]-
p2 = self.moves[1].upper()[0]-
winner = -1-
if self.rules[p1][p2]:-
winner = 0 # player Id 0 won-
elif self.rules[p2][p1]:-
winner = 1 # player Id 1 won
return winner
enjoy!
reply
Thanks for a great tutrorial on Socket programming in Python.
Here's another way to handle to rules to RPC. First define the the rules like so:
self.rules = --
-R-: --R-: False, -P-: False, -S-: True-,-
-P-: --R-: True, -P-: False, -S-: False-,-
-S-: --R-: False, -P-: True, -S-: False--
-
# Note the rules only defines the winning combiniations.
Then the winner() method would be defined as:
def winner(self):-
p1 = self.moves[0].upper()[0]-
p2 = self.moves[1].upper()[0]-
winner = -1-
if self.rules[p1][p2]:-
winner = 0 # player Id 0 won-
elif self.rules[p2][p1]:-
winner = 1 # player Id 1 won
return winner
enjoy!
reply
bee
Hey I know this video is old, but at 1:23:18 where you use if statements to check for the winner for rock paper scissors, you could instead use a nested dictionary to improve the runtime. I substituted the use of the following one:
windict = --R-:--S-:0, -P-:1, -R-: -1-, -P-:--R-:0, -S-: 1, -P-:-1-, -S-:--P-:0, -R-: 1, -S-:-1--
in this format, all I'd have to do is define the dictionary and then:
winner = windict[p1][p2]
-Tech With Tim
reply
Hey I know this video is old, but at 1:23:18 where you use if statements to check for the winner for rock paper scissors, you could instead use a nested dictionary to improve the runtime. I substituted the use of the following one:
windict = --R-:--S-:0, -P-:1, -R-: -1-, -P-:--R-:0, -S-: 1, -P-:-1-, -S-:--P-:0, -R-: 1, -S-:-1--
in this format, all I'd have to do is define the dictionary and then:
winner = windict[p1][p2]
-Tech With Tim
reply
K.
For those having trouble running the required multiple files - server, client1, and client2 - in Visual Studio Code (VSC), open subsequent instances of VSC for each client file to run and then open and run the one client file in each instance, while running the server file in the main instance. Cool is that edits in the client file in the main VSC instance will automatically show up in the other open two instances.
reply
For those having trouble running the required multiple files - server, client1, and client2 - in Visual Studio Code (VSC), open subsequent instances of VSC for each client file to run and then open and run the one client file in each instance, while running the server file in the main instance. Cool is that edits in the client file in the main VSC instance will automatically show up in the other open two instances.
reply
Srivatsan
Could someone tell how to make server be accessible across the internet. That is, I want to access the server running in one network from a completely different network. I tried all methods, such as using public IP, etc etc, but nothing seems to work...
reply
Could someone tell how to make server be accessible across the internet. That is, I want to access the server running in one network from a completely different network. I tried all methods, such as using public IP, etc etc, but nothing seems to work...
reply
Bgamer
Just a small hint for everyone watching:
Don't lose time watching/trying to understand this video or code if you don't have GOOD basic understanding in python.
First learn the basics and object oriented programming, then come and watch this video
reply
Just a small hint for everyone watching:
Don't lose time watching/trying to understand this video or code if you don't have GOOD basic understanding in python.
First learn the basics and object oriented programming, then come and watch this video
reply
luckyblo82
hey! I wanted to make a -The Price is Right- game where the opponent chooses a number and the other one has to guess it
depending of the number you pick it tells you -Higher- or -Lower-
could you help me please? thanks in advance! :D
reply
hey! I wanted to make a -The Price is Right- game where the opponent chooses a number and the other one has to guess it
depending of the number you pick it tells you -Higher- or -Lower-
could you help me please? thanks in advance! :D
reply
Kostas
1:21:40 I typed exactly the code correctly, I even copied the code from the link, but I still had an error in .upper(). It says: Cannot find reference 'upper' in 'None'. How can I fix it? If anyone knows, please let me know :)
reply
1:21:40 I typed exactly the code correctly, I even copied the code from the link, but I still had an error in .upper(). It says: Cannot find reference 'upper' in 'None'. How can I fix it? If anyone knows, please let me know :)
reply
Martha
I keep getting an error that says -OSError: [WinError 10022] An invalid argument was supplied- where I wrote -s.listen(2)-. Somebody please let me know what is going on.
reply
I keep getting an error that says -OSError: [WinError 10022] An invalid argument was supplied- where I wrote -s.listen(2)-. Somebody please let me know what is going on.
reply
kbrunot13
cool, but how i'm turn my socket in a real server?, exemplo: i need a socket for connect two peoples of != wi-fi, how i'm make this? i just can run in localhost
reply
cool, but how i'm turn my socket in a real server?, exemplo: i need a socket for connect two peoples of != wi-fi, how i'm make this? i just can run in localhost
reply
Add a review, comment
Other channel videos















