I was starting to work on my fork of a PyGame multiplayer stub program (a program that you may extend into an actual multiplayer game, which in my case would be (irrelevantly) an detective game similar to the popular Among Us game but is free software and hopefully more flexible) hosted at git://git.andrewyu.org/pygame-multiplayer.git. Discussion with some people from #libregamenight on LiberaChat convinced me to use LÖVE as Lua tables are in my opinion easier to handle than Python dataclasses.dataclass and LÖVE has a cleaner programming interface.
The goal is to be able to scalably have players see each other move with a reasonably low amount of latency and minimal overhead. Both 'every player connects to a non-playing server' and 'every player connects to a host's game' are acceptable, though the former is preferred as this ensures that no player has special permissions over the game's movement traffic, which makes future anti-cheat extensions easier.
I have used Lua before, mainly in general playing-around and Minetest modhacking. However, I have no experience with concurrency and networking in Lua. Though it is likely that I will eventually dive into these topics, I am looking for an example program that fulfills part or all of what I described as it may vastly speed up my learning process and can speed up the development of the actual game.
Async Multiplayer Stub
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Async Multiplayer Stub
I'll volunteer this project:
https://github.com/togfoxy/Mars-Lander-reboot
I taught myself the networking bits so may not be the most elegant but it is in LOVE and has LAN option.
Love 11.3 btw
https://github.com/togfoxy/Mars-Lander-reboot
I taught myself the networking bits so may not be the most elegant but it is in LOVE and has LAN option.
Love 11.3 btw
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Async Multiplayer Stub
For concurrency, you either have coroutines, which are pre-empted on the same OS thread since it's lua's own thing, or, with löve specifically, you can also use Threads which are actual parallel os threads.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Async Multiplayer Stub
Not sure if that usage of "pre-empted" was right, but basically, coroutines are manual task switches, with some similarity to Python generators, where all tasks work on a shared Lua environment, while Löve threads are OS threads that run each in its own Lua environment, and it's not so easy to share data between them.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Async Multiplayer Stub
Maybe not, though i did want to just point out that coroutines are not exactly executed in paralell; they're still running on the same cpu core.pgimeno wrote: ↑Sun May 15, 2022 7:27 pm Not sure if that usage of "pre-empted" was right, but basically, coroutines are manual task switches, with some similarity to Python generators, where all tasks work on a shared Lua environment, while Löve threads are OS threads that run each in its own Lua environment, and it's not so easy to share data between them.
löve threads can be due to the OS' scheduler may run them on different cpu cores/threads.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Who is online
Users browsing this forum: Google [Bot], Nikki and 9 guests