Godot - Game 'executable' won't find resources - windows

there.
When using Godot 3.2.2 stable (all templates updated) to export for OSX (from High Sierra) and Windows (VMWare with Windows 10) , many resources are not find, by the interpreter.
While testing in the IDE, everything runs perfectly.
I already changed files names (avoiding spaces and non alphanumeric and '_' characters), deleted everything from the '.import' folder and re-imported all files, and even changed my code to avoid loading stuff 'on the fly', in order to have all resources properly referred in the resulting code.
The files are in their original folders, their '.import' files are there too and mapping to existing files in the '.import' folder.
I was able, too, to check the '.pck' file and the '.wav', '.ogg' and '.png' files are there.
The game will prompt messages like:
ERROR: _load: No loader found for resource: res://sounds//Starting_Lights.ogg.
At: core/io/resource_loader.cpp:285.
ERROR: _load: No loader found for resource: res://sounds//Testing.wav.
At: core/io/resource_loader.cpp:285.
ERROR: _load: No loader found for resource: res://sprites//Backlash_Pic.png.
At: core/io/resource_loader.cpp:285.
ERROR: _load: No loader found for resource: res://sprites//Backlash_Grand_Prix.png.
At: core/io/resource_loader.cpp:285.
One of the 'not found' resource '.import' files has
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Backlash_Grand_Prix.png-ad663db21f8bfbe75b0464e994ebbe2f.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/Backlash_Grand_Prix.png"
dest_files=[ "res://.import/Backlash_Grand_Prix.png-ad663db21f8bfbe75b0464e994ebbe2f.stex" ]
and all indicated files are there
AnJo888i7:sprites AnJo888$ pwd
/Users/AnJo888/Desktop/Godot/project_mr/sprites
AnJo888i7:sprites AnJo888$ ls -l Back*
-rw-r--r--# 1 AnJo888 staff 55120 9 Jun 21:31 Backlash_Grand_Prix.png
-rw-r--r--# 1 AnJo888 staff 693 7 Jul 18:36 Backlash_Grand_Prix.png.import
-rw-r--r--# 1 AnJo888 staff 255514 29 Jun 16:40 Backlash_Pic.png
-rw-r--r-- 1 AnJo888 staff 672 7 Jul 18:36 Backlash_Pic.png.import
AnJo888i7:sprites AnJo888$ ls -l ../.import/Back*
-rw-r--r-- 1 AnJo888 staff 91 7 Jul 18:35 ../.import/Backlash.obj-1faf80b2c76bbdff34635db74f883c59.md5
-rw-r--r-- 1 AnJo888 staff 879958 7 Jul 18:35 ../.import/Backlash.obj-1faf80b2c76bbdff34635db74f883c59.mesh
-rw-r--r-- 1 AnJo888 staff 91 7 Jul 18:35 ../.import/BacklashFF.obj-1f7907e7c14594be339288bdbcc49d13.md5
-rw-r--r-- 1 AnJo888 staff 1134886 7 Jul 18:35 ../.import/BacklashFF.obj-1f7907e7c14594be339288bdbcc49d13.mesh
-rw-r--r-- 1 AnJo888 staff 91 7 Jul 18:36 ../.import/Backlash_Grand_Prix.png-ad663db21f8bfbe75b0464e994ebbe2f.md5
-rw-r--r-- 1 AnJo888 staff 55358 7 Jul 18:36 ../.import/Backlash_Grand_Prix.png-ad663db21f8bfbe75b0464e994ebbe2f.stex
-rw-r--r-- 1 AnJo888 staff 91 7 Jul 18:36 ../.import/Backlash_Pic.png-802dae49352de96e7456539e639a1c34.md5
-rw-r--r-- 1 AnJo888 staff 268132 7 Jul 18:36 ../.import/Backlash_Pic.png-802dae49352de96e7456539e639a1c34.stex
AnJo888i7:sprites AnJo888$
So... although all seems to be in place, the game will not play music/sounds (some sounds are played and I changed the loading code, for the others, in order to make everything as equal as possible, without success - all sounds are loaded by a couple os singletons) and not show some textures (mainly stuff loaded during the game execution).
These sounds load and play:
extends AudioStreamPlayer
var audioTeamsFiles = ["res://sounds/Team_Braillewalk.ogg",
"res://sounds/Team_Candy_Cane.ogg",
...
"res://sounds/Team_Cash_is_King.ogg",
"res://sounds/Team_Watermelon.ogg"
]
var audioTeamName
var names = Array()
var volSpeech
func _ready() -> void:
volSpeech = get_node("/root/Globals").volSpeech
for i in range(audioTeamsFiles.size()):
audioTeamName = AudioStreamPlayer2D.new()
audioTeamName.stream = load(audioTeamsFiles[i])
audioTeamName.volume_db = volSpeech
names.append(audioTeamName)
add_child(names[i])
func say_team_name(team):
names[team].play()
func shut_team_name(team):
names[team].stop()
func set_volume():
volSpeech = get_node("/root/Globals").volSpeech
for i in range(audioTeamsFiles.size()):
names[i].volume_db = volSpeech
These will not load:
extends AudioStreamPlayer
var audioSoundFiles = ["res://sounds/Live_the_Life.ogg",
"res://sounds//Love_the_Sound.ogg",
"res://sounds//Love_this_Song.ogg",
...
"res://sounds//Vuvuzelas.ogg"
]
var audioSound
var sounds = Array()
var volEffects
var volMusic
var volSpeech
onready var globals
func _ready() -> void:
globals = get_node("/root/Globals")
for i in range(audioSoundFiles.size()):
audioSound = AudioStreamPlayer2D.new()
audioSound.stream = load(audioSoundFiles[i])
sounds.append(audioSound)
add_child(sounds[i])
set_volume()
play_sound(0)
func play_sound(sound):
sounds[sound].play()
func quiet_sound(sound):
sounds[sound].stop()
func set_volume():
volEffects = globals.volEffects
volMusic = globals.volMusic
volSpeech = globals.volSpeech
for i in range(audioSoundFiles.size()):
if i == 0:
sounds[i].volume_db = volMusic
elif i < 6:
sounds[i].volume_db = volSpeech
else:
sounds[i].volume_db = volEffects
I even included all kind of extensions, available in the export feature, and pointed the sprites and sounds folders, to be included (I used the triple slash I saw in some other reference to Godot's exporting 'issues').
[preset.0]
name="Mac OSX"
platform="Mac OSX"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter="res:///sounds/*, res:///sprites/*"
exclude_filter=""
export_path="./AGC.dmg"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""
[preset.0.options]
custom_template/debug=""
custom_template/release=""
application/name="Absolutely Goode Championship"
application/info="Made with Godot Engine"
application/icon="res://AGC_Icon_256.png"
application/identifier="com.AGC.game"
application/signature=""
application/short_version="1.0"
application/version="1.0"
application/copyright=""
display/high_res=false
privacy/camera_usage_description=""
privacy/microphone_usage_description=""
codesign/enable=false
codesign/identity=""
codesign/timestamp=true
codesign/hardened_runtime=true
codesign/entitlements=""
codesign/custom_options=PoolStringArray( )
texture_format/s3tc=true
texture_format/etc=true
texture_format/etc2=true
It would be great if somebody could help me figure out what I'm missing here...
Btw, if I copy the sprites and sounds folders with the '.exe' in Windows, everything works fine and I was willing to use the same fix for the OSX version (regardless the duplicated files), but not even copying those folders to the app package worked.
Thanks in advance for all answers.

So... after the realization that some of my paths were wrong, I revised all of them and, after correcting the 'wrong' ones, the exported game is working OK.
The issue is that Godot's IDE is quite forgiving when it comes to find files and such, even if we make mistakes like using double slashes (in other places than 'res://') when pointing to resources.
Not trying to lessen the programmer's responsibility to get things done right, but it would've been better, IMHO, if the IDE had punched me in the face earlier, saying: "Your F-ing files are not available, in the F-ing folders you F-ing said they were."... or something like that.
Anyway... as the Lego Movie stated... Everything is Awesome...

Related

Create monthly trigger for Scheduled Task in Powershell (With additional criteria)

I'm currently working on a script that when run, creates some Scheduled tasks that makes the host machine do several things and then restart within a specified time span.
This script needs to be run on multiple domain controllers, and therefor i would like to "load balance" by using something like New-ScheduledTaskTrigger -RandomDelay in order for them to not reboot all at once, but kind of spread it out.
The goal is to be able to change some variables of when to restart, things like:
First Monday of the month between 18:00 and 23:59
Every Thursday between 01:00 and 06:00
Every day between 04:00 and ..... you see where I'm going
However there is no such thing as a "-Monthly" in New-ScheduledTaskTrigger
That's the first problem, this one i can probably solve with the help from other posts, but if i do it for example like this I'm not able to use the -RandomDelay which I think is a major feature for this to work.
Here is how I imagine it should look if the -Monthly did work (for a monthly trigger):
$rebootFrequency = MONTHLY # DAILY, WEEKLY, MONTHLY
$rebootWeek = FIRST # FIRST, SECOND, THIRD, FOURTH, LAST
$rebootDayOfWeek = MON # MON, TUE, WED, THU, FRI, SAT, SUN
$rebootTimeFrom = 10:00 # HH:MM[:SS]
$rebootTimeTo = 16:00 # HH:MM[:SS]
New-ScheduledTaskTrigger -"$rebootFrequency" -WeekOfMonth $rebootWeek;
-DayOfWeek $rebootDayOfWeek -At $rebootTimeFrom -RandomDelay $rebootTimeTo
Do you have any suggestions as to how I should solve this problem?
I could do the same thing with schtask.exe, however I would end up having to make some kind of script to do the "RandomDelay" function.
Feel free to ask further if you have any questions.
Thanks in advance.
Challenge 1
I've now got it to work, but I'm trying to make the script a bit more intuitive, but I can't figure out how i would do it...
What i want to do is to "convert" from using the numbers in days (for example: 16 for Thursday) to being able to write "THU" instead.
Right now it looks something like this:
$rebootDaysOfWeek = "16" # SUN=1, MON=2, TUE=4, WED=8, THU=16 etc.
$trigger.DaysOfWeek = $rebootDaysOfWeek
But I would find it alot cooler if it was something like this:
$rebootDaysOfWeek = "THU" # SUN, MON, TUE, WED, THU, FRI, SAT
$trigger.DaysOfWeek = $rebootDaysOfWeek
But I can't seem to find a way to "convert" $rebootDaysOfWeek to work with the bit mask.
Check out the Microsoft Docs:
https://learn.microsoft.com/en-us/windows/win32/taskschd/time-trigger-example--scripting-
The sample is in VB, but it looks like it's just a ComObject. I haven't had enough time to play around, but you can start like this:
$service = new-object -comobject Schedule.Service
$service.connect()
$taskdefinitiion = $service.NewTask(0)
There's lots of task definition stuff, but it get's down to the triggers and you'll do this:
$triggers = $taskDefinition.Triggers
$trigger = triggers.Create(5) # I had to try different numbers here, didn't dig through the docs
$trigger.DaysOfWeek = 16 #Thursday
$trigger.WeeksOfMonth = 1 # First week, 2 for second, 6 for third, 8 for forth
$trigger.MonthsOfYear = 4095 # all months
$trigger.RandomDelay = 'PT1H' # 1 hour random delay.
I'll let you take it from here. Links to some of the items above:
https://learn.microsoft.com/en-us/windows/win32/taskschd/monthlydowtrigger-daysofweek
https://learn.microsoft.com/en-us/windows/win32/taskschd/monthlydowtrigger-monthsofyear
https://learn.microsoft.com/en-us/windows/win32/taskschd/monthlydowtrigger-weeksofmonth
https://learn.microsoft.com/en-us/windows/win32/taskschd/monthlydowtrigger-randomdelay
UPDATE FOR CHALLENGE 1
In order to use "friendly" references to the bitwise decimal value you can either create a constants section or use hashtable, either way you are going to have to do the conversion yourself:
# Constants
$SUN = 1
$MON = 2
$TUE = 4
$WED = 8
$THU = 16
$FRI = 32
$SAT = 64
# Hashtable - because why not!
$DaysOfWeek = #{
SUN = 1
MON = 2
TUE = 4
WED = 8
THU = 16
FRI = 32
SAT = 64
}
Then you can use:
$trigger.DaysOfWeek = $THU
or
$trigger.DaysOfWeek = $DaysOfWeek["THU"]

