RealTime online games

105 views
Skip to first unread message

Kallikratidas

unread,
Feb 28, 2019, 6:17:21 PM2/28/19
to DroidScript
Is there any possible way to create a real time online game?
Message has been deleted

Netpower8

unread,
Feb 28, 2019, 10:36:16 PM2/28/19
to DroidScript
yes there is but to make it more interactive you need a dedicate server to handle all the data request (like level up games).

but for small real time games it is possible to have a server (that is not yours and need not to maintain) and send small
packets of data to indicated you move then the other player (or players) receive the data to update the screen on their device
to show you move. then they make the move and process goes the other way.

Kallikratidas

unread,
Mar 1, 2019, 10:23:17 AM3/1/19
to DroidScript
Basicly, what I want to find, is not the relationship with the server logic, as I already know how it works.
I have created an online server hosted on 000webhost.com and created a game.
My problem is the asynchronous displayed data and the realy slow fps.

I have been using the xmlHtpRequest, which is much secure but realy slow for such a usage.
I have found a website saying that xmlHttpRequests are not for such purposes and I have to use something else instead.

//Read http://buildnewgames.com/real-time-multiplayer/

There I found a javscript “plugin” for my needs, but I don't know how to adapt it to droidscript.
I anyone you knows how to create a realtime online game, I would like to see his answer.

sankarshan dudhate

unread,
Mar 1, 2019, 10:37:54 AM3/1/19
to DroidScript
WebSockets are probably the best way to have a steady connection. Dave posted a demo of WebSockets in DS at https://groups.google.com/forum/m/#!searchin/androidscript/Socket/androidscript/t1QzCgGZrH8

I think you'll find it useful.

Kallikratidas

unread,
Mar 1, 2019, 3:41:22 PM3/1/19
to DroidScript
Thank you very much for your suggestion.
WebSockets are very useful for realtime onlinegames.
My only question is:
I have a domain named as mydomain.000webhostapp.com
How can I create a websocket server like wss://mydomain.000webhostapp.com
I mean I know how to create the client code but not how the createWebSocket function works and any kind of details as regarding the Serverandnot the client.

Kallikratidas

unread,
Mar 2, 2019, 3:59:45 AM3/2/19
to DroidScript
Help

csnakes xXXx

unread,
Mar 3, 2019, 4:50:18 AM3/3/19
to DroidScript
I think that you need node.js on your server but I think that your host do not give access to that.

nikhil babychan

unread,
Mar 4, 2019, 8:09:53 AM3/4/19
to DroidScript
You need to change your server to https://www.heroku.com

Kallikratidas

unread,
Mar 4, 2019, 8:16:39 AM3/4/19
to DroidScript
@nikhil babychan
Thank you, I will give it a try.

renan cifras

unread,
Aug 6, 2019, 4:35:28 PM8/6/19
to DroidScript
It worked?

John

unread,
Aug 7, 2019, 12:35:11 AM8/7/19
to DroidScript
Spend some time reading about WebSockets.

Then try to find a web host that supports it.

I googled it and found https://www.cloudflare.com/website-optimization/web-sockets/ so they do exist.

Reply all
Reply to author
Forward
0 new messages