Monday, July 13, 2009

Seaside 2.9 and Comet to control replicated Croquet islands.

I want to share some of my experiments in combination of Open Croquet and Seaside/Comet at image level.

The main aim is: to allow multi-user interactions with shared content on the Croquet island just from web browser in real time (from any place, device like smart-phone, low-end machine (sometimes without OpenGL) etc. so, that a connection to the network and http web based browser just needed.
Also, it could help to implement open source "Forum pages" like features , which are existed only in Qwaq forums 2.0 (access recent activity from your web browser etc.).

I have prepared the ready-to-go image for those, who want to explore the infinite possibilities :)
1. CroquetSDK.v1.0.18 with new image.
2. Just one image for using with manual downloaded any Croquet SDK.

Also, I prepared the Script for loading Seaside 2.9 alpha updated (13-07-09) into any fresh OpenCroquet image (1.0.18 users should update from sources to the latest, or use this one Croquet.1.0.25 )

For examples look at SmotriniWorldControl class.


Here on the screen-shot there are two participants and two opened web browsers (Safari, Firefox).
Just only one participant run Seaside/Comet application.
Changing any of the RGB sliders (in one of browser window) causes the change of the active space color, and glad to Comet in all opened Web browsers slider's handles change their visual state automatically (without manual refreshing).

