Re: Python and sockets question
If you don't have an idea for an interesting game but think multiplayer will solve it, you are very wrong.Adding multiplayer just means that you don't have an idea for an interesting game but also you decided to make programming the interestin
Re: Python and sockets question
I don't know, that i have much troubles with the basics. I had write something multiplayer because i don't have any idea to develop a game with interesting story.
URL: https://forum.audiogames.net/post/518296/#p518296
--
Audiogames-reflect
Re: Python and sockets question
@16Frankly, as I have explained in another thread, networking for games is very very hard. If you're having this much trouble with the basics, I strongly suggest doing something without networking and coming back to this. A game with networking is
Re: Python and sockets question
Unfortunately i can't do it, because i have to rewrite all code of my program to use async functions, or i don't know how to do it. Server works perfectly, but when i run function in my game, to connect to the server, server's scripts is b
Re: Python and sockets question
OK, so maybe it will solve my problems.Thanks.
URL: https://forum.audiogames.net/post/517821/#p517821
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo
Re: Python and sockets question
@13yes. You can declare variables in a module and use them in another module. Typically, though, you'd just do:def send(msg):
send_queue.push(msg)And then use send from outside the module.
URL: https://forum.audiogames.net/post/517818/#p5
Re: Python and sockets question
So I can use queue between two modules?I have to declare the queue variables globally, to have an access from each module which needs it?
URL: https://forum.audiogames.net/post/517814/#p517814
--
Audiogames-reflector mailing list
Audiogames-reflector
Re: Python and sockets question
You need to get comfortable with callbacks. The code that does the networking has to do the networking in both directions in the same function, but when it receives a message it can call your function, and instead of having to put all the code that works
Re: Python and sockets question
Yep, but then i have to define a function which will get the events from server and next function, which will send the events to server.
URL: https://forum.audiogames.net/post/517786/#p517786
--
Audiogames-reflector mailing list
Audiogames-reflector
Re: Python and sockets question
@9I'm not sure what you're asking.They would be the same program. You just separate it in terms of code. Two modules of code don't have to know about how the other module works, if you design them right.
URL: https://forum.audiogames.
Re: Python and sockets question
So i have to run the game above the network? Then the network would have an access to the game events, which should be send. Or vice versa. I will run the network from the game, then game will send the events through the network instance.
URL: https
Re: Python and sockets question
@7The sender puts messages on a queue (see the queue module) that it wants to have be outgoing. The receiver gets called with messages.Then your one function that handles both just either pulls from the queue of messages to send, or calls your we received a
Re: Python and sockets question
Is any simple way to get an events in another function, than handle client which i put in opening connection to the server at the client side and accepting a connection at the server side? I have to have more elegant code, but when I would process an
Re: Python and sockets question
Is any simple way to get an events in another function, than handle client which i put in opening connection to the server at the client side and accepting a connection at the server side? I have to have more elegant code, but when I would process an
Re: Python and sockets question
@5I would advise new people to stay away from binary formats if only because getting C extensions for Python to build can be painful.If the data is too big, Python's zlib module can compress your messages, or you can probably find something that does i
Re: Python and sockets question
@2 and @4 is right (pickle can be executed).just have your save file encoded in python for a offline game in pickle.regarding packets, you can use bson as well.also if your client is on a different device than server (maybe arm vs x86/64) you should keep
Re: Python and sockets question
Sure. JSON encodes lists, dits, bools, strings, floats, and ints. And any combination thereof. There are other more efficient encodings as well, if you're willing to go outside Python's standard library and JSON ever proves to be too slow.The pr
Re: Python and sockets question
@camlorn yes, it is a full example of simple game.So when i'll switch to asyncio and encode my data with json to send and requests from server and client, i can send a list with coordinates and so on, such as in this example using select?
URL:
Re: Python and sockets question
Do you have the simplified example of your ping-pong server? It looks like your linked files are actually a full game.Two notes.First: don't use Pickle for anything real. It is quite easy to make Pickle execute arbitrary Python code. Look at the
Python and sockets question
Hello. I have a problem with sockets in python. I found two examples on github.[server.py](https://gist.githubusercontent.com/Plai … /server.py)and[game.py](https://gist.githubusercontent.com/Plai … 16/game.py)I don't know, how to force the game clien
20 matches
Mail list logo