just another web log

30 Oct 2021:
quick watching update
I have watched a number of films in the cinema this month.

Ron's gone wrong - Very funny and highly recommended
Dune (part 1) - hmmm missing a lot, very long, but also show promise. Friends who had not seen the original loved it
Boss baby 2 - OK, nothing special
Free guy - very funny, clever and highly recommended
Venom 2 - Loved it! they really upped the comedy levels from the first one


Infinites - Good special effects, but unwatchably all over the place
Bad Batch Season 1 - Good, bad and a little ugly. Interested in what season 2 can bring to the table.
30 Oct 2021:
a short investigation into vr reference graffiti

I wanted to use reference images in Kingspray Graffiti VR, so I grabbed some random images and put them in the right folder just to test it out.


And one of the two showed up.

At the time I thought it was the fact that the one that worked was landscape and fitted in the mini screen in the game and the other was portrait ... fun fact, that wasn't the reason.

I now knew that reference images do work (at least sometimes).

Original tests:
No. Image resolution filename file type file size
7 ksGVR_ref_007 991x1110 Capture everest cert.jpg JPG 97K
8 ksGVR_ref_008 1071x472 Annotation 2020-07-12 233540bp.png PNG 129K

No. 6 did not show in the game No. 8 did.

I have this cool cartoony stormtrooper T-shirt and I wanted to try painting that.

But dumping the a photo onto the quest didn't work :(

So I tried all these variations
No. Image resolution filename file type file size
1 ksGVR_ref_001 1071x472 Tnnotation 2020-07-12 233540bp.png PNG 692K
2 ksGVR_ref_002 2184x1444 Graffiti Reference from Storm trooper T-shirt 1024.png PNG 1.3M
3 ksGVR_ref_003 2184x1444 Graffiti Reference from Storm trooper T-shirt 1024.jpg JPG 242K
4 ksGVR_ref_004 1024x677 Graffiti Reference from Storm trooper T-shirt.png PNG 4.6M
5 ksGVR_ref_005 1024x677 Graffiti Reference from Storm trooper T-shirt.jpg JPG 924K
6 ksGVR_ref_006 991x1110 Capture everest cert.png PNG 613K
7 ksGVR_ref_007 991x1110 Capture everest cert.jpg JPG 97K
8 ksGVR_ref_008 1071x472 Annotation 2020-07-12 233540bp.png PNG 129K

and these are the only ones that work
No. Image resolution filename file type file size
3 ksGVR_ref_003 2184x1444 Graffiti Reference from Storm trooper T-shirt 1024.jpg JPG 242K
7 ksGVR_ref_007 991x1110 Capture everest cert.jpg JPG 97K
8 ksGVR_ref_008 1071x472 Annotation 2020-07-12 233540bp.png PNG 129K

which tells us that

Image Type: Not an issue, both JPG and PNG are in the working set
Resolution: Not an issue, multiple examples of the same resolution in the working and non-working set.
Layout: Not an issue, both landscape and portrait are in the working set
File Size: Might be an issue. All files out side the working set are larger than the largest within the working set.
Aspect Ratio: Not an issue, multiple examples of the same resolution in the working and non-working set.
Filename: Not an issue, spaces and other non-alphanumeric characters in both the working and non-working set.
Filename length: also not an issue.

I am especially annoyed that No. 1 did not work. As it is the T-shirt image scaled down and pasted onto the WORKING No. 8 !

file *nnotation*.png
Annotation 2020-07-12 233540bp.png: PNG image data, 1071 x 472, 8-bit/color RGBA, non-interlaced
Tnnotation 2020-07-12 233540bp.png: PNG image data, 1071 x 472, 8-bit/color RGBA, non-interlaced

Which leaves me with ...

Maybe it's the file size? But it seems unlikely.

More testing is required. It's a right pain to hook the Oculus Quest 2 up to a PC. Have to find the right cable and then allow file permissions from inside the headset and then dig around for the right folders.

... later that day ...

Right so I created a test image by taking the Stormtrooper T-shirt photo and adding random noise. This meant that even as a JPG I caused the file size to be over a Megabyte.
Then I created and labelled 10 more images. Each being saved from GIMP with a different compression quality. As quality reduced so did file size.

The files 509K and over did not appear in the game.

The remaining files that were 413K or less did appear!

