Friday, May 26, 2006

Fiddlesticks

I am a patient soul. One has to be if one wishes to appropriately instruct the Difference Engine. I am quite prepared to manipulate symbols for hours on end to make the forthcoming Caledon Tram operate consistently, and have done so already, for many, many hours. At the moment all that it lacks is smooth rotation at its turning points, which should be a simple task, even given that, as my fellow scripters will know, Quaternions are the Devil's Work and very easy to make mistakes with.

Something I am not prepared to put up with is the ridiculous frequency of unconnected problems whenever I require to test the latest version of the tram, freezing, slowing down, moving in reverse on occasion, or simply being thrown out of the universe and having to re-enter. I am sorry. As I said, I am a patient soul, but this is...

*marshals self, removes unladylike language*

...nonsense. One might as well try to build things in Rausch, where at least the random removals of oneself from the area have understandable reasons behind them, enthusiastically hostile fellow-travellers. Here, it is the blind universe that I am fighting and I do not like it.

Perhaps one should only be creating small, portable things, or ones which do not move around a lot.

Sunday, May 21, 2006

A Not Entirely Convincing Comparison

As per a suggestion by AngryBeth Shortbread, I have this morning been playing with an Engine-driven system that attempts to match one's features to the most appropriate star of stage or cinematograph. I have to say that I am not entirely convinced by the results; repeated use with various pictures resulted in the following being judged most similar and appearing most often, the more common on the left:

large headshot 2.jpg
Christina Ricci, for comparison
Christina
Ricci
Or possibly Rani Mukherjee
Rani
Mukherjee
Christy Turlington?
Christy
Turlington


I must say that one thing that I have never been told in Second Life is that I look like Christina Ricci, and I think it unlikely that I ever will. Still. Diverting.

Monday, May 15, 2006

Unphysical Tram-Pushery

Anyone walking the paths of Caledon on Sunday might well have been greeted by, first of all, the sight of myself perched upon a fair-sized tram; second of all, the sight of said tram repeatedly and awkwardly colliding with buildings and newspaper dispensing devices and rental payment machines as it attempted to turn ridiculously tight corners; and thirdly, my cursing the damned thing and the damned layout of Caledon and the bridges and everything under the simulated sun.

The construction of a reliable, vehicle-based transport system inside an existing landscape designed for people to walk around is simply not practical. Either one knocks down a number of houses, hopefully evicting the tenants beforehand - unlikely to be popular - or one uses vehicles which are not reliant on infrastructure (*ahem*, balloons, *ahem*) or one simply does not use vehicles.

Much as I vastly prefer having moving objects in Second Life being physical, the time does come when one must accept the limitations of physical objects and particularly vehicular physics. They hate travelling between sims, for a start, and routinely behave bizarrely. They frequently stop working inexplicably when asked or forced to sleep. They are easily knocked off-course, blocked by a simple plywood cube in their path or pushed around by vandals, and yes, even Caledon has experienced a number of attempts at vandalism - Port Caledon, I am told, was attacked by hundreds of beachballs on Saturday.

Simply put, physical objects are at the mercy of almost everything, and this is not something that makes for a good, regular, transit system. I certainly cannot be there at all times to put the things back in place myself, and whilst mechanisms for self-defence and self-correction can be scripted - my touring dirigible, for instance, corrects its own course and can easily survive a few unexpected bumps - they will never be perfectly satisfactory.

In contrast, a non-physical vehicle, one that is moved and rotated by a number of tiny calls to llSetPos and llSetRot, is almost impossible to vandalise, considerably more reliable and precise, and can effectively ignore the presence of obstacles (since it moves through them). Why are such things not used more often? Well, the last point really is also a flaw - a vehicle which moves through all solid objects is just not very believable, and also not terribly useful in environments possessing "fake ground" (prims textured to appear to be ground or rocks or suchlike).

Vehicles should not move through solid objects without a very good reason, and it is not practical to have them look for objects in front of them first, since it is currently impossible to detect the size of an object with a sensor. Say, for instance, I am standing in front of a wall. If I wish to detect its presence with a sensor I must first of all have the centre of the wall inside the arc in which I am detecting. Secondly, when llDetectedPos tells me the position of the wall, it will be the position of that centre. Which is frankly not a lot of use given as I have no way of finding out the extent of that wall. It could be one metre long, ten metres long, who can tell?

