Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [AGK2] AppGameKit 3D Multiplayer Server for Linux

Author
Message
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 5th Dec 2017 22:50 Edited at: 8th Jan 2018 14:25
Hi mates!

did anyone got a simple 3d example for the php multiplayer sockets server? by @MikeMax https://forum.thegamecreators.com/thread/219676

It works fine with 2d axes but I have no luck trying to make working a single cube in a 3d background

Thanks in advance!!

Edit: Fixed link
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 6th Dec 2017 09:42
do you use the server with the NGP plugin or only the core server ?

can i have more informations on your problem ?
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 6th Dec 2017 10:57
Thanks Mike! Yes I'm using the NGP plugin and the core server, both together,

The scenario is just a basic 3d world setup, I was trying to move a 3d cube modifying the example but had no luck.

MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 6th Dec 2017 23:06 Edited at: 7th Dec 2017 00:08
if you have downloaded the full 2D car example zip, in the AppGameKit code (main.agc) you should see something like this (it's a little specific due to car rotations and velocity etc...):



For 3D, it's easier : maintain the velocity at 1 and assume your movement adds or subs 1 unit per frame on X axe (at 60fps but will be adapted with Tween# variable) :



You should do this for Y and Z axes too, depending on the keys you want (just replace the constant POS_X by POS_Y or POS_Z.

Do not move your local "object/mesh" yourself at this time in these statements ... there is an event "NGP_onLocalPlayerMoveUpdate" to do this which make local reconciliation :



the others clients will update their positions on your screen with the event "NGP_onNetworkPlayerMoveUpdate" :



As you can see, you have only to add the use of the slot POS_Z for 3D and in 3D you will often need to interpolate rotations too ... so, for object rotations, do the same things with NGP Slot ANG_X,ANG_Y,ANG_Z (NGP_SendMovement() and the moveUpdates events). You have a second set of Slot (POS_X2,POS_Y2,POS_Z2,ANG_X2,ANG_Y2,ANG_Z2) if your objectID (or vehicle) has a second element (think about a tank (1) with a turret/canon (2) for example)

when i will have time i will update the multiplayer server (i've made some little fixes for precision and stability) and will add a 3D simple example

tell me if you need other informations
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 7th Dec 2017 00:06
Thanks for your help, I'll give a try I understand the network logic and I would like to extend the example for my game
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 7th Dec 2017 00:13 Edited at: 7th Dec 2017 00:15
You're welcome

Also keep in mind that you're sending movements (so... offsets) and not global position coordinates. that's the key to understand how to handle player inputs global positions are handled by the server and returned to events
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 7th Dec 2017 00:25
This is pretty interesting, thanks I was dealing today with this
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 7th Dec 2017 00:32
I don't need physics at all because I'm doing a boat ship sailing effect, any collision means to stop the ship, so I think the "sailing" behaviour is much like a car but a sea plane object. Your example is a good start point for me. Thanks again.
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 7th Dec 2017 00:39
if you want to stop your ship ... do not send movements anymore when a collision occurs and it should works for the car's example i use inertia and reduce movements slowly until 0 when you stop accelerating
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 7th Dec 2017 00:56
The wind force in my case
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 7th Dec 2017 01:08
ok if you need a beta tester when you will have something functional, i am here !
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 7th Dec 2017 01:17
Of course
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 10th Dec 2017 20:48
Thanks again MikeMax!

It's working for me following the guidelines it's really cool.

I was missing to check the AGKServer.php file, the onAGKClientJoin start point

MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 10th Dec 2017 20:58
Glad to see it working with someone else lol

There's almost no AppGameKit online multiplayer game I hope this will change over time !
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 16th Dec 2017 16:32 Edited at: 1st Jan 2018 03:29
MikeMax wrote: "There's almost no AppGameKit online multiplayer game I hope this will change over time !"


Ok! let's go

For anyone who want to play with a 3D server, they can follow this steps using the attached files

- The server needs to be hosted in a dedicated machine to run it from the command line. Open the port configured.
- Be sure editting the main.agc and AGKServer.php files to setup your own server configuration. Just apply the public machine IP in the AppGameKit client.

I was playing with your plugin in my game and it runs smooth, so going now to stress it "a bit"

All the client /server credits goes for @MikeMax https://forum.thegamecreators.com/thread/219676

Also thanks to @Conjured for the hint https://forum.thegamecreators.com/thread/221107, and all credits to @janbo for the "positioning text in a 3D world" snippet https://forum.thegamecreators.com/thread/220501

Have fun!
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 16th Dec 2017 16:33
Ehm, that upload file button
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 16th Dec 2017 16:39 Edited at: 2nd Jan 2018 12:33
Seems I cannot editing my posts or adding attached files
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 16th Dec 2017 17:33
I have uploaded it for you

Attachments

Login to view attachments
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 16th Dec 2017 18:47
Thanks Mike!
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 18th Dec 2017 10:18
your 3D example is working well a good template for a multiplayer 3D car game ! ( MarioKart 3D ?
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 18th Dec 2017 20:49 Edited at: 3rd Jan 2018 04:09
Shouldn't be difficult, I'm missing already some syntax in AppGameKit but learning fast , I'll give a try this weekend

Edit: After the backlog : P
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 6th Mar 2018 21:14
I want to publish a working example, this thread already active for me.
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 7th Mar 2018 23:12
@nonom
Please do. Would love to see what you came up with.
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 29th Apr 2018 14:55
Quote: "Please do. Would love to see what you came up with."


Hi @RickNasher I would like to make a multiplayer example with this .-) https://forum.thegamecreators.com/thread/221892

Maybe we could work together If you want.

Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 29th Apr 2018 16:05 Edited at: 29th Jan 2019 13:50
Always open to collaboration.

My goal is a universal networking solution that allows connecting:
1. over (W)LAN.
2. over the internet(WAN) by specifying IP and port.
3. using a server that lists game hosters.
4. a dedicated server that acts solely as host.

I also would like it to be so that (if possible ) when the player that is the host abandons the game for some reason, the next player in line that has a fast enough ping, will become the new host, iaw: auto-host switching on the fly.
But I would go for the simple LAN approach first to establish a working demo, then build from there, see what can come up with.

Currently working on a networking lobby and the whole network monitor thingy:

(somehow my imagehoster 'TinyPic' appears offline, so now refreshed it with 'imgur'


[EDIT] Soon as I have something working a bit I'll publish the code.. [/EDIT]
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 29th Apr 2018 23:47
Looks good. Congrats Rick
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 30th Apr 2018 17:43
Thanks

Not there yet still very much a WIP.
Really want to go at it tonight, but have to do taxes and help gf with bizz plan.
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 1st May 2018 22:25
It's enough, I'm prototyping every part of my WIP (Pirates) game, so I post my threads trying to study every part by separate.

And ofc it should be multiplayer!
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 1st May 2018 22:40
Quote: "And ofc it should be multiplayer! "

Indeed!
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 29th Dec 2019 15:24 Edited at: 29th Dec 2019 15:27
Going to prepare a Dockerfile for this and contribute the link.

Credits to MikeMax
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 5th Jan 2020 16:14 Edited at: 5th Jan 2020 16:37
Im pushing an image to docker hub, enjoy
https://github.com/nonom/docker-agk-server

EDIT: The image ready to go
https://hub.docker.com/r/nonom/docker-agk-server
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 26th Jan 2020 17:09
Burning with curiosity to see how all this works together, unfortunately( as always have too much on my plate already), hope can find the time in upcoming days to check it out.
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 13th Feb 2020 13:12
Hi Rick!!

Yes, I need to improve the documentation,

I'll add a docker-compose file, which is working with docker desktop for windows in just a couple of clicks.

But I'm going to publish my own NetworkManager when it's ready
TamBam
12
Years of Service
User Offline
Joined: 29th Nov 2011
Location: India
Posted: 3rd May 2020 20:46
Free AWS server for 1year
see my tutorial
https://youtu.be/ja9HenlU9ho
nonom
6
Years of Service
User Offline
Joined: 12th Nov 2017
Location: Picking mushrooms
Posted: 18th Jul 2020 01:36
Actually all the cloud providers are offering 1 year for free, so we have a couple of years covered
http://www.nyan.cat/index.php?cat=pirate

Login to post a reply

Server time is: 2024-04-19 20:34:29
Your offset time is: 2024-04-19 20:34:29