The images do appear quite small in the game, so they do not need to be high quality. Still a pity that there is no documentation for Quest 2 version.
30 Oct 2021:
vr mist myst and the impossible puzzle
Myst was an early COATROOM game in the same vein as 7th Guest. Oculus had a sale on the VR version and I thought it would a be a fun trip into nostalgia land.

But it turns out that although I had played a lot of CD ROM graphical puzzle games from the era (including 7th Guest), I had never completed or even played Myst.

It is a great fit for the Oculus Quest 2 and the VR in general. Nice environments, 3D sound and genuinely interesting puzzles.

But I want to concentrate on one puzzle that had me stumped.

I had come across a key, in the form of a time and three digit value. Which was what I was looking for.

vr screen capture Myst key

The time unlocked the clock tower and led to a set of gears with three levers.

VR screen capture Myst whole puzzle

The two main levers rotated the gears

VR screen capture Myst levers

These gears, when rotated to the correct value unlocked the next puzzle.

VR screen capture Myst gears

They started at 3,3,3 and the key stated they need to be set to 2,2,1

VR screen capture Myst gears close

But how to set the values correctly for three gears and only two levers?

Lever 1 rotated the top two gears and Lever 2 rotated the bottom two gears. Which meant the middle gear was rotated whatever move you made. Lever 3 reset the puzzle and was required as there was a maximum number of moves before the mechanism seized.

I tried a number of different move combinations before I gave up and went onto something else.

When I came back I tried again and failed.

But then I remembered the moto "If in doubt cheat!".

So I wrote myself a quick README file

Quick Python3 project to solve the Myst (VR) puzzle with convoluted gears

There are three levers and three combination gears.

Lever 1 rotates CW both the 1st and 2nd gears
Lever 2 rotates CW both the 2nd and 3rd gears
Lever 3 resets the gears

Numbers 1,2,3 are repeated on each gear.

The goal is 2,2,1 and the initial state is 3,3,3

Notice the reference to "Quick" ...

The code was relatively straightforward and appeared to work

# Python3 Myst gear puzzle brute force solver
import copy

# Create the gears as gear objects containing the right number of values repeating
def create_gears(values, number):
    result = { "Gears" : [] }
    for i in range(3):
        result["Gears"].append({"Gear":[]} )
        for n in range(number):
    return result

# Rotate a single gear
def rotate_gear(gear_id, gears):
    if gears is None: return None
    self_gears = copy.deepcopy(gears)
    if len(self_gears["Gears"][gear_id]["Gear"]) < 1: return None
    self_gears["Gears"][gear_id]["Gear"] = self_gears["Gears"][gear_id]["Gear"][1:]
    return self_gears

# operate a lever
def op_lever(lever, gears, l1 = '1'):
    self_gears = copy.deepcopy(gears)
    self_gears = rotate_gear(1, self_gears)
    if (lever == l1):
        self_gears = rotate_gear(0, self_gears)
        self_gears = rotate_gear(2, self_gears)
    return self_gears

# convert an int into binary and use that pattern for the levers
# returns success if target found or None
def process_levers(lever_codes, target, l1 = '1'):
    gears = create_gears([3,1,2], 3) # these values match the game
    length_bin = len(bin(lever_codes)[2:])
    result = False
    print("Working through bit pattern [{}]".format(bin(lever_codes)))
    for i in range(length_bin):
        gears = op_lever(bin(lever_codes)[i+2:i+3], gears, l1)
        result = compare_state_to_target(gears, target)
    return result

# compare the current state of the gears to the target value
def compare_state_to_target(state, target):
    result = True
    for i in range(3):
        if result and len(state["Gears"][i]["Gear"]) > 0:
            result = state["Gears"][i]["Gear"][0] == target[i]
            result = False
    return result

# kickstart
def main():
    max = 1000000
    i = 256 # 9 bits starting with a 1 (remember we do this again where the levers are reversed)
    result = False
    target = [2, 1, 1]
    while not result and i < max and len(bin(i)) < 10+2:
        result = process_levers(i, target)
        i += 1
    print("Terminated with {} at {}".format(result, i))
    if not result:
        i = 256
        while not result and i < max and len(bin(i)) < 10+2:
            result = process_levers(i, target, '0')
            i += 1
        print("X-Terminated with {} at {}".format(result, i))

if __name__ == '__main__':

It passed all my tests, but the solution was not forthcoming!

Gobsmacked with my own ineptitude, I resulted to Googling the solution...

And to my surprise I find the first result is the mathematical proof that the puzzle is unsolvable without "cheating" the next few results are people complaining there is no solution!

