This site requires JavaScript, please enable it in your browser!
Greenfoot back
Super_Hippo
Super_Hippo wrote ...

2014/9/13

Calling UserInfo without lag

Super_Hippo Super_Hippo

2014/9/13

#
Is it possible to get/set information through UserInfo on site without lag? I heard something about 'threads' but I have no idea how to use them or if they would work at all. I recently uploaded this scenario: http://www.greenfoot.org/scenarios/12170 It seems to be impossible to get and set information every few seconds without encountering lots of lag. Every get/set will cause the game to delay for a while. Do you have an idea how to solve this problem or is it really impossible?
danpost danpost

2014/9/13

#
davmac wrote...
The intention was never to allow real-time communication. Data is stored in and retrieved from a proper database (Mysql) and this will almost certainly introduce some lag. Also, the storage server uses TCP/IP; TCP was never intended for real-time stuff; real games generally use UDP.
The above, from this page of a discussion explains what you are experiencing.
Super_Hippo Super_Hippo

2014/9/14

#
Ok, I guess that means it is impossible. Thanks for your answer.
Super_Hippo Super_Hippo

2014/9/14

#
Another related question: Do you know what exactly causes the lag? I mean, does it matter how many ints/string I get? Are only 'getMyInfo' and 'store' causing lag? Maybe you know it, so I better ask before I update the scenario a lot of times to test everything out. ;)
danpost danpost

2014/9/14

#
Yes, the storing and retrieving of UserInfo objects (accessing the database) is the main cause of lag. Once you have a reference to a UserInfo object, getting and setting the fields is like that of any other object.
You need to login to post a reply.