Page 1 of 1

Multiplayer game tutorial?

Posted: Fri Jan 03, 2014 8:12 pm
by waprothero
Is there a tutorial of template for creating a multiplayer game in live code? I'm considering creating a multiplayer game and am wondering what I'm getting into. The game would need fast response, as players would be competing against each other for the correct response.
Thanks

Re: Multiplayer game tutorial?

Posted: Fri Jan 03, 2014 9:04 pm
by FourthWorld
There's a lot to something like that, but the chat example included in the LiveCode package may be a good starting point, illustrating the basics of handling multiple socket communications in a custom server.

Re: Multiplayer game tutorial?

Posted: Sat Jan 04, 2014 12:17 am
by Simon
Hmmm...
This question may be about a tablet device, 4 players, one each side.
And that is much easier to code. :)

But you are probably correct, it's an online game.

Simon

Re: Multiplayer game tutorial?

Posted: Sat Jan 04, 2014 12:30 am
by Newbie4
To start simple, program it first on desktop computers. That way, you can get the logic and moves worked out. Then to move it to portable computers (tablets, phones, etc you just have to redo the input code.

Here is a link to the planning and some code for doing a 2-player game on one computer. There are also 2 working games so you can see the code in action.
https://sites.google.com/a/pgcps.org/li ... ayer-games

Here is a link to getting started doing a game using separate computers (client - server model) with some simple sample code that will get you started https://sites.google.com/a/pgcps.org/li ... uter-games. I will see if I can dig up a sample game. Some of my students tackled a tic-tac-toe game with a server that managed the graphics and communication between 2 other computers (players). It is crude and not quite finished but I believe the graphics and communications worked. They ran out of time (The school year ended before they finished it)

See if these help you get started with what you had in mind.

Re: Multiplayer game tutorial?

Posted: Sat Jan 04, 2014 3:24 am
by wprothero
This is great info! Thanks. I'll check out these resources.

I was thinking about the game being an app with a server handling the communication. I have a vps with liquidweb and should be able to open sockets at will.

I have the LC server installed as a cgi, for testing. I didn't want it to interfere with normal php, MySQL and other server functions that I rely on, by configuring Apache in the way the livecode tutorials suggest. I doubt if the cgi type configuration is right for multiplayer quick responses.

Re: Multiplayer game tutorial?

Posted: Sat Oct 31, 2020 11:51 pm
by gsillevis
Newbie4 wrote:
Sat Jan 04, 2014 12:30 am
To start simple, program it first on desktop computers. That way, you can get the logic and moves worked out. Then to move it to portable computers (tablets, phones, etc you just have to redo the input code.

Here is a link to the planning and some code for doing a 2-player game on one computer. There are also 2 working games so you can see the code in action.

Here is a link to getting started doing a game using separate computers (client - server model) with some simple sample code that will get you started [I will see if I can dig up a sample game. Some of my students tackled a tic-tac-toe game with a server that managed the graphics and communication between 2 other computers (players). It is crude and not quite finished but I believe the graphics and communications worked. They ran out of time (The school year ended before they finished it)

See if these help you get started with what you had in mind.
Any chance you have the sample game handy?

Re: Multiplayer game tutorial?

Posted: Wed Nov 17, 2021 1:50 am
by FourthWorld
arise big.jpg

Re: Multiplayer game tutorial?

Posted: Wed Nov 17, 2021 9:44 am
by richmond62
I'm just not sure that making a game on LiveCode is really a good idea.
I think the answer to that must lie in the area of what type of game you want
to make.

ALSO: from what I have seen of Unity you are constrained by all the clever stuff that is on offer there, while
with LiveCode you'll have to start pretty well at the bottom; but that will allow you to aavoid those constraints.

I have made a prototype of the Warcraft type game in LiveCode.

Re: Multiplayer game tutorial?

Posted: Wed Nov 17, 2021 11:50 pm
by stam
"constrained" wouldn't be the word i would use! Calling that a 'constraint' is a bit like saying the data grid is a constraint, and we should prefer to write our own data grids from the ground up ;)

Unity is a tool honed at making games. It has many features that promote that, which LC does not. The real downside is it's a much more complex beast - but then you can do a heck of a lot more with it. LC doesn't even have basic openGL-type functionality.

My old boss used to say 'use the right tool for the job' and he wasn't wrong - LC is good for many things but it is not a game building engine. Yes you can build some games with it and some of these will be quite good.

But a lot of games require functionality that isn't native to LC - you could bend over backwards to make it work if that rocks your boat, or you could just use an engine that does it for you - Unity, Godot, Unreal Engine - lots of alternatives, just depends on what you want to achieve, and how much time you're willing to invest to learn...
Of course, if you can achieve what you want with LC you should definitely use that ;)

Re: Multiplayer game tutorial?

Posted: Thu Nov 18, 2021 10:04 am
by richmond62
That explanation was really good.