At least I am not alone :D

So what is going on?

Well, Lever 3 (the reset one) is a pull and release and that is all, but the other two levers have a sneaky side hustle in doing something different if YOU DON'T LET GO!

and once you know that the puzzle is really easy.
30 Oct 2021:
godot and the hands of vr
Godot notes for importing from Blender

Make sure you rename all you materials or get rid of name clashes.

Export gLTF .glb(binary) only option to change was - Include/Selected objects

Now this where things get tricky. Or, more to the point, unexpected.

Make sure you have added a folder called "imports" (you can name it anything, but imports makes sense) and then another one called "assets". Both in the root of the project.

Now open an OS file browser and navigate to the new "imports" folder. Copy in the .glb file into the "imports" folder.

Go back to Godot and click on the (currently empty) "imports" folder and Godot will import the file.

That completes STAGE 1

Now click on the .glb file in the "imports" folder in Godot and click the button "Open Anyway".
From the "File" menu "Save Scene As" and save it into your "assets" folder.
This creates a new ".tscn" file.

That completes STAGE 2

In your new scene (will be in a new tab at the top) click the Mesh under the scene root.
On the far right hand side there will be a mini thumbnail, click that and select "Save" and save it into your "assets" folder.
This creates a new ".tres" file.

That completes STAGE 3

Now when ever you need a mesh you can click on that same mini thumbnail and click "Load" and select your ".tres" mesh.

This actually makes a lot of sense if you break it down.

Stage 1 imports the raw gLTF. But it cannot be edited or used in its current state.
Stage 2 saves your scene as a ".tscn" file that can contain anything a Godot scene can hold (i.e. and entire application)
Stage 3 saves out the individual mesh as a ".tres" file that you can use as a single mesh.

Here we have a 3D scene with mesh objects from Blender after following the process above.

godot example mesh imports

30 Oct 2021:
wsl2 defeated
Right, after all that mucking about with WSL version 2 I decided to go back to version 1...

wsl --set-version Ubuntu-20.04 1

