I have a little issue with the Quest 2 and it all revolves around my Wifi. The router cannot be moved and is in the far corner of the downstairs. My computer is the opposite of the house and is connected through ethernet via the mains power ring.
The weird thing is, 1 in 5 times the Quest 2 will be fine upstairs and other times it will be unable to handle as much as 1 frame per second(*)
As my Godot VR development continues I really want a good connection so I can hop in and out of VR. That is not to say that doing Godot VR development without the headset isn't possible ...
I heard that the WiVRn Linux app now supports wired connection over USB and really wanted to check it out, but there are some steps that are not normal .
You do have to have Android Developer tools already installed, but I had those.
adb reverse tcp:9757 tcp:9757
adb shell am start -a android.intent.action.VIEW -d "wivrn+tcp://localhost" org.meumeu.wivrn
results in the port number and a response of
Starting: Intent { act=android.intent.action.VIEW dat=wivrn+tcp://localhost/... pkg=org.meumeu.wivrn }
and you should find that WiVRn has started on the headset without you doing anything and it is ready for you to start some VR-ing!
If you get this response then a popup will be waiting to be OK-d in the headset
adb: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
(*) While writing this up I have seen that other people have had the same 1 in 5 Wifi issues and it is all to do with the Quest 2 dropping to the lowest Wifi speeds when it sleeps. So in theory, I could just set the headset to not sleep and turn the Wifi off and on to try and get it back to full strength. But with the cable plugged in I am getting the Quest charged, so I think I will stick with that.
If it wasn't obvious
git diff HEAD~3 HEAD~4
showed me the difference between the two commits and could see I had set the visibility of the XROrigin3D to false in the main scene. Which was annoying because that was the only place I wasn't looking!
Then once I could see my hands I had some more fun.
I had it so when your hand pointed at a tile it highlighted (and deselected any existing highlighted tiles), but what I needed was to detect a button press and then initiate the mine clearing algorithm.
There were a nice button_pressed and button_released signal events I could hook into. When I ran the code everything went nuts as if I was constantly pressing and releasing all the buttons at once!
One of the cool and rather odd things about the Quest 2 controllers is they can detect if you finger is near a button. So, I was in fact touching and releasing different buttons, just incredibly lightly.
The fix is to use
input_float_changed(name: String, value:float)
and that value can be checked for 1.0 (pressed fully) and 0.0 (released completely)
The game is not quite working. If I highlight certain tiles and press the trigger then it does correctly uncover that title and all the surrounding tiles (and their surrounding tiles etc). Then other tiles just uncover themselves and do not try and deal with the tiles around them.
I was mucking about in Godot and not using the Quest 2 headset to make sure everything worked ...
Somehow, somewhere I had hidden or disabled the hand models that appear as your controllers.
But I was using git so all I had to do was find the check-in before they disappeared and compare it. Godot is all text files and although somewhat cryptic all the changes are logged there.
git checkout HEAD~2
Test in Godot hands are still gone, so I need to go back further...
git checkout HEAD~3
Now the hands are back but it looks like really old code...
What was the message that appeared after the first command?
Note: switching to 'HEAD~2'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 30d4a0d replaced floor with PlayArea, height magically fixed, raycast not visible
Oh so this was not 3 commits ago it is now 2+3 commits ago!
So I can just run
git switch -
then? Well, yes, but not more than once, now I am stuck in detached HEAD :(
I tried my usual reset command
git checkout .
but it helpfully checked out the same commit, because it is the new HEAD
All the LLMs and Google wanted me to use
--reset hard
but it was much easier to just
git checkout main
and I am back to the true HEAD!
Now I can carefully checkout the actual 3rd commit
git checkout HEAD~3
hands still MIA, switch back to main
git checkout main
and try the 4th
git checkout HEAD~4
Ah ha! the hands are back!
I just need to switch back to main
git checkout main
and diff the two
git diff HEAD~3 HEAD~4
Git for the Win!
This is an update for my reference as the previous notes have gone a bit stale.
To take an existing local project and put it on Github.
cd
into your project folder and run
git init
git add -A
git commit -m "initial commit"
The commit is now officially locally created.
Then go to Github and create a new repo and come back with the
new-repo-name
git remote set-url origin git@github.com:my-username/new-repo-name.git
git remote -v
Where
my-username
is your github username.
Your remote is now pointing to github
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
to add your passphrase and log in to github
git push --set-upstream origin main
should push all your project files to github
if it gives you a message about needing to pull first you can
git pull
git fetch origin
git push --force origin main
then to test it add a README.md file
vi README.md
git add .
git commit -m "added README"
git push
prophet!
Here is a screenshot of a 10x10 grid of mines and mine counts from my Godot 3D 2D minesweeper.
Now just have write all the interactive bits.
I am writing a 3D version of 2D minesweeper in Godot and the one key area of coding is the logic of creating the board.
It needs to have enough mines randomly placed and also not to create clusters of 8 or more that would could be impossible to decipher. That logic worked surprisingly well, but when I came to counting the mines around a square, I got a shock. The counts were off for the first line and first column. The numbers were too high.
After some quite considerable debugging I find that both Godot and Python allow negative indexes to arrays. Or maybe I did know and forgot .
So those counts were counting the mines on the other side of the map!
Note to self;
Exceed the bounds of an array, get and error
Use a negative index and bounce back to the other end of the array
This is one of those things that you could go your entire life coding and never hit, so, lucky me!
not sure why the code got all screwed up there, here it is again.
func _get_obj_filename(obj):
if typeof(obj) == TYPE_OBJECT:
var script = obj.get_script()
if script and script.has_method("get_path"):
var path = script.get_path()
if path != "":
return path
return "unknown"
I was quite pleased with my progress after only a few short hours of Godot coding. Things were generally just working, so I did some refactoring and then looked to add some unit tests...
First you have to install an Add-On called Gut , then enable it, then it should just be a matter of creating a test and running it.
But I got a very weird response when running my first very simple test.
Parser Error: Function "inst_to_dict()" not found in base self.
It seems the only way of fixing it is to either; write more complex tests or patch the testing framework. The issue is that the Gut system is trying to work out the details of the file your test is running from so that it can report the file name etc. But when the this code runs the test file details are reported as Boolean, not a file and obviously a Boolean does not have a file name property and it fails.
I opted to replace the offending code with
func _get_obj_filename(obj):
if typeof(obj) == TYPE_OBJECT:
var script = obj.get_script()
if script and script.has_method("get_path"):
var path = script.get_path()
if path != "":
return path
return "unknown"
which fixed it!
email
root
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!