soundmud / soundrts

A real-time strategy audio game
http://jlpo.free.fr/soundrts
Other
43 stars 31 forks source link

Migration to python3 #110

Closed francipvb closed 4 years ago

francipvb commented 6 years ago

Hello,

I started migrating the SoundRTS codebase to python3. For now, it needs to be tested.

Please check py3-migration branch at francipvb/soundrts.

Please if you can, test it.

I know that there are some code issues that needs to be fixed.

Please comment to this about my effort.

Cheers,

francipvb commented 6 years ago

I just want to point that there are some work from @thgcode.

Cheers,

gigino1987 commented 6 years ago

Hi, I downloaded the source code, but don't work when i launch the main script with Python interpreter (python soundrts.py). I have installed Python 3.6.3, pygame 1.9.3 and win32com, module of pywhin32. Here the error message: C:\Users\Luigi\Downloads\soundrts-master>python soundrts.py Traceback (most recent call last): File "soundrts.py", line 2, in from soundrts import clientmain File "C:\Users\Luigi\Downloads\soundrts-master\soundrts\clientmain.py", line 1, in from lib import log ImportError: cannot import name 'log'

Cheers

LR

soundmud commented 6 years ago

It must be a relative import. When pygame and all the libraries on every platform support Python 3, it might be time to migrate. It might be a lot of work though, and right now I intend to work on the code for a few months. It might be better to migrate when the code isn't changing.

sanslash332 commented 6 years ago

hmm @soundmud but witch library that soundrts uses currently isn't implemented, or can't be compiled at python3?

So, don't consider libs that are impossible to update because are discontinued today. But for example, pygame can be compiled on python3 without ani problem. So i use it on that without drama.

But witch other have currently problems?

📦

soundmud commented 6 years ago

@sanslash332 For example, pygame on some Linux distribution, at least until recently.

ethindp commented 5 years ago

If you're going to migrate to Python 3, then please, please get rid of the TCP stuff and telnet usage. This is ridiculous. This game breaks the first rule of multiplayer gaming -- always use UDP and never, ever use TCP unless you're transmitting static data like server IP lists and such. But for real time communications? UDP all the way. So please, man, fix this. And add multithreading support -- really, really needs it. As an example: I have a 26x26 map in robotic. Naturally, I can acquire a large number of units -- well over 200. Problem? It lags the shit out of everything in the game because of TCP and telnet and the fact that the game relies on so much that it shouldn't. Fixing this would be so, so much a waste of my time, personally -- I'd rather rewrite the thing in scratch. It gets text of sounds over the internet, it uses telnet and TCP, it uses a very, very bad implementation of multithreading.... what's next? I hate to rant but this seriously needs to be said. It really doesn't matter if you're continuing to update the code; please, please fix the networking and threading stuff in the next release if at all possible. And yes, its possible. Delay the release if you must, but please fix it. It would make this game a lot funner for things like tournaments if UDP was used instead of telnet.

pauliyobo commented 4 years ago

Hello everyone I've started the migration to python 3. This is really experimental and I expect it to be unstable, but the game does actually run, at least on windows. I can currently test only there Only 8 tsts need to be fixed and some errors still have to be found since the code has been ported with a tool If you want to help me with this the fork can be found here https://github.com/pauliyobo/soundrts/tree/python3

soundmud commented 4 years ago

The migration is done. Thanks for your help. I wanted to proceed initially by little, conservative steps, so I couldn't reuse your work as is, but it provided some reference and ideas.