Oh so it's not a widows thing I've missed then :S
Probably me being stupid, but am I missing something here?
I've set this in windows:
Set it again per .exe in Nvidia Control Panel:
Then even set it globally to be sure:
And yet once I get past the initial splash screen into the godot editor:
Goodbye Battery life -.-
Suggestions?
- Edited
I don't do 2D, but I've roughed up a quick example of what I described above, where I'm just setting the pre_a and pre_b handles to be 'arcHeight' above their respective Origin/Target vectors.:
@tool extends ColorRect @export var arcHeight := 50.0 @export var resolution := 10 # Called when the node enters the scene tree for the first time. func _ready(): pass # Replace with function body. # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): var curvepoints = PackedVector2Array() for idx in range(0,resolution+1): curvepoints.append($Origin.position.cubic_interpolate($Target.position, Vector2($Origin.position.x,$Origin.position.y+arcHeight), Vector2($Target.position.x,$Target.position.y+arcHeight), float(idx)/float(resolution))) $Line2D.points = curvepoints
You could then alter the profile of the curve by offseting the pre_a/b vectors as desired, or programmatically alter arcHeight depending on other factors.
Again I don't do 2D, but I imagine you could also use this to sample points along this trajectory to identify collisions for example and stop the curve early. Someone feel free to chip on what the 'best' way to do this would be.
Edit: More fun stuff, by editing the positions of pre_a and pre_b relative to origin/target vectors you can get easy bendy splines (though would need to tweak to your liking:
and the code:
@tool extends ColorRect @export var resolution := 10 # Called when the node enters the scene tree for the first time. func _ready(): pass # Replace with function body. # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): var curvepoints = PackedVector2Array() $pre_a.position = Vector2($Origin.position.x+($Target.position.x - $Origin.position.x)*0.3,$Target.position.y+($Target.position.y-$Origin.position.y)*2.0) $pre_b.position = Vector2($Target.position.x+($Origin.position.x - $Target.position.x)*0.3,$Origin.position.y+($Origin.position.y-$Target.position.y)*2.0) for idx in range(0,resolution+1): curvepoints.append($Origin.position.cubic_interpolate($Target.position, $pre_a.position, $pre_b.position, float(idx)/float(resolution))) $Line2D.points = curvepoints
When might you use something like this (at least in3D)?
- Edited
I've not used it, but based on this in the docs:
I assume this function essentially returns a point on a cubic bezier curve between two Vectors, where pre_a/b are the handles and the weight is effectively % progress along the curve.
To understand cubic bezier curves more I'd suggest this clip, noting the 4 white circles are Vectors a/b and handles pre_a/b:
As a use case example (noting there are probably better ways to do this), I imagine you could use this function to calculate a symmetrical arc (such as for an arrow firing) between two points, say Vector2(0,0) to Vector2(0,5), by assigning Pre_a and Pre-b to directly 'above' these points Vector2(2,0) and Vector2(2,5).
- Edited
Only thing is this is relative to the camera on that viewport. I want to see the mesh lod relative the camera position on a different view-port. For example imagine a static overhead camera, that shows the mesh lod changes relative to a player moving around beneath it.
- Edited
I'm hoping to create a debug camera that allows me to see the automatic mesh LOD in 4.x, but as it is applied relative to a main camera, i.e. Camera 1 is used to determine mesh lod, Camera 2 views this mesh LOD.
As far as I can tell, currently the Mesh Lod is controlled per viewport/camera, and so adding a new Camera/Viewport means it gets its own Mesh Lod for it's view.
While I primarily am interested for debugging purposes, I can imagine this being useful for certain DoF cinematic shots where you may want an object in the distance (but centre of focus) to have the highest LOD, while close/far objects that are blurred could be decimated.
Am I missing something? or should I raise a feature request.
- Edited
DanchoLudiq Can you explain how this .replace thing is working please?
SO the docs are here: https://docs.godotengine.org/en/stable/classes/class_string.html#class-string-method-replace
But to give some context I will use a simpler example:
"This is a string".replace("string", "word") = "This is a word"
So the '.replace' function acts on the string object to the left of it, replacing the instances of the first parameter passed to it (in this case "string") with the second parameter ("word") as a new string object.
In my example I used the fact the output is also a string object to chain multiple replaces together, e.g:
"This is a string".replace("string", "word").replace("word","book") = "This is a book"
I account for when things like "1 workers" should be "1 worker" or when a line is redundant I replace it with "" but I do it all in one command (which is ugly). This replaces the IF block entirely as in most cases the output is the same, and predictable when not. It is probably confusing because I am not just passing a typed string as parameters to replace, but rather programmatically defined strings.
Like I said this is foul/not readable and I would not recommend it unless it quantifiably improves performance in a way that is actually necessary. I suspect it doesn't/isn't, so always favor readability first as it makes code easier to revisit down the track or if others need to review/modify it.
- Edited
DanchoLudiq And how should I go about Localization option for PIECES, PIECES PER PERSON, REMAINDER etc if I want to have it in two languages?
Feel the right answer is to spend some time looking over https://docs.godotengine.org/en/stable/tutorials/i18n/internationalizing_games.html as at a glance there is a better way than the bootleg approach I thought of below, which was:
I would probably use a dict with my primary language as keys for readability, with the lang_choice variable in a global singleton. Something like this:
var lang_choice = "en" var localiser = { "PIECES":{ "en": "PIECES ", "fr": "PIÈCES " }, "PIECES PER PERSON":{ "en":"PIECES PER PERSON ", "fr":"PIÈCES PAR PERSONNE ", }, "REMAINDER":{ "en":"REMAINDER ", "fr":"RESTE ", } } var base_txt = str(localiser["PIECES"][lang_choice], input_number) + "\n" + str(localiser["PIECES PER PERSON"][lang_choice], pieces_per_person) + "\n" + str(localiser["REMAINDER"][lang_choice]), remainder + "\n"
Edit: This feels like it would get cumbersome/messy quickly, but surprisingly my bootleg approach is not far off what is recommended here: https://docs.godotengine.org/en/stable/tutorials/assets_pipeline/importing_translations.html#doc-importing-translations
Seems like translations in general is just a massive hassle lol.- Edited
Had another think about it when I woke up and realised two things. One, you're situationally using "Worker" and "Workers" which I didn't account for and Two, I don't think I actually technically "Improved efficiency", just reuse/readability.
To account for both of these points, you could do something utterly disgusting like this:
var worker_num = 6 func _on_Button_pressed(): var input_number = get_node("../LineEdit").text.to_int() #assuming your not reusing you can chain .to_int() var pieces_per_person = input_number / worker_num var remainder = input_number % worker_num # following bit looked to be the same under all conditions var base_txt = str("PIECES ", input_number) + "\n" + str("PIECES PER PERSON ", pieces_per_person) + "\n" + str("REMAINDER ", remainder) + "\n" get_node("../Label").set_text(base_txt + str(remainder, " Workers ", pieces_per_person + 1, "\n").replace(str("0 Workers ", pieces_per_person + 1, "\n"), "").replace("1 Workers ", "1 Worker ") + str(str(worker_num - remainder).replace(str(worker_num), "All ") + " Workers " + str(pieces_per_person)).replace("1 Workers ", "1 Worker "))
This I suspect at some level might be faster (depends on how GDScript works under the hood so it could even be slower lol, ymmv) as it avoids branching entirely through use of string replacement, but this is where I would argue readability is absolutely more important than performance, so please don't do this. Also, I suspect this could be done with less replaces, but meh, chaining like this is foul to begin with and should be avoided unless you WANT your colleagues to hate you lol.
Ultimately the original IF statement would likely occur in sub ms times so not sure why you need more performance for something that should not affect frame times. If you were running this every frame it might be worth interrogating, but ultimately string manipulation in an IF statement should in most cases be negligible.
- Edited
Pretty sure you can just combine the cases where modulo result is non-zero and drive your worker text from the 'remainder' variable. Something like (untested):
var worker_num = 6 func _on_Button_pressed(): var input_number = get_node("../LineEdit").text.to_int() #assuming your not reusing you can chain .to_int() var pieces_per_person = input_number / worker_num var remainder = input_number % worker_num # following bit looked to be the same under all conditions var base_txt = str("PIECES ", input_number) + "\n" + str("PIECES PER PERSON ", pieces_per_person) + "\n" + str("REMAINDER ", remainder) + "\n" if remainder == 0: get_node("../Label").set_text(str(base_txt + str("All Workers ", pieces_per_person))) else: # use remainder and worker_num - remainder to drive text for else conditions. get_node("../Label").set_text(base_txt + str(remainder, " Workers ", pieces_per_person + 1) + "\n" + str(worker_num - remainder, " Workers ", pieces_per_person))
Added a small tweak, replacing the hard coded number 6 with a var worker_count makes this approach reusable for any other worker counts. Though would expect this to live outside the button pressed function if it was going to change programmatically.
Imagine the type casting above is iffy, but other than that think it should work.
- Edited
- Best Answerset by Lethn
As your random range is a multiplication of your X and Z position values it is entirely possible for this to return from 0 to 0 (where X/Z = 0) and effectively do nothing.
Also as it stands, the further away from world origin your localVillageManager node is, the larger your random range will encompass (by design?)I suspect what you were aiming for would be to replace those '*'s with '+'s which would effectively give you a random point in a square of size 2 around the localVillageManager node.
If however you are after random point in a circle of a given radius around the localVillageManager node that is a bit different (Disk Point Picking) and would look something like:
func random_pt_in_circle(radius = 1.0): var r = sqrt(rand_range(0.0, 1.0)) * radius var t = rand_range(0.0, 1.0) * TAU return Vector2(r * cos(t), r * sin(t)) func _ready(): isWondering = true localVillageManager = get_parent_spatial() randomGenerator.randomize() var random_pt = random_pt_in_circle(2.0) wonderVector3 = Vector3(localVillageManager.global_transform.origin.x + random_pt.x, 0.0,localVillageManager.global_transform.origin.z + random_pt.y) print(wonderVector3) maleAdultNavigationAgent.set_target_location(wonderVector3)
- Edited
Last time I checked LTO tapes are still king for long term storage and you can probably pickup an old LTO 5 drive/tapes for cheap (3TB per tape). If it's really sensitive then keep them in a Faraday storage box to ensure they don't degausse during the next X+ class solar flare lol.
If you want plug and play day to day expandability though, I've seen versions of these caddies that support 4 drives:
https://www.umart.com.au/product/simplecom-sd322bk-dual-bay-usb-3-0-aliminiumdocking-station-for-2-5in-and-3-5in-hard-drive-35336They often come with nice features like a drive cloning button too which is cool.
- Edited
I've not checked the tutorial or anything, but first thing I would try is
print(get_tree().reload_current_scene()
according to the docs, this should ...
Returns @GlobalScope.OK on success, @GlobalScope.ERR_UNCONFIGURED if no current_scene was defined yet, @GlobalScope.ERR_CANT_OPEN if current_scene cannot be loaded into a PackedScene, or @GlobalScope.ERR_CANT_CREATE if the scene cannot be instantiated.
Though printing it might just be an enum or something idk. Might help in understanding the cause at least.
- Edited
Finally got around to loading 4.0 Beta3 to see if it's in a usable state yet
. . . . Might leave it a bit longer hey ^^
In all seriousness, I can see it's getting there and some very promising features/improvements have me super hyped for ~ 4.3 (roughly when 3.x was truly solid). 3D performance improvements alone have me drooling, but it's far easier to break than some YouTubers would have you believe. Feel like they're not actually digging into anything seriously as I broke volumetric and GI effects real quick lol.
I'm going to keep playing despite the oddities/crashes, but it's kinda a hard sell to invest time in it right now when I feel like I've figured out most of the 3.X quirks and generally love it.- Edited
packrat It's a tragedy that Dishonored is not mentioned once.
I never liked Dishonoured. It struck me as a wholly mediocre, forgettable game that was not deserving of the wild hype it got. I swear I even completed it, but I couldn't name a single character or tell you what the plot was.
"You can overlook the lack of compelling story if you've got Bioshock-esque powers with Deus Ex-esque level design" I hear you cry. Not when both of the aforementioned provided equally if not more compelling gameplay and level design 5+ years earlier, with BioShock Infinite laying this game to rest within a year of its release.
tldr; Elizabeth was single-handedly more impressive than anything in Dishonoured.... imo.
Bringing this back into the realm of video games, couple good ones on this list:
https://bosslevelgamer.com/dystopian-games-inspired-by-george-orwells-1984-13459
- Edited
Side note, why does tilda now cause numbers to go small unless you put a space:
~ 35
35- Edited
cybereality Game dev is so fun, but also really hard to make money cause everyone is doing it. Though I guess life is about enjoying the journey, not just working for a living.
Yeah, totally this. I'm very much aware this is unlikely to be a career change for me, and TBH I don't think I would want it to be, in the sense that working in 'the industry' = deadlines, crunch, and lack of creative freedom which would sap the fun out of it.
I also don't expect this to pay the bills unless I get incredibly lucky, hence working part-time still. But I feel I've hit a transitional period in my life (~ 35) where grinding the career ladder for the sake of it is less important than finding that optimum work/life happiness. It doesn't help that where I live in Australia the cost of buying a house is outpacing the speed I can save despite being on a good salary; so every time I look at my savings I keep thinking "why have this if you can't use it".
I can still save for holidays etc. perfectly fine working a 4-day week, and probably even be ok on 3 days if I alter lifestyle a bit, so figure why not do something fulfilling with that buffer instead of watching it grow but achieving nothing.
I should clarify this is NOT financial advice. The unanimous opinion of those I speak to is I SHOULD "just get a house"... but the way I see it, a lot of them are just locking themselves into enough debt they're forced to overwork themselves for ~ 30+ years.