Lights, Camera …

So, bored with the flat, uniform lighting and wanting to get a little moody, I set about first investigating lighting.

The “world” settings can vastly effect the mood of a place – the “ambient light” [general, non-directional ambiance] and “directional light” [that coming straight from the “sun”] can be bright and cheery, dark and dank and everything in-between.  You control the “colour” of the light and therefore the intensity/luminosity by the density of colours you choose – all very nice. I am wondering if an admin “bot” might not be able to programatically change these settings, I should think this would then give us night/day as the bot could do this change gradually, using world time. Anyways, i dimmed the settings on Q2 a little, so it was not quite so sunny and cheery …

As it turns out, most things can contain a “light”, so I went for some rock’n’roll lighting with part of Wonkyhenge to create a myriad of reflections and other cheesy fx and the result ..

Lighting effects combined

Lighting effects combined

..was actually quite satisfactory. There are LOTS of things that can be varied about each light source [note to self – the light source does not actually illuminate ITSELF – each of the rocks in this part of Wonkyhenge is a light source – you see the colour from other rocks, if that makes sense]. There are “point” lights [like a bare incandescent bulb that spreads outwards from that point] and “spot” lights that shoot out a cone of directed light [you specify the direction, intensity, cone dynamics etc] – both nice. Obvious controls exist for colour [using named values or hex html refs, so 16.7 million shades might just be enough; note to self: kids will learn to spoll colour wrongly because for it to work in script, it must be spolled color – *shakes fists at Americans*], brightness [ intensity] and radius [spread].

