Avatars freezes and so on...

Post here your questions about the OpenSpace 1.x or notify bugs and suggestions.

Moderators: Lapo, Bax

Post Reply
Dorru
Posts: 45
Joined: 16 Dec 2008, 13:45

Avatars freezes and so on...

Post by Dorru »

Have a very irritating problem here where the avatars in the game are very laggy, or freezy... My own avatar walks perfectly for me, but for others it starts walking into objects untill it find the right direction for its goal and so on, the same happends for me on other avatars.

Sometimes the other avatars just stops, they stand still on one tile, but their legs are moving. But for the visitor that have that avatar, the avatar is working perfectly.

The FPS is always 25-31/30. So whats the problem? Pathfinding problem? the connection between SFS and OpenSpace? something else?

Both are using Mozilla Firefox.

When we both tries IE, the FPS is always on 23-25/30 for me, and 28-31/30 for my friend, so the avatars seems to lagg while they walk for me. Also, the problem above still occurs in IE, but when it does, IE stops working for both (me and my friend) at the same time..

When using IE, I also got a window with an error text in it that says:

Code: Select all

Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
	at client_fla::MainTimeline/onAvatarMovementEnd()
	at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at com.smartfoxserver.openspace::OpenSpace/forwardAvatarEvent()
	at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at com.smartfoxserver.openspace.mvc::IsoEngineModel/dispatchAvatarAnimEvent()
	at com.smartfoxserver.openspace.avatar::Animator/com.smartfoxserver.openspace.avatar:Animator::fireAvatarAnimEvent()
	at com.smartfoxserver.openspace.avatar::Animator/onAvatarAnimationCompleted()
	at Function/http://adobe.com/AS3/2006/builtin::apply()
	at caurina.transitions::Tweener$/caurina.transitions:Tweener::updateTweenByIndex()
	at caurina.transitions::Tweener$/caurina.transitions:Tweener::updateTweens()
	at caurina.transitions::Tweener$/onEnterFrame()
Dorru
Posts: 45
Joined: 16 Dec 2008, 13:45

Post by Dorru »

Now when I'm playing alone the avatar is very laggy for myself too now. The map I'm on doesn't have any objects, not even a background. Only walkable tile objects. So whats the problem and solution? :S
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

What happens in this method of your application?

Code: Select all

client_fla::MainTimeline/onAvatarMovementEnd()
As the stack trace shows, in that method something happens that causes the Flash Player to slow down.
Paolo Bax
The SmartFoxServer Team
Dorru
Posts: 45
Joined: 16 Dec 2008, 13:45

Post by Dorru »

bax wrote:What happens in this method of your application?

Code: Select all

client_fla::MainTimeline/onAvatarMovementEnd()
As the stack trace shows, in that method something happens that causes the Flash Player to slow down.

Code: Select all

function onAvatarMovementEnd(evt:AvatarEvent):void
{
	//trace("--[OpenSpace] Avatar movement end (user id: " + evt.params.id + ")")
	
	if (evt.params.id == smartFox.myUserId && evt.params.tile.customParams != null)
	{
		// Check tile custom type
		switch (evt.params.tile.customParams[0])
		{
			/** HANDLE NAVIGATION TILES **/
			
			case "nav":
				// Tile leading to a new map directly, as soon as the avatar steps on it.
				// An identifier is given as second parameter, to know which server room to join and map to load.
				// Examples:
				// -> customParams="nav|ranchInside|12|1"
				// -> customParams="nav|ranchInside" (no need for destination coordinates, random spawn is ok)
				changeRoom(evt.params.tile.customParams[1], evt.params.tile.customParams[2], evt.params.tile.customParams[3], evt.params.tile.customParams[4])
				break
			
			case "int":
				// Tile activating an object on the map itself (instance name given by the event's linkedObjectId param).
				// When this map object is clicked (or a specific part of it), it causes the room joining and the map loading.
				// Examples:
				// -> customParams="int|ranchInside|door1|12|1" (complex map object, with 2 entrances: we need an additional param to identify the entrance; this would require some changes in the following code)
				// -> customParams="int|ranchInside|12|1" (simple map object, no need for an additional param)
				var mapRef:String = evt.params.tile.customParams[1]
				var px:int = int(evt.params.tile.customParams[2])
				var py:int = int(evt.params.tile.customParams[3])
				var dir:int = int(evt.params.tile.customParams[4])
				
				var mapObject:Sprite = evt.params.linkedMapObject as Sprite
				
				break
			
			case "ext":
				// Tile causing an external movieclip to be displayed (for example a confirm message+button)
				// Examples:
				// -> customParams="ext|ranchInside|confirm1|12|1" (we may have more than one confirm message: we need an additional param to identify which one to show)
				// -> customParams="ext|ranchInside|12|1" (simple map object, no need for an additional param)
				break
			
			
			/** HANDLE OTHER TYPES **/
			//...
		}
	}
}
It's the same as the one found in the examples..
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

Could you publish your test online and send us an email with the address? We would like to see the behavior.
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

We have tested your example for several minutes opening 4 clients on the same machine (a MacBook Pro): two clients in Mac OSX (1 Safari + 1 FireFox) and two clients in a Windows XP virtual machine (1 Firefox + 1 IE7).
An additional client was also running on another computer.
All avatars were moving around at the same time, and we could never experience slowdowns or other issues.
Paolo Bax
The SmartFoxServer Team
Dorru
Posts: 45
Joined: 16 Dec 2008, 13:45

Post by Dorru »

bax wrote:We have tested your example for several minutes opening 4 clients on the same machine (a MacBook Pro): two clients in Mac OSX (1 Safari + 1 FireFox) and two clients in a Windows XP virtual machine (1 Firefox + 1 IE7).
An additional client was also running on another computer.
All avatars were moving around at the same time, and we could never experience slowdowns or other issues.
Hmm, strange :S must have been just somthing temporary then... Oh well, I'll write again if the problem shows up again
thg
Posts: 12
Joined: 13 Nov 2008, 09:37

same issue

Post by thg »

Sometimes the other avatars just stops, they stand still on one tile, but their legs are moving. But for the visitor that have that avatar, the avatar is working perfectly.
I have experienced the exact same thing.
lilshtz
Posts: 17
Joined: 16 Dec 2008, 15:32

Post by lilshtz »

I am also experiencing this issue. any other suggestions to solve this problem?
Post Reply