Thursday, June 08, 2006

A movement of place

Well, after my experiences with Yahoos I decided to invest in a more permanent and personal Aethernet Hosting Situation, and thus this journal can now be found at:

http://ordinalmalaprop.com/engine/

I have imported the full complement of posts from this location into the more sophisticated "Wordpress" engine present there, and thus I would advise that further Discussion and Linking should be carried out at the aforementioned "address". Posts here will remain of course, but I hope that the new environment should provide a far superior experience for visitors, with categories and suchlike.

The renting of said space also gives me the chance to experiment with such things as HTTP Requests, and it is on that subject that I am now to post, with a New Project in with which any reader may freely join!

Please note: my XML Feed has now been updated with the new location, and thus resubscription will not be necessary.

Wednesday, June 07, 2006

"She got the trams to run on time, mostly"

The Caledon Tram is now complete. Well, it is at least running, trundling the streets of Caledon, Caledon II and Port Caledon and occasionally stopping and tinging a little bell for folk to jump onto it. It is also operating, it seems, reliably, which is really rather important for public transport and something that I wish would be more appreciated by Transport Ministries in the Other World.

It has taken me some time to script this device, which perhaps it should not have, given its relative simplicity. The core of the tram is the same notecard reader which powers my balloons (the Touring Dirigible is still at the Lighthouse, incidentally) but the movement is, this time, nonphysical, as I believe I have mentioned before.

I recently discovered that there are people unaware of the difference, so, a quick description: physical movement involves physical objects, which must pass through intervening space, may collide with other objects, bounce off them, twist through the air and so on. One can set the physics flag on an object quite simply from the "edit" menu, and then grab said object and throw it about if you so desire, or use scripting functions to apply forces to it. Physical Non-physical movement involves nonphysical objects, like the majority of the scenery that you see around you in Second Life. These can be repositioned using the function llSetPos, and rotated with llSetRot. They do not react to the presence of other objects unless scripted to, which explains why, if one stands in front of the moving tram, one is not actually flattened by it but instead startled as it passes right through one's body.

The tram's linear motor is really a timer that triggers a number of subscripts via linked message, each one calling llSetPos to move it a tiny distance ahead, so that the overall effect is of relatively smooth movement... this is not actually as smooth as physical movement but in practice, not so bad. One peculiar quirk of nonphysical vehicles seems to be that, if someone is actually controlling them directly, they traverse SL in a manner far more smooth than if they are without a controlling avatar... however we do not really have the option of a permanent tram driver (perhaps, a profession for new residents in the future?)

The instructional notecard mostly contains a series of waypoints between which the tram moves, and its behaviour is predictable upon reaching each one:

1. read for the next waypoint;
2. find out its direction relative to the current position;
3. turn on the spot to face that direction;
4. repeatedly move forward a small fraction of that directional vector until reaching it.

The turning part gave me an appalling headache and the process exemplifies, I think, the simple principle "don't believe anything you tell yourself". The sub-process of turning can be laid out as follows:

1. which direction am I facing in now? (llRot2Fwd(llGetRot()));
2. which direction should I be facing in? (llVecNorm(targetPos - llGetPos()));
3. what is the angle between these two directions? (llAngleBetween(direction1, direction2));
4. if this angle is not within one turning increment, repeatedly rotate around the Z-axis by that increment in a suitable direction until it is;
5. do one final rotation to face the target.

Now, clearly if the destination is clockwise of the actual facing of the tram, one should turn clockwise, and similarly for anticlockwise, or the tram will spin around far too much and look daft. However, and here is the embarrassing bit, I had become convinced for some unknown reason that llAngleBetween would return a value greater than PI if one vector was to the left of the other. I have absolutely no idea how I decided that this was the case since it isn't, but I had taken that as one of my hypotheses and did not question it for ages, with the result that the tram rotated on the spot in an annoying fashion with me shouting "ARGH WHY ARE YOU DOING THIS YOU STUPID THING" when in fact it was I who was the stupid one. Let this be a lesson to you, dear reader - we are all idiots, particularly me.

The tram, however, regardless of script untidiness and possible improvements, is now running, and people have told me that they enjoy riding it and find it a most pleasant addition to Caledon and that makes it all worthwhile. (I have been invited to possibly develop a similar system for Second Life's Third Birthday Celebrations, so it may reach a wider audience.)

~ * ~


Whilst I did script the tram, the actual building and texturing work was done by those master craftsmen Reitsuki Kojima and Shaunathan Sprocket, and it is they who one needs to thank for its elegant two-wheeled steam-powered design. Scripts are nothing without an actual tram to put them in and those gentlemen deserve the lion's share of praise. If it were left up to me doubtless the trolley would be a box with rivets on it, and nobody would think it pleasant to ride at all.

~ * ~


Those of you hoping for a view of my Stretched Metaphor may have to wait for a little while, as I have become distracted, but I can tell you that it involved eggs.

Thursday, June 01, 2006

Disappearances and Inconsistencies

The Aethernet company "Yahoo!" have apparently closed my account with their "GeoCities" service, on which I was storing certain script files referred to in this journal.

Despite my annoyance I know better than to try to argue with an enormous corporation based on another continent with undoubtedly no interest in my affairs whatsoever, and thus I will be looking for alternative storage of some sort. In the meantime, cached versions of these scripts can be found through the services of another enormous corporation based on another continent with undoubtedly no interest etc:I have also been informed that this journal is of Most Peculiar Appearance when viewed with a peculiar, antique Aethernet Browsing Device known as "Internet Explorer". Imagine my surprise upon discovering that this malfunctioning gadget is actually amazingly popular! I cannot for the life of me see why it is that this "i.e." (as I'm told it is abbreviated) refuses to correctly draft my writings, but clearly something must be done, thus I have changed the journal's appearance temporarily until such time as I know what the necessary modifications might be.

I regret boring you, dear reader, with these mundanities but I feel that notice needs to be given. I shall however be boring you with relative non-mundanities forthwith. Hamlet Au's latest post regarding Laukosargas Svarog's virtual ecology has reminded me of a few further developments of my own humble system of more technological ecology which I have been mulling over, and feel that the time is right to now mull more publicly. Be warned that the piece contains possibly the most strained metaphor ever attempted.