FORTRAN : maxloc

my data looks like
JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
22.60 24.60 30.60 34.60 36.20 35.70 32.10 30.20 31.40 31.60 28.00 24.80
25.40 27.60 32.40 34.60 36.50 38.10 31.70 31.40 30.30 30.20 27.00 23.90
and there are like hundreds of rows! I want to find a maximum value in each row and write it in different column next to data along with month
so my out put will be
36.20 MAY
38.10 JUN
.
.
I want to use maxloc function, but i have no idea how to use it!
Try
index = maxloc(myTable(3,:))
print *, myTable((/1,3/), index)
It should select the highest value from the third row and display the first and third value at this index.

In Rust, how can I capture process output with colors?

I would like to capture output from another process (for example git status), process it, and print with all styles (bold, italics, underscore) and colors. It's very important for me to further process that String, I don't want only to print it.
In the Unix world, I think this would involve escape codes, I'm not sure about Windows world but it's important for me too.
I know how to do it without colors:
fn exec_git() -> String {
let output = Command::new("git")
.arg("status")
.output()
.expect("failed to execute process");
String::from_utf8_lossy(&output.stdout).into_owned()
}
Maybe I should use spawn instead?
Your code already works:
use std::process::Command;
fn main() {
let output = Command::new("ls")
.args(&["-l", "--color"])
.env("LS_COLORS", "rs=0:di=38;5;27:mh=44;38;5;15")
.output()
.expect("Failed to execute");
let sout = String::from_utf8(output.stdout).expect("Not UTF-8");
let serr = String::from_utf8(output.stderr).expect("Not UTF-8");
println!("{}", sout);
println!("{}", serr);
}
Prints the output:
total 68
-rw-r--r-- 4 root root 56158 Dec 23 00:00 [0m[44;38;5;15mCargo.lock[0m
-rw-rw-r-- 4 root root 2093 Dec 9 02:54 [44;38;5;15mCargo.toml[0m
drwxr-xr-x 1 root root 4096 Dec 30 15:24 [38;5;27msrc[0m
drwxr-xr-x 1 root root 4096 Dec 23 00:19 [38;5;27mtarget[0m
Note that there's a bunch of junk scattered inside the output ([44;, [0m, etc.). Those are ANSI escape codes, and the terminal emulator interprets those to change the color of the following text.
If you print the string with debugging, you will see:
\u{1b}[0m\u{1b}[44;38;5;15mCargo.lock\u{1b}[0m
Each escape code starts with an ESC (\u{1b}) followed by the actual command. You will have to parse those in order to ignore them for whatever processing you are doing.
Windows does not use escape codes (although maybe it can in Windows 10?), and instead a program directly modifies the console it is connected to. There is nothing in the output to indicate the color.
You can force git to output colors by using git -c color.status=always status
use std::process::Command;
fn main() {
let output = Command::new("git")
.arg("-c")
.arg("color.status=always")
.arg("status")
.output()
.expect("failed to execute process");
let output = String::from_utf8_lossy(&output.stdout).into_owned();
println!("{}", output);
}
This works for git status only. For a more general solution, you either have to check the programs documentation and hope there is a way to force colored output or check how the program determines if it should output colors or not (such as checking for the COLORTERM environment variable).

Cassandra DateTieredCompactionStrategy SSTables

We are running Cassandra 2.2.3.
Have a column family using DateTieredCompactionStrategy as follows,
CREATE TABLE test (
num_id text,
position_time timestamp,
acc int,
coordinate text,
device_no text,
PRIMARY KEY (num_id, position_time, coordinate)
) WITH CLUSTERING ORDER BY (position_time DESC, coordinate ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
AND comment = 'table for gps points from car gps source.'
AND compaction = {'timestamp_resolution': 'MILLISECONDS', 'max_sstable_age_days': '8', 'base_time_seconds': '3600', 'class': 'org.apache.cassandra.db.compaction.DateTieredCompactionStrategy'}
AND compression = {'chunk_length_kb': '64', 'crc_check_chance': '1.0', 'sstable_compression': 'org.apache.cassandra.io.compress.SnappyCompressor'}
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 86400
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';
We do have some traffic, It keeps inserting the table.
Cassandra generates many SStables, around 2,000 in total.
For example,
-rw-r--r-- 1 cassandra cassandra 86M Jan 20 02:59 la-11110-big-Data.db
-rw-r--r-- 1 cassandra cassandra 111M Jan 20 03:11 la-11124-big-Data.db
-rw-r--r-- 1 cassandra cassandra 176M Jan 20 03:12 la-11125-big-Data.db
-rw-r--r-- 1 cassandra cassandra 104M Jan 20 03:14 la-11130-big-Data.db
-rw-r--r-- 1 cassandra cassandra 102M Jan 20 03:26 la-11144-big-Data.db
-rw-r--r-- 1 cassandra cassandra 172M Jan 20 03:26 la-11145-big-Data.db
-rw-r--r-- 1 cassandra cassandra 107M Jan 20 03:30 la-11149-big-Data.db
-rw-r--r-- 1 cassandra cassandra 96M Jan 20 03:41 la-11163-big-Data.db
-rw-r--r-- 1 cassandra cassandra 176M Jan 20 03:41 la-11164-big-Data.db
-rw-r--r-- 1 cassandra cassandra 97M Jan 20 03:45 la-11169-big-Data.db
-rw-r--r-- 1 cassandra cassandra 82M Jan 20 03:57 la-11183-big-Data.db
-rw-r--r-- 1 cassandra cassandra 194M Jan 20 03:58 la-11184-big-Data.db
-rw-r--r-- 1 cassandra cassandra 28M Jan 20 03:59 la-11187-big-Data.db
-rw-r--r-- 1 cassandra cassandra 90M Jan 20 04:00 la-11188-big-Data.db
My question is, Is it normal to have so many SStables (2000)?
The other thing is we are experiencing readtimeout Exception for selection query.
The selection query uses primary key num_id and clustering key timestamp.
The readtimeout is set to 10 seconds.
So, the other question is the readtimeout exception is caused by many SStables or wide row? How to solve avoid this exception?
the problem is "'timestamp_resolution': 'MILLISECONDS'" I've filed https://issues.apache.org/jira/browse/CASSANDRA-11041 to improve documentation about this parameter
My question is, Is it normal to have so many SStables (2000)?
No, it's not normal. I think that in your case, the compaction is not fast enough to keep up with the ingestion rate. What kind of hard drive do you have for the Cassandra server ? Spinning disk ? SSD ? Shared storage ?
So, the other question is the readtimeout exception is caused by many SStables or wide row?
It can be both, but in your case, I'm pretty sure that it's related to the huge number of SSTables
How to solve avoid this exception?
Check that your disk I/O can keep up. Use dstat and iostat Linux tool to monitor the I/O

Xcode 4.6 / 5 with lldb breakpoints not working

I had a problem with using debugger LLDB,
if in "main.c" , I include another file like "a.c" , and set breakpoint in "a.c"
the breakpoint will never been stopped.
Is anyone else getting this?
ok, here is the example
// main.c
#include "a.c"
int main()
{
test();
}
// a.c
void test()
{
return; // (Using UI to)set break point here, the gdb will stop, and lldb will not
}
======================================================================
To trojanfoe:
I had tried these steps in Xcode 4.6.3 command line utilities,
the result is like yours, but my problem is on GUI,
When I use the mouse to set a break point on "a.c", it will not work.
I had tried to stop on main(), and enter this cmd "br list",
here is the message on console,
(lldb) br list
Current breakpoints:
1: file ='a.c', line = 13, locations = 0 (pending)
2: file ='main.c', line = 15, locations = 1, resolved = 1
2.1: where = test`main + 15 at main.c:15, address = 0x0000000100000f3f, resolved, hit count = 1
(lldb)
if you need the log by using command line utilities, please tell me,
thanks~
See "File and line breakpoints are not getting hit" in http://lldb.llvm.org/troubleshooting.html - that seems to be talking about exactly your build scenario, and I've just had this problem. To solve it I not only had to put this in $HOME/.lldbinit:
settings set target.inline-breakpoint-strategy always
I also had to do a clobber (distclean) build and restart Xcode.
NOTE This is not an answer, however I wanted to document the works for me response fully.
OP: Please follow these steps to see how it differs for you.
$ clang -g -o bptest main.c
$ ls -l
total 32
-rw-r--r-- 1 andy staff 110 Oct 31 10:55 a.c
-rwxr-xr-x 1 andy staff 4664 Oct 31 10:56 bptest
drwxr-xr-x 3 andy staff 102 Oct 31 10:56 bptest.dSYM (NOTE THIS)
-rw-r--r-- 1 andy staff 42 Oct 31 10:55 main.c
$ lldb
(lldb) target create bptest
Current executable set to 'bptest' (x86_64).
(lldb) break set -b test
Breakpoint 1: where = bptest`test + 4 at a.c:4, address = 0x0000000100000f34
(lldb) run
Process 9743 launched: '/Users/andy/tmp/bptest/bptest' (x86_64)
Process 9743 stopped
* thread #1: tid = 0x65287, 0x0000000100000f34 bptest`test + 4 at a.c:4, queue = 'com.apple.main-thread, stop reason = breakpoint 1.1
frame #0: 0x0000000100000f34 bptest`test + 4 at a.c:4
1 // a.c
2 void test()
3 {
-> 4 return; // (Using UI to)set break point here, the gdb will stop, and lldb will not
5 }
(lldb) bt
* thread #1: tid = 0x65287, 0x0000000100000f34 bptest`test + 4 at a.c:4, queue = 'com.apple.main-thread, stop reason = breakpoint 1.1
frame #0: 0x0000000100000f34 bptest`test + 4 at a.c:4
frame #1: 0x0000000100000f49 bptest`main + 9 at main.c:4
frame #2: 0x00007fff8eb3f7e1 libdyld.dylib`start + 1
(lldb)
Note: I am using the Xcode 5.0.1 command line utilities.

Resources