Socket.IO: Drawing Connected Players – Part 5 – Creating Multiplayer Games
Brent Aureli Codes
Creating Multiplayer Games with using LibGDX and NodeJS.
Learn how to turn you game into a client that can connect to a back end server and communicate with other clients via network sockets through the library Socket.IO. We will discuss the creation of both the back end server and the game client as well as connecting them together into a fully functional multiplayer game!
why not to run server socket from java code? Because node is easier to start? or is there other reasons? Interesting to know
looking forward to seeing real time updating!!
Hey Brent! Enjoying this series so far. Learning a lot of things about Node.Js ^.^
I was wondering, after this tutorial series, if you could maybe look into random generation of levels/worlds and/or procedural generation? Not many, or at all, tutorials about it on the internet using Libgdx. Would so appreciate it if you could look into it :D.
Keep up the good work!
The thing im most confused about is real time movement. Like being able to see other peoples characters move on your screen.
I only know how to do this with sending a bunch of http requests every second to a rest server, but i dont think this is the current way.
Sending my location:
and then you would also receive the positions of others with a bunch of http requests every second and render their movement.
I'm getting an error "No OpenGL context found in the current thread" when trying to create a new friendly inside the new player emitter listener.
My fix was to create a list of Strings to add, and when the emitter listener is called, it adds the new id to the list. Then in the render method it checks if the list.size() is greater than 0, and if so, the friendly is created and added along with the id to the hashmap. Then I remove the id from the list. Is there a better way of fixing this? I don't know how to access the ui thread directly from another thread in gdx
Simply one word. Awesome!!!
can't use HashMap.Entry because it's not public
Can I use this method to do multiplayer between Desktop and Android?
Verrrrrrry good tutorial!
I went ahead and gave my Sprite a body, and I get the following error if I create the body inside the new-player event:
Exception in thread "EventThread" java.lang.RuntimeException: No OpenGL context found in the current thread.
this must have somehing to do with the fact that I created a body, so How to I go about fixing this?
Thanks for the video. I am abit confused as to how you managed to get the hashMap value shared between multiple instance of the game i.e when player 1 started the map is empty and only gets populated with data when player 2 connects. However how does player 1 manage to get the updated hashMap? I would be very grateful if anyone can help with this as I have been unable to get the second player avatar to display on player 1 screen. Thanks in advance.