Hello,
I'm currently making a multiplayer game with Sock.lua, the world is created by the server using the love's integrated physics engine and Windfield, I would like to send the world to the players. What's the best way to do it ?
I've tried with Hero but I can't serialize the output...
Thanks
EDIT
I forgot to mention that levels are randomly generated by the server.
Excuse me if my english is bad
Send the love.physics world to players (multiplayer game)
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Send the love.physics world to players (multiplayer game)
- Attachments
-
- hero_test.love
- (34.82 KiB) Downloaded 89 times
Last edited by Quôzul on Fri Jul 06, 2018 7:32 am, edited 1 time in total.
Re: Send the love.physics world to players (multiplayer game)
The easiest option if your levels are not user generated is to just send the level name and build version.
Each of the clients could have a copy of the levels to begin with.
Box2D serialization is a good starting point.
After that point you would only need to send the changes/input.
Determinism (no "pairs" in the game logic) and fixed update steps will probably be necessary too.
It's hard to make something like this work seamlessly, but it's certainly possible.
Each of the clients could have a copy of the levels to begin with.
Box2D serialization is a good starting point.
After that point you would only need to send the changes/input.
Determinism (no "pairs" in the game logic) and fixed update steps will probably be necessary too.
It's hard to make something like this work seamlessly, but it's certainly possible.
Re: Send the love.physics world to players (multiplayer game)
I don't really understand what you're meaning, levels won't be user generated, I forgot to specify that levels would be randomly generated by the server.
This part won't be very hard to make.
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Send the love.physics world to players (multiplayer game)
He means that instead of sending over the levels themselves, which would mean you probably needing to send over tons of data always, you could just send over which level you're actually playing on, at the start i mean;
That said, if they're randomly generated, then you could also just send over the seed value; assuming that you're using love.math.random and not math.random, you can assume that the same level will be generated from one specific seed value.
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: Send the love.physics world to players (multiplayer game)
Good to know, I'll try sending a world with a seed
Re: Send the love.physics world to players (multiplayer game)
Bitser warns you right there why your "world" reference can't be serialized.I've tried with Hero but I can't serialize the output...
It's because "world.save" returns a table with functions.
I suppose it depends on the game.This part won't be very hard to make.
Pretty hard to make/debug in my experience.
Who is online
Users browsing this forum: Google [Bot] and 7 guests