All callbacks from seaside to croquet island are future events, like from proper harness in Croquet, so they dose not destroy the replicated state.
-----
onSlide: (html jQuery ajax
callback: [ :value |
aColor = #red ifTrue:[self class valueRGB red: value asNumber.
aFrame future color: (Color r: self class valueRGB red g: aFrame color green b: aFrame color blue)].
-----

How to run:

1. Start WAListenerAdaptor (support Comet Seaside applications)

WAListenerAdaptor startOn: 8888. (different ports for several participants, if needed)

2. Open Croquet master (KAT Demo harness is used in this example, from default Croquet SDK).

KCroquetParticipant new openInWorld.

When it asks about interactivity server, leave it blank, as (www.croquetcollaborative.org) could not work, so it will start locally.

3. Point your any web browser (Firefox, Safari preferable) to:

http://localhost:8888/seaside/croquet

4. To test Comet functions (RGB Slider), just open another browser window and point it also to:

http://localhost:8888/seaside/croquet


To be continued..

25 comments:

  1. I don't mean to be obtuse, but I'm a little lost. I have two tabs in Firefox running the panel. I have the SDK image running with the rabbit.

    I get the idea that what's going on in a World can be pushed to a browser on a cell phone or whatever. I get that non-visual data can be pushed out.

    I don't get what "Create 3D Window Text" is for if I can't see it. I get the impresion only data is being pushed to the cell phone browser.

    Are they supposed to be running the Croquet image at the same time? But you said they may not have any OpenGL?

    I know: Tell me this. Am I supposed to be seeing anything else beside your control panel in the browser window?

    I'm curious about this. It's cool, but I'm not quite getting it.

    ReplyDelete
  2. Ok, for example:

    Imagine the classroom or exhibition/art gallery hall, where we have several projections of Croquet 3D (OpenGL based) space on the walls. And the audience (several people) could easily interact with shared content by using their own web based devices, come with.
    They will observe both the web control panel changings on the web-device and real Croquet OpenGL graphic on the walls.

    The second scenario: could be, yes, like "blind blogging, surfing etc.", as I mentioned in the post: "Forum pages". You interact with shared island and get callback just with html information on the same device, but knowing, that your real Croquet world is growing etc. And, to get full experience, you need to see both, or just Croquet full one.

    So, these Seaside/Comet applications for Croquet could be seemed like multi-user shared remote controllers for manipulating the Croquet island content.

    ReplyDelete
  3. "Are they supposed to be running the Croquet image at the same time? But you said they may not have any OpenGL?"

    Meaning, that it's like:

    I allow somebody to control my OpenGL Croquet application from his phone remotely, and for that he needs just a web browser pointed to my Seaside application, running inside Croquet image on my side.

    ReplyDelete
  4. And in addition, to clarify things:

    Several opened web browsers connected to one Croquet image/one harness are not equal to several "Avatars" in Croquet (where each should be presented by own harness). So, they are equal more to one controller which is shared between multi-users or like multi-touch interface over http.
    In general you could enhance with such "controller" every connected island replica living in Croquet p2p net.

    ReplyDelete
  5. I think this looks like a fascinating project. Being able to interact with a croquet space simply via the browser is a great idea. Well done, I will definitely follow this project.

    cheers
    Andy

    ReplyDelete
  6. I'm finding looking at this code to be very rewarding. This is the first time I've looked at something about Croquet and not felt it was alien technology.

    You're getting data from the croquetHarness and croquetText instance variables. OK.
    What's gained from there gets pushed by CTPusher.

    CTPusher>>javascript: says you used the SUScript class in the comment. That doesn't exist in 2.9, I don't think. The actual code is JSScript.

    I dwell on that because I'm not sure how Comet does what it does. Is this a function of a library like JQuery or Prototype. Or is the Smalltalk doing the pushing?

    I'm fascinated by how Lukas Renggli's Scriptaculous parses and builds JavaScript strings. Your app seems to be opening up new possibilities for me to explore on how that's done. Not least of which, it's time for me to switch to 2.9.

    One thing, where are my variable, hierarchy, etc. buttons? What have you done to my buttons! :o Is this a Pharo image or something?

    I hope you don't mind, but I'll likely have more questions tomorrow, as well.

    ReplyDelete
  7. About image and code inside:

    This is the CroquetSDK.1.0.25 image (v.3.8 Squeak based) with some cleanup.
    Seaside 2.9 packages and its additions like Comet, JavaScript, JQuery are loaded into this image without any manual modifications, except of http server infrastructure and required/missed methods for 3.8 Squeak version (as Seaside is now developed in Pharo, which is 3.9+ derived).
    So, DynamicBindings, KomServices, KomHttpServer packages are a bit corrected by me to work in Croquet image and Croquet-Seaside package contains missed methods from 3.9/Pharo. They could be founded here (http://www.krestianstvo.org:9090/Croquet-Seaside/) and are used in automatic loading script also.

    CTPusher is the class from Comet-Core package, and is maintained by Seaside dev-team, the same for other Seaside stuff.
    And yes, Comet is not a function of a library, here is the quote from Philippe Marschall "Comet is a hack into the HTTP protocol. To make it do something is was not designed to do".
    Comet and so CTPusher is used for updating the state of web content in all (not just one) connected web browsers at the same time. Here in SmotriniWorldControl example we set in future/get the value of space color on #onSlide event, and only on #onStop event push it (in a form of position of slider's handle) to other browsers.

    About development environment:

    Buttons are missed, sorry.
    To restore them in SystemBrowser just enable (Preferences enable: #optionalButtons).

    ReplyDelete
  8. Thank you for answering my questions. I need to reflect a bit now. And I love the trick for getting the buttons back.

    ReplyDelete
  9. Anonymous2:57 am

    Curious. Are you alone or are there other people working on this with you. It's refreshing to see someone else working with the Croquet SDK. Are you planning on maintaing the smalltalk roots of the project?

    ReplyDelete
  10. I downloaded the CroquetSDK-1.0.25-Seaside.2.9-Full image+vm. I ported my Seaside app over to it - mainly working thru issues with the newer Comet. The reason for this is to have more mature Jabber + Comet + Seaside(2.9) code. Currently I'm not certain how I might take advantage of Croquet but if needed it's there.

    One question: how out of synch is this image from the latest-and-greatest Croquet/Cobalt image?

    ---John

    ReplyDelete
  11. Great to hear, it could extend the Jabber usability in Croquet/Cobalt, so that somebody could participate in conversation being held in 3D Croquet world, just from web browser (and vice versa).

    This image is the latest public released version of Croquet SDK (2007/08 year), which is synced with Hedgehog sources. Cobalt SDK is based on it also.

    ReplyDelete
  12. I recently tried to install my code from this modified Croquet image into the latest Pharo, which is still at Seasidse 2.8. I got a walkback with WAAdmin. I posted a question on this and was informed WAAdmin is in Seaside 3.0. Is 2.9 a development platform and 3.0 a release?

    Nikolay, do you plan to keep this web site (including "Script for loading Seaside 2.9[?]") updated?

    ---jski

    ReplyDelete
  13. Anonymous3:52 pm

    to buy [URL=http://jacket-dresses.net/]moncler sale[/URL] for gift tURyxPIw [URL=http://jacket-dresses.net/ ] http://jacket-dresses.net/ [/URL]

    ReplyDelete
  14. Anonymous8:15 pm

    purchase VfjEFtGA [URL=http://www.top--designer-brands.net/]faux coach handbags[/URL] and check coupon code available TrvSbbto [URL=http://www.top--designer-brands.net/ ] http://www.top--designer-brands.net/ [/URL]

    ReplyDelete
  15. Anonymous2:10 am

    sell eYaMjXDz [URL=http://www.hermes-birkinprice.weebly.com/]hermes outlet online[/URL] , just clicks away wUVMwxUU [URL=http://www.hermes-birkinprice.weebly.com/ ] http://www.hermes-birkinprice.weebly.com/ [/URL]

    ReplyDelete
  16. Coming Nike Air Max 2015 Shoes off a Super Bowl loss, the Carolina Panthers were about salary-cap discipline. General manager Dave Gettleman preached patience and measure. And when it came to making roster decisions – like letting All-Pro cornerback Josh Norman walk Nike Free Run away – everything was about the overall financial design. “You have to balance the needs of the team now with the needs of the team in cheap nfl jerseys a couple of years,” Gettleman told Yahoo Sports in June. “You have to plan. I’m very wholesale nfl jerseys methodical Nike Roshe Run and intentional about what I do [and] nfl jerseys store about the decisions we make. You have to be that NFL Jerseys way with the salary cap, because Nike Air Max 90 it’s going to cost you.”

    ReplyDelete
  17. Image masking, image manipulation, clipping path, shadow creation, photo editing, and color adjustments are only some of the services that we provide. automotive photo editing

    ReplyDelete