Wednesday, January 23, 2008

How To Set Up VNC in a Croquet World

Introduction

I have witnessed quite a few folks asking how they can get VNC running within a Croquet world. Thanks to the excellent KCroquetParticipant subclass, getting VNC up and running within a Croquet world is a fairly easy task. However, to date, nobody has provided a reasonable explanation for non-technical users to perform this task. This tutorial will instruct you on how to do just this.

An explanation of what VNC is and why it is useful is beyond the scope of this tutorial. For more information on VNC, a good starting point is at the Wikipedia entry for VNC.

Learning Outcomes

Upon completion of this tutorial, you will be able to run a VNC server on a host computer, and connect to that VNC server from within a Croquet world.

Prerequisites

In order to complete this tutorial, you will need the following software:

1. REQUIRED: A VNC server. Below are some options that are free of cost:
2. REQUIRED: A second computer on which to run the VNC server. Although it is possible to run a VNC server and client on the same machine, the technical details involved in such a task are beyond the scope of this tutorial.

3. RECOMMENDED: The latest build of the Croquet SDK, available here.

Step by Step Guide

Mac OS X was used to create this tutorial. Much of the information herein should be readily transferable to other operating environments; however, your results may vary.

Part 1: Steps for VNC server computer

1. Open your VNC server software and configure it (in this case, we are using Vine Server).
The important values to note are:
  • IP Address
  • Display Number
  • Port
  • Password
Write these values down so that you can reference them later.
Note the values outlined in red, as
you will need them when you are
configuring the VNC client in Croquet.


2. Start the VNC server software

Select "Start Server" in Vine Server's connection
dialogue to start the server

You should be provided with some system feedback indicating that the server is running.

The Server Running message indicates that the VNC server
is indeed running.

The VNC server computer is now hosting a VNC session. We will connect to this VNC session from within Croquet in the next section.

Part 2: Steps for Croquet Computer

1. Launch Croquet and open the KAT Demo (this is the KCroquetParticipant subclass)

Locate the KAT Demo in the Objects browser.

Drag the KAT Demo icon from the Objects browser into the Squeak
project space (click image to enlarge).


You are presented with the above dialogue. Select "Cancel."

After a few moments of loading, you are presented with
the above Croquet world (click to enlarge).


2. Configure and start VNC from within the Croquet world.

2.1 From the menu, select "Admin-->New raw RFB"


2.2. Enter the IP address of your VNC server, followed by a colon, followed by the port number that the VNC server is running on. Then select "OK.
"
The structure of the VNC server's address should be the server's IP, followed by the server port.

2.3. Enter the VNC display number; then select "OK."


2.4. Enter the password; then select "OK."


2.5. You should be presented with a Croquet window showing the desktop of the computer on which you are running a VNC server.


You may want to spend some time playing with Croquet's VNC implementation, as it does have some quirks.

Congratulations! You've gotten VNC to work in a Croquet world.

Demo

Here is a video demonstrating VNC being used in a Croquet world.










Summary


In this tutorial, you learned how to start and configure a VNC server on one computer, and how to access that VNC server from within a Croquet world that is running on a separate computer.

1 comment:

  1. The croquet documentation does indeed suck and there is a desperate need for better tutorials.

    So, Thank you! and keep up the good work!

    I'd like to see some tutorials on making certain
    OpenGL objects in Croquet. The tutorials in
    the 'programming croquet' section
    help but are by no means easy to follow, especially not for people new to Croquet.

    I'd also like to see more on physics... can we make our avatar throw chairs? How about a bouncing ball? As a C++ programmer I was thinking about just exporting some classes of the Newton c++ library to squeak, but there are maybe already physics classes within croquet. Who knows, I sure can't find the documentation. And browsing through the packages in the package manager only goes so far... We NEED tutorials we NEED documentation.

    .. AND we NEED a community! Why is there no forum on the main croquet page? why is there only 2 mailing lists? why is there only a virtually empty/dead irc channel on freenode...

    :)

    Your efforts are SOOOoo needed and very appreciated! keep it up!

    ReplyDelete