In Development - Internet Connectivity [Test Demo]

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
So, me and a friend from work have been working on a script that will let you use internet on your games. He just sent me an update and it can now perform simple get and post http requests. This should be enough for simple features on offline games, but we still have to work a lot on it to enable the creation of more complex games.

The following is an encrypted demo of the script working:

http://hudell.com/downloads/connectiontest.exe

The demo is quite simple:

There are three NPCs on the center of the screen. If you talk to them, their position will change. 

Then there's another NPC with two options: "Upload their position" and "Download their position".

If you hit the "Upload their position" option, the game will send their position to my webserver, replacing the information currently there.

If you hit the "Download their position" option, the game will check the position that is saved on my webserver and change the NPCs accordingly.

You can test it by opening multiple instances of the game on the same computer, or opening it on two different computers. Both should work.

I don't know what will happen if a lot of people use it at the same time, so let me know if you get any kind of error.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,204
First Language
Binary
Primarily Uses
RMMZ
fyi...

Code:
    DOMAIN = 'hudell.com'    TIMEOUT = 100
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
fyi...

    DOMAIN = 'hudell.com'    TIMEOUT = 100
Not a problem. 95% of people won't be able to use it even if they get that far.
 
Last edited by a moderator:

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,204
First Language
Binary
Primarily Uses
RMMZ
7 minutes though, Kinda puts it in perspective how quick people can get into the default encrypted systems. D:

I feel bad, I've seen yours... Would you like to see mine? ^_^

Also, I'm VERY curious as to whats going on in you dll, cause quite frankly, its not required ~ not from my experiences.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
I feel bad, I've seen yours... Would you like to see mine? ^_^
I'd love to, if you don't mind.

Though the script you saw was made in less than 20 minutes. All the important stuff is inside the dll. And I'm not allowed to talk about what happens in there (even I don't know much, as I made only the ruby part of it) 
 
Last edited by a moderator:

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,204
First Language
Binary
Primarily Uses
RMMZ
Yea, I can tell most of its hidden away :p

Out of curiosity, have you benchmarked any :GET or :pOST requests?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
I haven't.

How did you benchmark yours? I can make the same test with mine to compare.

I didn't even try to make two simultaneous requests yet.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,204
First Language
Binary
Primarily Uses
RMMZ
Benchmark.ips do |x| x.report('fast') { HTTP::fastest_get } x.report('norm') { HTTP::normal_get } x.compare! endWhen I was closing my session after each get the time is significantly slower. :/
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
Created a new connection, made the request and waited for the response from my webserver:


The same request with curl:

 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,204
First Language
Binary
Primarily Uses
RMMZ
Same request to your server file. ( HTTP::full_get("www.hudell.com","/jogo/getposition.php") )

user system total realjogo 0.016000 0.000000 0.016000 ( 0.494029)What benchmarking tool did you use?  Not seen that kinda output before.  I used Benchmark.bm for the test shown above. :)
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
Benchmark v1.1 by Solistra, the first one I found on google

Edit: Can you do the same request with curl? It will probably give a different time too, because of your location.
 
Last edited by a moderator:

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,204
First Language
Binary
Primarily Uses
RMMZ
Interesting. I've not used that tool before, have to check it out :)

And yea, I will do some more tests tomorrow. Its nearly 4am here and I can feel my eyelids closing ^_^

Also - did you change the database locations of your files ? I seem to be getting some error and the test demo you loaded doesnt seem to be saving my locations either.

Edit:

Just used that SES benchmark script to perform a get request to my server and this is the result.

---- BENCHMARK ----------------------------------------------------------------http: Process: 0.000000 Real: 0.17101 seconds------------------------------------------------------------------------------- TOTAL: 0.000000 (0.17101 seconds)Random question:

What happens when you perform a large number of iterations? Lets say, 100, or 1000 ?
 
Last edited by a moderator:

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
Maybe my server was offline at that time. It's working now.

Since I wait for the response before doing a new request, calling it a hundred times will only multiply the time by 100.
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,513
Reaction score
3,204
First Language
Binary
Primarily Uses
RMMZ
Perhaps, as you state, its working now :)

Who is your server provider? (feel free to not tell :p )  I know your not excessively transmitting data, but requests seem to be a little slower to your server than my own, and I'm doing quite a fair amount within my php file. (transmitting alot more than 3 characters) :)

---- BENCHMARK ----------------------------------------------------------------your server :: get_position.php : Process: 0.000000 Real: 2.268129 secondsmy server :: get top ten highscores for ping .php file : Process: 0.016000 Real: 1.580091 seconds------------------------------------------------------------------------------- TOTAL: 0.016000 (3.84822 seconds)^ these tests where of ten iterations. So in theory, ten full requests to each server. :)
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
The server provider is dreamhost.

And it's even slower to me (you're probably closer to it than me).
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
If you haven't rented a dedicated server, a lot of the speed depends on how many virtual servers the provider hosted on a single real PC and what specs that PC has. It might simply be that dreamhost has several other (bigger) websites on the same unit as they would all share the same connection (reducing its max) and processing power.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
If you haven't rented a dedicated server, a lot of the speed depends on how many virtual servers the provider hosted on a single real PC and what specs that PC has. It might simply be that dreamhost has several other (bigger) websites on the same unit as they would all share the same connection (reducing its max) and processing power.
Yes, I alone have over 50 websites on that same server and there's probably many other users.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Does the script support persistent connections?

Since I wait for the response before doing a new request, calling it a hundred times will only multiply the time by 100.
Using multiple threads to handle requests and responses would probably be something cool to have, but then having to piece it together would probably be kind of annoying. TCP already does it for you but I think that's for each request I think (so you still have to figure out how to get the order correct on your end)
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
Does the script support persistent connections?
I'm still fixing some issues, but yes.
Using multiple threads to handle requests and responses would probably be something cool to have, but then having to piece it together would probably be kind of annoying. TCP already does it for you but I think that's for each request I think (so you still have to figure out how to get the order correct on your end)
That is working already. All I need is to instantiate a new object for each thread.And each instance can have up to 64 simultaneous different requests.

Benchmarks:

Code:
---- BENCHMARK ----------------------------------------------------------------New connection with one request (waiting):  Process: 0.203000  Real:    0.55607 seconds-------------------------------------------------------------------------------                                              TOTAL: 0.203000 (0.55607 seconds)---- BENCHMARK ----------------------------------------------------------------New connection with 10 requests (waiting):  Process: 1.297000  Real:    3.601138 seconds-------------------------------------------------------------------------------                                             TOTAL: 1.297000 (3.601138 seconds)---- BENCHMARK ----------------------------------------------------------------10 connections with 10 requests (waiting):  Process: 2.610000  Real:    7.087292 seconds-------------------------------------------------------------------------------                                             TOTAL: 2.610000 (7.087292 seconds)---- BENCHMARK ----------------------------------------------------------------10 connections with 10 requests (not waiting):  Process: 0.015000  Real:    0.018001 seconds-------------------------------------------------------------------------------                                             TOTAL: 0.015000 (0.018001 seconds)---- BENCHMARK ----------------------------------------------------------------New connection with 100 requests (waiting):  Process: 16.328000  Real:    36.268713 seconds-------------------------------------------------------------------------------                                           TOTAL: 16.328000 (36.268713 seconds) 
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,583
Latest member
write2dgray
Top