!%* !! You need to enable Hyper-v just to run the conversion routine :(

So I had to run
DISM /Online /Enable-Feature:VirtualMachinePlatform
PowerShell Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -All


then run
wsl --set-version Ubuntu-20.04 1

which took just over 5 minutes, but did work and then run

DISM /Online /Disable-Feature:VirtualMachinePlatform
PowerShell Disable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
bcdedit /set hypervisorlaunchtype off


Just to get back to basic functionality.
30 Oct 2021:
wsl2 the horror continues
WSL 2, the next generation of Windows Subsystem for Linux has a dirty little secret.

This falls down to the classic: 99% of users will never encounter this Networking situation, but 1000s of individuals will.
What's worse is that it worked perfectly in WSL 1

What am I talking about?

Networking. Specifically the way WSL is allocated virtual networking interfaces.

In WSL 1, the network interface was Bridged, meaning that the any traffic to and from both the host machine and the WSL instance would be seen as the same place. They shared the same IP address.

In turn, this meant I could spin up a web server in WSL and connect to it from any computer on the same network.

With WSL 2, the network interface is handled by Hyper-v and is defaulted to NAT (Network Address Translation). This means there is no direct route for any service running in the WSL 2 instance to be addressable from any machine other than the host. It has not only a different IP address it is on a completely different subnet.

This should be easy to rectify, but ... well I am blogging about it ...

In theory, the Hyper-v virtual networking switch should be configurable and can be set back to Bridged mode. Except that if you do then *all* networking goes directly to the WSL 2 instance, your Windows loses then ability to do any other networking. Not to mention Windows Home users do not have access to the Hyper-v manager.
Microsoft have a little note on their WSL 2 page stating that the networking is different from WSL 1 and that the user should treat it like any other virtual machine and setup virtual networking. Except that all the other virtual machine systems have GUI configuration options to handle this task (and default to sensible defaults).

So ... what if we forwarded the destination port from the host to the WSL 2 instance? This is how home internet routers work.

Some early explorers into this issue were very pleased to find that running a single command in Windows netsh (as portproxy) did successfully do this. Unfortunately, Microsoft in their infinite wisdom decided to randomise the IP address that WSL 2 got each and every time it was started. That meant that every time you rebooted you had to run the command again. And ... you had to have the random IP address (which only exists when you start WSL 2).

This was very painful, as firewall rules had to also match the virtual interface's details, which changed on every reboot.

It appears all this was reported back in June 2019 and although it has 459 comments (at time of writing) and there are many many other such threads on a multitude of platforms nothing is being done about it.

Near the bottom of the thread on the GitHub issues page for this issue there is a Powershell script that performs all the tasks for you, but ...

You have to have already started WSL 2
You have to have Administrator permissions and then, you can run it.
(and you have to have edited it for the ports you want)
(and you get loads of errors the first time, but then it works OK)

To test that other devices on the network could see my machine at all I tried to Ping the IP address and ... Windows blocks that by default now.

You need to go into Firewall settings, Advanced and incoming. Then enable the 3-4 rules that a named "File and Printer Sharing (Echo Request - ICMPv4-In)".

Oh, and did I mentioned all this doesn't work for IPv6 and loads of people have had issues with UDP and Multicast.

All this was so I could test a revision to my Godot VR tests on the Oculus Quest 2.

Many hours were lost to trying to fix this ... YMMV
30 Oct 2021:
wsl2 the hoor begins
Since late 2019 Microsoft has been touting the WSL version 2. Where WSL is Windows Subsystem for Linux. It allows you to run a full Linux system in Windows.

I have been running version 1 for ages and find it VERY useful. Everything now pushes you towards version 2 and as it has been out since 2019, I thought the most egregious bugs would have been ironed out.

How wrong could I have been ? VERY!

First off is the thing that had constantly been putting me off. No one is talking about upgrades to existing functional WSL version 1 Linux installs. Considering the convoluted route you have to take and the wording used, it sounded like it would wipe out the original version 1 install completely.

Which is BAD. Because I am using it to run some pretty critical things. But I did make lots of backups and I did check all my documentation about reinstalling all the requirements and then I bit the bullet.

First job, after installing the kernel, was to run Powershell as Administrator. Then run the update command and wait ... took about five nerve wracking minutes.

Success! and then nothing worked.

Running Ubuntu/WSL is now demanding Hyper-v support
Please enable the Virtual Machine Platform Windows feature and ensure virtualisation is enabled in the BIOS.

OK, enabled all that rebooted and everything works! In the Ubuntu/WSL environment.

Slap myself on the back for a job well done and go about my business. But it doesn't end there :(

One of the things I like to do is run browser-sync to create a local https basic web server. Then I can enter the LAN IP of the machine into the Oculus Quest 2 browser and enter my VR experiences. This didn't work.
Doing hours of research on it, showed that everyone who was trying to create a server (of any kind) to be accessible to the local network was getting unexpected failures after upgrading to WSL version 2 :(

Whats worse is all the suggestions for Microsoft to fix have gone unheeded. Including a basic toggle to disable the odd way it defaults too and the ability to keep any work arounds you create, because they are lost each time you restart.

See my next blog post for more details.

and ... the horror is not over yet.

I use VirtualBox to run Windows and Linux test machines. Haven't done it for a while, but it is very useful.

VirtualBox refuses to run any Linux (didn't try Windows, but I believe it is the same). It is supposed to default to a slow-mode and work, but badly. I didn't even get that.

More hours of research and again it's a "thing" that all WSL version 2 users have.

Is there a work around? Yes, disable all the Hyper-v stuff WSL version 2 relies on and reboot.

DISM /Online /Disable-Feature:VirtualMachinePlatform
PowerShell Disable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
bcdedit /set hypervisorlaunchtype off


and then to switch it all back on again when you need WSL version 2 again.

DISM /Online /Enable-Feature:VirtualMachinePlatform
PowerShell Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -All


is that the end of it? Not quite

You see, to run the above commands you have to be in Powershell as an Administrator, but my WSL version 2 is in a non admin users environment and the Administrator has there own WSL instance.

Needless to say, it is all a mess and you should absolutely AVOID WSL VERSION 2 AT ALL COSTS unless you understand how to manage/mitigate these know issues. There are threads since 2019 about both of them.
30 Oct 2021:
update hint
Another weird month and again lots to blog about, but be thankful I am not going into detail about the no infamous straw incident.

Prepare for a blog storm !
loading results, please wait loading animateloading animateloading animate
[More tags]
rss feed



flog archives

Disclaimer: This page is by me for me, if you are not me then please be aware of the following
I am not responsible for anything that works or does not work including files and pages made available at www.jumpstation.co.uk I am also not responsible for any information(or what you or others do with it) available at www.jumpstation.co.uk In fact I'm not responsible for anything ever, so there!