Developer FAQs

From Croquet Consortium

Jump to: navigation, search

Contents

Why do Croquet classes begin with "T"?

Squeak does not have a package or module system. To avoid clashes, all Croquet classes begin with 'T' for TeaTime, which is the internal object model used by Croquet.

There is a graphics framework called Tweak, which uses 'C' to begin all of its classes. C stands for Costume. Weird, no?

In the long run, Croquet users aren't really supposed to see this stuff. And by the time large numbers of developers see it, Squeak should have a proper package/module system.

Is there a place to share legally shareable Croquet project code with the Croquet community?

Yes, there is a Public Contributions repository on the CroquetSource server at http://hedgehog.software.umn.edu:8888/PublicContribs Here is its description:

"A place for Croquet developers to put things. Items here have not been blessed for inclusion into the main distribution, use at your own risk. Code placed here must be made available under the Croquet license, and will be considered for inclusion in the main distribution."


Is there a place to share content such as legally shareable meshes, textures, and animation files with the Croquet community?

The Croquet Collaborative is a prototype of a self-service way for people to put that sort of content up for sharing.

How can I run external programs from within Croquet?

There are a couple of approaches to this depending on what you want to accomplish.

  1. If you want to bring up another application, such as a web browser, in its own window within the Croquet space, there is a working VNC client within Croquet which can be used to talk to a VNC server where the web browser can be run.
  2. If you are interested in calling C library functions from some external application, please refer to the Squeak Swiki and look for information about FFI and writing plugins for Squeak. This is currently at http://wiki.squeak.org/squeak/1414 . Squeak is the language environment that Croquet is implemented within.

Can I convert .3ds into .ase without using 3D Studio Max?

Yes. There is a class ThreeDSParser which can read 3ds files. IIRC it returns dictionaries describing the scene, from which you should be able to build a Croquet object.

Jasmine


How do I track when the avatar moves between TSpaces?

From the Developers mailing list:

How do you know if an avatar has entered a portal or left a portal? Can you subscribe to an event which gets broadcast when that happens? This seems like an easy thing to do but I'm just getting started with Croquet and I don't know how to do this....

There are two events, #spaceEnter and #spaceLeave, which are signaled in the object that is entering or leaving a space, presumably through a portal. Likewise, the space is notified per #objectEnter and #objectLeave of objects entering or leaving.

Use #startScript:when: to register an event handler, like in

mySpace startScript: #objectEntered: when: #objectEnter

For an example, see TeapotMorph>>makeSomeFish:target: which changes the avatar into a fish while in the underwater world.

Jasmine


How do I find the currently active TeapotMorph?

It is generally not good practice to do this, but if you absolutely must, the correct way is:

CroquetGlobals theTeapotMorph.

Jasmine


What is the normal orientation of the avatar and floor?

At initial entry to a default space, one's avatar is positioned at (0.0, 0.0, 0.0), looking in the negative Z axis direction, with positive X going to the right (relative to the viewport) and positive Y going up. The default "floor" is on the X-Z plane at a slightly negative Y value, usually about -5.0.


Why is this the normal orientation and use of axes?

The axes are aligned the way they are simply because it matches OpenGL - no other reason. Note that the reason the Z-buffer is so named is that in OpenGL - and most rendering engines, Z is into the screen, not up. It doesn't matter except that since we are using OpenGL and want people to utilize OpenGL documentation as easily as possible, we decided to match it.


What are some external 3D content creation tools?

See External 3D Tools.


How do I load a package from CroquetSource?

Read the sections Keeping Image Current and Developer_FAQs#Keeping_Image_Current to get the idea of how to work with the Monticello browser.


How do I load a package from SqueakMap?

I will use DualMaze as an example package because I'm fond of it. Try loading DualMaze from SqueakMap! It's fun to play with!

To load DualMaze, before starting any 3D space:

Method 1

  1. Click on an open spot somewhere on the Croquet desktop to get the World menu.
  2. Select "open..." to get the Open menu.
  3. Select "SqueakMap Package Loader". You have to be connected to the Internet while doing this as the Package Loader will download its index of packages from the SqueakMap web site. This might take a minute or two.
  4. Find DualMaze in the package list.
  5. Right click (for Windows) on it to get a context menu.
  6. Select "install" from the context menu.