Really, LSL needs a function which takes two points and tells you what, if anything, is between them. Surely this would not be too difficult. I have simulated this using, ironically, physical objects - I have a "detector gun" which shoots out a projectile in a straight line that informs the firer of what it has hit - but I suspect that using that continuously to tell a vehicle whether it is on top of something or bumping into something is not practical. (Remaining on top of an object for instance I can see as particularly problematic; how can one fire a projectile downwards when there is no room so to do?)

Dear reader, I do understand that you are probably now most tired of these complaints of mine, and thus I will conclude this piece. Rather than continue to grapple with the production of a physics vehicle tram I shall be creating what I believe is known as a "proof of concept" design, illustrating that one moved non-physically can be both graceful and reliable, and in many cases nobody would ever notice the difference, particularly if a gentle push were involved should one happen into its path.

My balloons, however, will remain physical, as they are my own personal toys rather than the backbone of a public transportation system, and encounter fewer obstacles such as litter, pedestrians etc. Ducks, occasionally.

Sunday, May 14, 2006

Goo Fragmentation

In recent days I have modified the operation of the cannon of my Gun Balloon, to add effects that I find rather pleasing: there is now a two-stage particle effect upon impact, consisting of a brief yellow/red explosion and a longer-lasting plume of smoke, and more importantly, the shell itself produces shrapnel. A quick sensor call is used to determine whether there are avatars within three metres of the detonation point, and, if so, the shell launches a fragment directly at them at 20m/s (plus their detected velocity - there will be no escaping here!) If not, or if there are less than three avatars in the radius (likely) up to three fragments are ejected in random directions, biased towards the horizontal.

Thus, for instance, if nobody is around the point of detonation, three fragments will shoot out at random. If one person is within three metres, one will shoot at them, and two others in random directions. And so on. It would be nice not to have to rely on this sort of targetted fragmentation, but in practice one cannot easily simulate a blast wave and dozens if not hundreds of potentially lethal fragments exploding in all directions - thus three will have to serve.

Now, the scripting element here was influenced by the thread in the forums regarding a Grey Goo Fence. This construction has been put into place to counter the threat of self-replicating objects which threaten the integrity of the Grid, which I'm sure we would all agree is a laudable aim. In theory, any device rezzing objects at a rate of more than 40 per second - or rezzing objects which rez other objects and so on down the line - will find itself shut down for a period.

As a figure this does not seem too unreasonable, and given the rezzing procedure of each shot of the cannon:
  • one cannon shell
  • three fragments upon impact of shell
  • one empty cartridge
totalling five rezzes per shot, I decided on a rate of five rounds per second, meaning twenty-five rezzes, to be absolutely safe.

I have to say though that this has not turned out to be the case. The rate of fire is controlled by a timer in the cannon, which issues linked messages to subscripts whenever it fires whilst the trigger is being held. Thus it is possible to control the rate quite effectively. For any timer interval below 0.25 seconds - in other words, any rate of fire greater than 4 per second, or any rate of rezzing greater than 20 per second - one receives after a few seconds of sustained fire the ominous message:
grey goo fence: rapid or recursive rez
This is not as was advertised. I was concerned that the original version of the fence would hamper the operation of such creations as fractal trees, but really, if we are to have a fence at all, let it be set high. If I had not deliberately tested this I would be facing complaints from purchasers, I'm sure - even if one must fire for several seconds before encountering this message.

Tuesday, May 09, 2006

An era ends

Well, it has happened: I have finally divested myself of my mainland property. It was really getting to the point where maintaining two plots simultaneously was becoming an absolute chore.

I shall now be dwelling on the island of Caledon, though do by all means visit my old address to see what has been done with it. I have sold the land to my neighbour, aliarna Deladda, part of a very pleasant group of people whom I am certain will not be filling the place with horrible advertisements, but rather will put it to good use, which was a major concern of mine.

It does not seem too long ago that Ms Deladda first arrived in a plot of First Land right in the middle of my Theretra area, and I confess I was a little annoyed at the time, as I had been planning on taking over that plot myself. However, one must have manners, and she was (and remains) a perfectly reasonable person - there was certainly no rancour, and after an introductory chat I was perfectly happy. A degree of land-swapping took place after this, with which I was quite happy, maintaining a contiguous plot for myself and for the growing group to the side of me.

Eventually I decided that the time was right to remove myself from the mainland, where I had been since bought First Land, expanding and consolidating. Given my well-known objection to land spammery I was most concerned that the area would not become a burden to my neighbours, thus offered it to them for what I feel was a fair price. And today we have concluded the sale. That corner of Theretra is safe from spinning ad cubes. Good luck!

Permit me a little moment of nostalgia here. It has only been, what, less than six months, but in Second Life that is an awfully long time.

Sunday, May 07, 2006

