Sunday, September 04, 2005
Implementation of TVML with Croquet
At last entry, I wrote the brief story of the Croquet project with NICT. But now, I am trying to describe more detail implementation of that project as I have a time on the airplane. In term of implementation, I could not say it was a good work. There were a lot of ad-hoc things, dirty patch, and less reusable. All the mess were from its primary goals. - Novice user can use. - Connect with P2P network more than 7 hosts. - The croquet space is regarded as if real NICT interior. Imagine these are not easy in current Croquet release as it is too early stage. For instance, the most strongest demand in here was we didn't have to show any error messages whenever a child touches anywhere, thus it needs a bunch of hooks in UI-related code. The lack of generalization was why I didn't show neither Squeak image nor source code of the project (I am ready to show you my source if you send me a mail). But I think I should contribute parts of codes for this project with some ways. Anyway, let's talk about points of the implementation. ** Describe animation as TVML script Honestly, the script that I described for the project was actually not TVML itself. Although much portion of the script was due to TVML, but I didn't TVML itself because; - Implementation of full set of TVML needs need effort. - I don't want to carry with new syntax into Smalltalk. Finally, the script I introduced looks like; - character:walk (name="Bob" x=10, y=0, z=10) (TVML notation) - Bob tvBehavior runSpec: #(walk x 10 y 0 z 10 length 1000). (Croquet notation) Basic idea is similar, but its expression is different. Croquet version is just a Smalltalk array, and it doesn't need the key "name" because the subject of the script is described as its receiver (Bob tvBavior references a TVML animation engine). Another significant thing is Croquet version stats the length of animation (by millisecond). The length of the animation was essentially platform dependence in original TVML (you can tune with magical numbers to try and error). But in Croquet, accurate timing was needed in network interaction. ** User interface For using as a direction board, I made the user interface be much simpler to eliminate walk-through motion, pop up menu, and dock menu. In stead of that, I put simpler UI. - Both right button and left button mean selecting menu. - The stand point of user does not move. - The degree of view can be moved by operation a mouse (180 width and 30 height). The main differences from regular Croquet is eliminating walk-through. In this work, User doesn't need to move the stand point. Besides, anyone can not make new objects or new windows. ** Network Network was the hardest work to do. Did you know current Croquet just supports up to 3-4 clients? I realize the fact when 3 days before of the demo, it makes my face pale with fear (I regretted I had been too late binder). The problem I met there was; - Become slow down. - A number of shared message was dropped down. - All host was down after one host was down. - Whenever one host is down, I have to restart all the host for synchronizing their states. I couldn't fix those problem in precisely right way as I had no time, but I managed the issue relatively ad-hoc way. - Each host has just atomic, limited states. - Reducing shared message (Cutting lasers, falling down, etc). - The interval of Heart beat (TeaParty>>runKeepAlive) was made longer. - Don't use TCP to avoid blocking. ** The fact we met from the "Open House" event. - It is hard to use if many user operate in same time. - The trackball has too many buttons. - Menus are too large for using in large display. - The pointer cursor is too small to see where is pointed. - It is hard to know each host is connected each other. - Out of memory happened each an hour.