Method 2

  1. Bring up your normal OS Web Browser outside of Croquet and go to http://map.squeak.org/packagesbyname
  2. Scroll down the list and find DualMaze, then drill down to its most recent release. There you will find a link to download the package.
  3. Click on the link for the package download and save it locally on your hard drive, for example in the C:download directory.
  4. Now bring up Croquet and click on an open spot somewhere on the Croquet desktop to get the World menu.
  5. Select "open..." to get the Open menu.
  6. Select "fileList" to get a local system file browser.
  7. Navigate to the C:download directory (or wherever you saved the package) and find the package file.
  8. Click on the package file in the fileList. In most cases, the menu at the top of the fileList will change to include an "install" button.
  9. Click the "install" button.


For Either Method

See also: http://wiki.squeak.org/squeak/2726

Many times loading a package will add a new item to the green Object catalog page that you probably use to start the normal Croquet spaces. In order to see the new item, you have to refresh the Croquet page of the Object catalog.

  • Click on the "Croquet" page selector in the upper part of the Object catalog to refresh it.

Why do I have problems when trying to load other Squeak code into Croquet?

There are several possibilties, but one of the more common ones is the change in the treatment of the underscore character. Squeak prints underscore (_) as an assignment arrow, and accepts both that character and := as the assignment operator. This doesn't always print well in text editors.

By default, Croquet does not allow this special treatment of underscore. This is controlled by a preference:

 Preferences enable: #allowUnderscoreAssignment.


Keeping Image Current

Is using Monticello the proper and preferred method to stay current, or is it one of a few available that happened to work for a certain set of updates?

Monticello is the preferred method of publishing updates/changes to the Croquet SDK, and the update method described here is what to use if you want to keep up with things as they develop. Think of the changes (particularly in the "contributions" and "public contributions" areas) as the development/unstable branch of the project. The movie showed you how to track those changes.


Does this mean that the Update Stream won't be used?

The Update Stream is useful to apply an update once (and only once) to a given image. Monticello has virtues like showing you diffs, and allowing you to go back to a previous version easily, but Monticello changesets need to be designed so that they can be applied more than once to an image. We'll probably only use the Update Stream to bundle together a big bunch of Monticello changesets for a major new release at some point. In other words, the Update Stream is there in case we need it, but Monticello is where the real action is.


Should I save this updated image replacing my normal image, or as a new version?

It is good practice to keep a couple versions around. One is a known good image and another is experimental.


Are there some updated Monticello packages that should not be part of my normal image?

  1. Croquet-Updates-mpm.1.mcz - is not needed by most people. It is just there for those who will create changesets for the update stream, but we almost never use the update stream, and only a few people create changesets for it, so ignore this.
  2. install.mcm - was there to create the base image (which you already have)
  3. Fdlibm-ar.5.mcz - I'm not sure what the status of this is.

Only packages from the four standard repositories, Homebase, Tweak, Hedgehog, and Contributions, should be saved in your normal image.


How do I recognize a conflict that occurs when updating packages through Monticello?

When you have selected a package to update and pressed the "merge" button, after some diffing another "Merging (packageName)" window normally comes up which lists the actual changes that will happen. If there is a conflict, the "merge" button in this new window will be ghosted out and there will be one or more changes listed that are bolded, which are the conflicting changes.


How do I resolve this kind of conflict?

Under normal circumstances using only official package updates, this should never happen. ;-) You may have done changes to the package locally. Sometimes this happens by accident. Try this: Click on the package name in the Monticello browser's left pane and on its standard repository in the right pane. Choose "changes" and see what that says. If it's not empty, then you have local changes. If it is empty and you still get the conflict warning then contact the Developer's Mailing List or enter a Bug Report.


Was a different way of updating used for the older Jasmine version of Croquet?

Yes, the Update Stream was used as the primary method.

Views
Personal tools