Balloons, Diplomacy, Appeasement and Potted Meat

I have been informed several times in the last week that my Touring Dirigible in Caledon has been found in peculiar places. Some of these places are understandable - say, trapped in a tower which has grown somewhat since I last plotted the course - but some are frankly inexplicable. For instance: even given the vagaries of the physics engine, how could a dirigible find its way inside the top floor of the Academy, when it is actually too large to enter?

I suspect that some person has been taking pot-shots at my balloon. This is not a pastime that meets with my approval. I have therefore put into place further scripting which will enable me to locate any such culprit should this occur again (as well as raising the travelling height of the balloon somewhat).

Further on the subject of balloons, various of the landed gentry of Caledon seem to have become recently most interested in the practice of diplomacy, manifesting itself in the construction of gunboats. Whilst I am at heart a peaceful soul and wish no part in imperialist endeavours, I clearly cannot let such a craze go past without contributing in some small way, lest my reputation as a gunsmith suffer.

Gun balloon Gun balloon firing

Hence the Ordinal Gun Balloon, built around a giant cannon somewhat reminiscent of my Engine Rifle, though much larger. A most diplomatic device, I'm sure you will agree, though pedestrians should be aware that it is, well, almost impossible to actually hit anything smaller than a wildebeest, except perhaps by accident.

To be honest the building was largely inspired by my desire to build a vehicle that utilised Mouselook for its guidance. Whilst not in Mouselook, one controls the Gun Balloon fairly conventionally, rotating it, moving forwards and backwards and the like. Whilst in Mouselook, however, the balloon orientates itself to point in the direction that you are looking.

This is not a terribly complicated effect to achieve at heart, merely requiring the use of llSetVehicleFlags(VEHICLE_MOUSELOOK_STEER);. However, I was somewhat perplexed for a while as to how, precisely, to get this to work. The mistake that I was unknowingly making involved the angular motor. The Wiki is fairly clear on this, but I had, ahem, not actually read that section.

For the direct information of those reading though, the issue is that the value of the angular motor whilst VEHICLE_MOUSELOOK_STEER is active is not actually the value of the angular motor, as such. Instead, the angular motor is controlled entirely by the direction that the avatar is looking in and its difference from the vehicle's current forward X-axis - and the value of the angular motor is in fact a scaling factor for this. So, if one uses:

llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, <1.0, 1.0, 5.0>);

whilst Mouselook Steering is active, rotation about the vehicle's Z-axis will be five times more responsive than about other axes. Being the silly sausage that I am I was regularly setting the angular motor to zero, thus cancelling all of my piloting mouselookery completely.

~ * ~

The vital issue of suitable hats, though, has not been satisfactorily addressed in Caledon to my mind. One cannot have naval vessels, aerial or otherwise, without appropriate headgear, and, to be frank, epaulets are needed as well. Hats first, diplomacy later.

~ * ~

I am aware that I seem to be spending less and less time here writing on the subject of the actual mechanics of scripting. I am not precisely sure why that is, but to be frank, I suspect that it is because I am now past the stage where I am constantly encountering new functions within LSL of which I was not previously aware, and am now more at the stage where one wrangles with reality itself, using the functions as a tool with which hopefully to beat the laws of physics into submitting to one's will. Quite frequently, of course, the capricious spirits governing the natural sciences within Second Life merely laugh at the feeble attempts of mere mortals to achieve their goals, and there is little that one can do against their will.

I was wondering whether one could take a different approach to trying to beat them with Science, and instead try to appease them. Praying to their masters is sometimes effective but again, a slow process. I thought, for instance, that one might have a vehicle which, upon approaching the famously haunted borders between Sims, began a ritual chant and perhaps lit some incense. I am not quite sure what sacrifices the Spirits Of The Physics Engine really appreciate - they certainly seem to enjoy taking my balloons, so perhaps a set of smaller balloons could be launched to meet their approval.

I have found, on this subject, that when a dirigible is crossing these boundaries, if it slows down to a walking pace and begins to repeat a mantra, it is much less liable to being thrown into the centre of the Grid or otherwise discombobulated. (One cannot actually hear the mantra, but trust me, it is repeating it within its little scripted mind.)

~ * ~

I must mention finally the most appropriate movement by certain of those with Power in Second Life to remove the detritus that silts up the Events listings, sometimes involving the presence of a green and purple pony. I am not one to criticise potted meat, a fine invention, but really - it is appropriate for sailors, explorers, students, not lists of Events, where one should be able to find unique occurrences rather than simply folk playing baccarat or whatever it is people do all day in casinos.