A rather nice collection of fx exist for lights as well – blink, fadein/out, fire [a lovely faux flame flicker], flicker [like a fluoro tube going bung], flash [like lightning] and pulse [a rhythmic throbbing] – most fx have a time parameter to control the rapidity of them also, again, very nice. I can see lots of applications here [particularly when I get around to discovering fire in rockshop.

It seems most typed of objects can also be defined as a “camera”.

camera position and controller

camera position and controller

…so what I did, after an idea I saw in the Activeworlds Forum was define an object, set it rotating [to be my camera] and then defined a clickable somewhere else that would switch the user’s view to that camera object [in effect, creating a “guided tour” that followed the animation of the object].

Camera:  create name wonkycam, visible yes, solid no, rotate 2 time=8 loop
Remote: activate camera location=wonkycam

meaning, the “camera” object is rotating at 2rpm, for 8 seconds, then returning to it’s original position in 8 seconds and repeating that. The “remote” transfers the user who clicked on it’s vision to the camera object, so you see what the object pans past  – nice

Walk-throughs and guided tours are possible using this trick [note to self, explore animation and path-controlled movement more], as is “remote sensing” of far-away places without actually leaving the comfort of your current location – very useful. Lots more to explore, will keep banging the rocks together.

Forums and some telly

…so I was at a loose end, nothing on the telly so I thought I would make my own television – and a wide-screen slate-based [continuing the rock-based theme] telly in Wonkyhenge seemed like a good idea.

An In-World Telly

An In-World Telly

Lacking anything interesting to watch, I turned the “picture” property of a ‘picture type’ object [they have a mystical tag value of 200, not yet sure what that means yet as ‘sign’ objects have a tag 100 – think it is a tie in to custom code underneath that allows you to use certain commands and not others] to point to a “live webcam” of southbank. This webcam dumps pictures into the same place, so the filename stays the same, just gets overwritten every 30 seconds or so.

create picture url update=t
eg: create picture http://www.ourbrisbane.com/files/weatherdata/sbimage.jpg update=30

…very nice – now the virtual world has a portal to the real world. Yeah, I know the screengrab has a mostly dark image, but it was late, not a lot happens in Brisbane at night 😛

Seems the “picture” command is intended to allow people to bring in images they have uploaded somewhere else – shame there is no “uploader” or user files upload area for the user to upload their content, although I suppose you could use any of the cloud tools [flickr, yfrog …] so long as the URL points to a JPG file – apparently the only one supported for this parameter. One would think it should also work with ani.gifs, swfs, flvs, pngs and other modern file extensions – the content is well understood by most other platforms … still. I am assuming there must be another way to get such content in-world because I have seen it in other Activeworlds, so I have some more research ahead of me.

It seemed like I got little done tonight, but spent a whole bunch of time trolling through the AWForums, there is a richness [and familiarity that I am gradually gaining], particularly in command syntax and options that is lacking in the Activeworlds help pages … must try and find a more complete reference as it is annoying only being able to get at some of the commands and a small collection of the parameters – can anyone help here? [is anyone actually reading this junk?]

I also got a bunch of code snippets to try and some valuable advice on creating custom objects and placing them in the world object path.

I also stumbled across a web-catalogue of objects that someone had compiled of in-world objects for their world – it has categories, was searchable and contained thumbnails of many of the standard objects as well as their customs – this is great news as I can see this idea works although some of the seasoned builders in that world still preferred to wander object yards shopping for things. Maybe an amalgam of approaches is best?

Their web catalogue was an external “fan” site, but I see no reason why it cannot be used in-word using the integrated browser. There are a bunch of undocumented but interesting commands for having the integrated browser interact with in-world named objects [well, initially remotely activating and teleporting, but I am sure there are more options, I just cannot find them] … this has great potential. I am sure, for example, I saw a chat pot that could be talked to or interacted with via “links” in the accompanying browser page when last in Quest Atlantis … must investigate further.

Ready to Rok

So I was determined to play around with sound in-world…

A Real Rock Band

A Real Rock Band

and built a rock-based apparatus [this is, after all, Rockshop 101 in da Henge, man] and experimented with the “noise” command and the “sound” command which, on external appearances seem quite similar.

Both trigger samples [wav, midi or mp3], but in different ways.

Using “noise”, you can trigger it, by activating an object, say, [clicking on it] – you can wait until it finishes playing before you click on it again, or you can use an “overlap” parameter to let many concurrent noises [including multiple copies of the same one] play until they finish. In no time a wonderful cacophony results from overlapping samples.

So … I embedded the following script in one rock:

activate noise http://www.wonko.info/wOnKoBUZZ/samplesRus/percussion/drums/bigconga1.wav overlap

then chose other sounds [from my own online sample collection] for the other rocks, and a nice long sample for the big rock. I even did a dodgy flash capture [the sound quality is a bit mashed]: RokandRoll Flash Capture

The SOUND command is a bit different – there can only ONE sound playing for each citizen, that sound comes from the sound-enabled object closest to you. Nicely, that sound is “spatial” in that it appears to come from the direction the object emitting the sound it which is nice. You can LOOP but I have yet to work out how to programatically STOP the noise [I can go to the menu system and stop it there, but I am sure there must be a command that lets me do this].

I changed the “activate” script for the big rock to:

activate sound http://www.wonko.info/UoD/objects/aural/UoD8.mp3 noloop

and now when you click it is directional – as you walk around, it moves in the stereo picture [left to right], not yet sure of the range though I notice that the volume increases as you get closer and diminishes when you move away – nice for creating ambient noises and atmosphere, although I suspect it impacts a little on the bandwidth as the sound downloads before it starts playing [unlike other technologies that can stream it as it arrives].

The sound/noise can be from any accessible URL – I am hoping the new proposed “Mytunes” upload and share thingy that The Learning Place are developing will have sufficiently exposed URLs of the sounds stored in it so that we can link to them in-world – that way juke-boxes and other interactive sound-art is possible.

Imagine, building a sculpture and linking it to hand-made noises – audio performance art harnesses a number of intelligences [and is a lot of fun]. More practically, things like buttons [that need to sound like they have been pressed], doors that creak as they open, water splashing as it falls and so on are now all possible – this is a good thing if we are to create a sense of place and immersion.

Rockshop 101

One of my favourite authors of all times, Douglas Adams, once coined an expression encapsulating the basis of evolution – he said “The secret is to keep banging the rocks together guys”.

I love this sentiment – chipping away at stuff that is not clear to seek clarity; being accurate to seek accuracy … thank goodness my brain is still accommodating enough to let me learn new stuff. So I delve [all be it tentatively] into the murky depths of object scripting for the first time …

wonko-henge, rockshop 101

wonko-henge, rockshop 101

So I needed a workshop, and found a collection of rocks in the standard object bin, so decided to partially construct WonkyHenge so I could sacrifice things in the name of the new deity – knowledge.

My mission was to begin to explore object scripting, because that is where the smarts of an interactive environment will lie. Deftly I delved into the object properties and in minutes was scaling objects in X, Y and Z, easy peasy.

To something new…

Actions are applied in the object properties

Actions are applied in the object properties

There are a number of things an object can “detect” – events for those of you familiar with event-drive, object oriented programming. The “Create” event is useful – you can tell the object to do stuff when it is first rezzed [encountered] by a player – useful for size, initial appearance etc. Scripts can be “stacked inside the action field

command; command; command      or

command part, other part, other part; command part, other part  etc.

Annoyingly, a de-bugger is NOT present, so if there is even ONE error in the script, none of it works and you get NO error message, no on-screen display [and oddly sometimes your object even disappears into an unreachable place], nothing except a non-working object [if you are lucky]. From a noob perspective this is fine because you do not get beaten up as normal programming/scripting languages do with pages of indecipherable error codes … but, some feed back would be nice.

programmed movement - translation in 2 axes - doors etc

programmed movement - translation in 2 axes - doors etc

When an object is “Activated” [left clicked on], it knows – you can get it to do stuff when it detects such a click – very useful. The first thing I tried was the “move” command.

activate move -2 2 0 noloop time=5 wait=3

= when clicked on, move backwards 2m in the x direction, up 2 m in the y direction and do not change your z position, do this thing once, take 5 seconds to do it, wait 3 seconds before un-doing it.

Nice,  slidey-door [think star trek, and an accompanying and very satisfying “wooshing” sound] sorted. Automatically translating objects is nice, fairly easy to control and it can be done on create or triggered by a click also.

A programmed rotation "onclick"

A programmed rotation "onclick"

Translation is not that dissimilar in concept to rotation, except the controls that Activeworlds use are a little interesting [different from what I was expecting, but manageable]

activate rotate 0 0 5 time=3 noloop wait=3 smooth

= on click, rotate at 5 rpm on the z-axis, do not keep repeating this, rotate for a total time of 3 seconds, smoothly, wait 3 seconds before un-doing the movement at the same speed. Easy – the opening door thing sorted. Just gotta learn how to move the axis of rotation – some objects have their axes plumb centre and so a door that has a “hinge” in the middle is a little odd.

objects that "know" other objects and communicate

objects that "know" other objects and communicate

Objects, on create, can be named – this name can be used programatically. In the above rockshop experiment, I spawned a big rock and called it “fred” – conveniently I could call other things “fred” as well – the name does NOT have to be unique in the collection of things that I create. Also usefully, a thing called “fred” that I make is DIFFERENT to a thing called “fred” that some one else makes – this is a good thing as side-effects caused by scripts someone else wrote using names you did not were already taken would be really really annoying but more importantly, very difficult to debug.

I then made 2 other rocks, and programmed them to reach out to things called “fred” and change their appearance:

activate color name=fred red

= when you are clicked on, look for objects owned by this citizen that are called “fred” and apply a red texture to them.

I rinsed and repeated to make a blue one, and added into “fred” an activate command that re-applied “granite” as a texture to it when you clicked on “fred”, itself so you can do a colour cycle and return to the base state if you wanted.

That objects can be aware and effect others is a terrific discovery [well, I say discovery, because it was for me, I know accomplished Activeworlds builders will be wondering what this dweeb is lathering on about].

I had convinced myself that the land of scripting must be pained and difficult, so was avoiding it. Having some success and more importantly finally getting what is happening, I am now eager to beaver away in the rock shop to see what else the world can let me do

I can see you quiver with antici …[wait for it] … pation…

Terraforming

I spent some time exploring the land grid and played with “terraforming” to see how the mechanic works.

The “World” is composed of a Terrain which is controlled by a grid. Each grid segment has an elevation [controlled by a point in the corner], a texture [and the texture’s corresponding rotation]. Placed on the terrain are objects … basic model, works well.

Terrain geometry is “angular” in that when you elevate a grid cell, the edges of that cell form ridges with adjacent un-raised terrain. Let me illustrate:

Terraforming

Terraforming - Raising a landmass

As you elevate a grid section, the surrounding terrain distorts in a fairly controlled way, you can then pick a texture [still trying to source the catalogue of such textures, do not like the “trial and error” search technique nor the slight changes in shading between batches that accentuate the seams] and then, using the PgUp/PgDn keys rotate it in increments of 90°  – this is nice but assume the way the textures are applied to terrain blocks smaller rotation increments are not possible. I have not found a way of picking LOTS of cells and adjusting them all at once, but assume you can. I have discovered you can COPY a cell and PASTE the elevation and texture settings separately – very handy for lots of tiling.

With only a little fiddling it is possible to raise mountain ranges, fairly nice crenulations and so on from the ground plain. The MACRO view is nice, flying above the scenery [in much the same way I do in 2l or OpenSim] works best. There seems to be an acceptable collection of terrain textures, including modular sections forming edges, roads and paths.

I have seen in other worlds, soaring mountains and other geographical features so assume it must be possible to either use built-in “rocks” [scaled appropriated and “sunk” into the terrain] and the like to compliment the deformed terrain, or there must be another trick. I am hoping that importing geometry created elsewhere would allow geographic features also – that way so long as the textures are right, some naturalistic outcrops, indentations and other stickey-outey bits would be possible. Not sure, however, what the clearances needs to be in gaps and undulations so as not to trap the avatar – might be a bit tricksey if you get caught in the scenery whilst trying to traverse it.

Walking across this terrain is much more controlled than in 2L [and in OpenSIM it is often downright dangerous to walk across undulating ground as you trip and fall constantly] – the avatar does not “flail” or fall as the terrain in an activeworld is much less “organic” because the deformation techniques are much more granular. I do not think this is a problem or a limitation, necessarily.

Lowering terrain below 0m and you intersect with the WATER PLAIN which appears to be [by default anyways] 1m below the surface. Time to put in a POOL:

Putting in a Pool

Putting in a Pool

Default water is an almost invisible miasma but it fills depressions faithfully. By tweaking the opacity, surface turbulence, wave motion and visibility settings, a convincing puddle or an oceanic expanse is possible – I created quite a “storm in my teacup”, literally whilst playing with the world settings. I quite liked the “tidal” movements but on small water masses they look silly. There must be additional “water” objects that can be used to fill containers, fountains etc. above the water table, because I have seen them in other worlds. Although the above “pool” is quite angular, the grid size would make larger such puddles look much better.

Oddly, you can, in a quite messianic way, walk ON the water if you are looking UP or LEVEL whilst walking. I thought I had broken something when first configuring the world water settings until I tried it with my gaze down slightly. Putting your head down a little [PgDn whilst looking ahead] and then walking INTO the water mass you have a nice sense of entering the water:

Exploring water

Exploring water: surface and sub-surface

By changing the visibility settings [ie, how “murky”], colour and opacity, the combined effects [when taking into account World ambient lighting settings, fog, atmosphere and sun/s position] can be lovely and atmospheric. I went for an over-chlorinated feel and am not unhappy with the results. Like 2L, there are NO health penalties for being underwater, so it is entirely feasible to have water-based worlds where all the action is under the surface – this is great news. Pretty sure however that hollow objects [like a diving bell, for instance, if below the water table, would also be filled with water – must check to see if there is a work around – a sub-oceanic bubble city could be fun. Global water settings effect ALL water in that world, so there must be ways of making local water effects, as I might want to go from a quick dip in the ocean to a slow crawl through a tar pit.

Gravity settings in water and out do not have to be the same, so it is entirely feasible to create varying degrees of buoyancy, weightlessness and so on that would accompany the sensation of swimming through something that you can control the viscosity of. This is also nice.

I placed an object [yes, I know, it is a sofa, but hey, I wanted somewhere comfy to sit] under water and again, depending on the settings you can see it more or less above the surface. The visibility settings seem to work well even if there is an “odd” surface/subsurface transition as the client switches views where it appears as though everything is clear [ie. the water completely disappears for an instant] – I cannot manage to stop at that position so it is fine, just curious.

I can see me, with graph paper in hand, making quite complex terrains – a little planning and a fairly small space could be quite interesting to explore – still to find out the dimensions of each terrain grid, and the number of them you get in a world, but that is just research, so all good.
(more…)

« Previous PageNext Page »