Page 1 of 1

Developing Multipayer Snake. Help!

Posted: Fri Jan 22, 2016 6:46 pm
by TheNiny
Hello! I am trying to make a snake game, with multiplayer, and was wondering how I would go about that. I have made several small projects (none that I have really finished) and want to do a project that I will finish and will be fun.

How would the game work?
It will be a cross of snake and agar.io, bigger snakes can eat smaller snakes.

Why?
Why Not?

If anyone could help me out with the code (for the snake part) and point me towards a server tutorial that would be great! Now, I know that this isn't the greatest question of all, but any help would be greatly appreciated!

Edit 1: I have made the base of the game, but can't figure out how to make the snake turn at an angle. If anyone could help, that would be awesome!

Re: Developing Multipayer Snake. Help!

Posted: Fri Jan 22, 2016 8:25 pm
by Davidobot
LÖVE makes use of two networking libraries: e-net (I recommend this one) and luasocket.
As for the snake part, please look at this pseudo code implementation, it should help you.

I would not recommend going for a multiplayer game straight away, as it requires a high knowledge of the language, good planning skills and lots of nerve cells. If you're feeling up to it though, go on ahead. I have previous experience with using both e-net and luasocket, including fancy multiplayer-related stuff such as interpolation, timeouts and optimizing server code. I am more than willing to help you, if you're willing to learn.

EDIT: Also, don't assume people will be willing to code the game for you. Expect to do the main haul yourself - we are an extremely nice community, but we got our own projects to take up our time, and the last thing anyone wants is for the creator to get demotivated half-way through and abandon ship after you've poured your own time into it. Just a warning, nothing personal.

DOUBLE EDIT: I must add that I want to encourage your progress - it sounds like a fun concept.

Re: Developing Multipayer Snake. Help!

Posted: Fri Jan 22, 2016 9:15 pm
by TheNiny
Thanks!
I was never planning on people doing the code for me, but rather helping me on some tricky parts. I will definitely look into the e-net library that you pointed at, and am willing to learn it in my free time (I am a student who loves to code in his free time!). So if you have any mechanics that you would want to see in this game, go ahead and shout them out!

Re: Developing Multipayer Snake. Help!

Posted: Sat Jan 23, 2016 1:19 am
by garcia1000
Hello! In my experience making multiplayer for a game is as much work as making an entire game itself.

Re: Developing Multipayer Snake. Help!

Posted: Sat Jan 23, 2016 3:52 am
by TheNiny
garcia1000 wrote:Hello! In my experience making multiplayer for a game is as much work as making an entire game itself.
Well, maybe I can just make the game itself, then work on multiplayer later. If you could help me, I can't figure out how to make the snake turn at an angle, like in the original snake games. You can download my project at the top of the thread. Thanks!

Re: Developing Multipayer Snake. Help!

Posted: Sat Jan 23, 2016 7:30 am
by drikdrok
Hello, I am also thinking about adding online multiplayer in a near future project. Would it be better to create the singleplayer expirience first, then build multiplayer on it? Or set the foundatioin for multiplayer, then add singleplayer elements?

Re: Developing Multipayer Snake. Help!

Posted: Sat Jan 23, 2016 1:03 pm
by zorg
It's a tricky situation, since if when you're implementing the multiplayer, you decide on a way to communicate between clients, it may conflict with how you built the singleplayer parts up, leading to you needing to rewrite that to support multiplayer.

I personally would think out how the communication would work best, and then code the singleplayer part like that, then finally add in multiplayer... that said, building a smaller multiplayer test app would be probably helpful, to test what kind of communication type would be best suited for the game.