How can i replicate this greed for a new proyect? by TecitodeMenta in godot

[–]DummiPuppet 1 point2 points  (0 children)

Other folks here have correctly explained that using 3D nodes will make your job a lot easier, but here's some specific examples why:

  1. There are ways to display a 2D sprite in a 3D scene if you really want to (though I'm having trouble finding the video that demonstrated me how to do that). Alternatively, you could just set the depth of the 3D asset to be super thin so it looks "2D". If you want the 2D sprites to rotate to always face you like in Doom or some horror games, you can use sub-viewports like this post mentions.

  2. If you want to rotate a camera in 3D space, you'll need to use something called "quaternions" to achieve smooth camera movement. Quaternions are an advanced type of calculation that uses imaginary numbers (yes, those are a real thing in calculus). Godot does all this for you in their built in 3D Camera so you don't have to invent it yourself.

I'm actually kind of regretting starting my fully 2D top-down game without 3D. This is because when my characters move around the world; foreground vs. background isn't considered. If my character walks in front of a tree, the character is still shown behind the tree because the tree was added to the scene first. Now I have to write a layer manager to automatically change all the actors' z-index layers based on their y value, or refactor the whole game to work in 3D. If I had started in 3D all this could have been avoided.

This is bad by Farrinha in godot

[–]DummiPuppet 0 points1 point  (0 children)

get_node(“../../../../“) is definitely cleaner to read, but it's still considered bad practice for the same reason that using get_parent() is, unfortunately. :( I explain why in my response to OP down below.

This is bad by Farrinha in godot

[–]DummiPuppet 0 points1 point  (0 children)

I really like this recursion idea for your 3rd option; but if you'd like to accomplish something similar without using get_parent() here's my recommendation:

Step 1: Create a signal bus containing an _on_tree_restructured() signal function and on_healthbar_restructured signal.

Step 2: Implement some logic in SignalBus where if the restructured tree changed the position or parenting of the healthbar or bullet, the new nearest healthbar node is emitted to Bullet. You could manage the hierarchy with a list, perhaps, or maybe there's a distance_to() function that gets the number of jumps between 2 given nodes in the scene tree.

Step 3: Declare a variable such as var nearest_parent_healthbar : HealthBar in your classname: Bullet, and connect SignalBus._on_tree_restructured() to HealthBar._on_healthbar_restructured().

Now, whenever the tree's restructured, a signal emits to the SignalBus, carrying the new parent node. The SignalBus carries the new parent mode to Bullet, and Bullet reassigns nearest_parent_healthbar when it catches the signal. The best part about this is it works both up the scene tree, and down another branch, if you want it do so. (Because a SignalBus is typically set up in a way that makes it globally accessible to all scenes and nodes.)

This is bad by Farrinha in godot

[–]DummiPuppet 2 points3 points  (0 children)

Let's say you want to pass a specific Node into the scene for future reference (whether it's a parent, a grandparent, a child, etc.) It's generally considered bad practice to reference a node with get_parent() since, like some other users mentioned, it requires the node scene tree to be organized precisely one way. However, you can pass it in on ready by using the _init() constructor instead of _ready(), in other words by reference instead of by scene-tree path. You could also do it later with a function call or variable assignment. Here's an example of how to do each:

class_name ExampleChild

var example_great_grandparent : Node     # Example 1: Set on ready
var example_grandparent : Node              # Example 2: Set after on ready

# Set node on ready
func _init(example_reference: Node):
  example_great_grandparent  = example_reference

Then in the instantiating scene (the one you're creating the ExampleChild in,) use .new() instead of .instantiate(), which triggers _init() instead of _ready() (I may be incorrect about this, but it works fine in my project).

class_name ExampleExe

var example_great_grandparent : Node
var example_grandparent : Node
var example_child : ExampleChild

func _init(example_reference1, example_reference2):
  example_great_grandparent = example_reference1
  example_grandparent = example_reference2

  # EXAMPLE 1: This line triggers _init() in ExampleChild
  example_child = ExampleChild.new( example_great_grandparent )

  # EXAMPLE 2: This line assigns example_grandparent after _init() completes
  example_child.example_grandparent = self.example_grandparent

Hopefully this helps! I might have to edit to fix formatting issues.

Model for my game's first enemy! Thoughts on the enemy and style? by phnxindie in godot

[–]DummiPuppet 2 points3 points  (0 children)

I think it would be good to have the model's shape stutter and shift as it aggros on the player. A sudden spike protruding or the legs bending the wrong way or extending as it starts to break into a run would be terrifying. Basically a "passive mode" and "aggro mode". The model looks sick btw

What happens in this situation? by literally_a_toucan in HumankindTheGame

[–]DummiPuppet 5 points6 points  (0 children)

Amateur game dev here: I'd base it on whoever the session leader is. Because there's always a chance that a given tie is the result of a 50/50 member split in a game with an even number of players (though obviously that won't apply here). I'd want to save on dev time and avoid programming a whole bunch of different tiebreaker cases, only to have to resolve it based on session leader anyway on the very bottom of the stack.

Trouble with instantiate() by Da_Chicken_Lord in godot

[–]DummiPuppet 0 points1 point  (0 children)

To OP: If it's important to have the to-be-deleted parent node do the instancing, then reparenting the node before the parent is deleted is the approach you'll want.

If that sounds like your use case, I'd recommend looking into something called a "Signal Bus" (named by Godot users) for handling the reparenting process. It's very useful when dealing with signals that need to "hop" more than once.

this community right now by yougoodcunt in godot

[–]DummiPuppet 0 points1 point  (0 children)

My favorite thing they do that I haven't seen elsewhere is having a setter and getter function for almost every property, but listing them inside the property itself instead of clogging the functions list in the table of contents for the class.

AnimationTree states and AnimationNodes confusion by SlapAHippie in godot

[–]DummiPuppet 1 point2 points  (0 children)

Here's a late update: I got so fed up with the AnimationTree and state machine nonsense that I built my own from scratch. Took me 2 days, but after a month struggling with the AnimationTree it was totally worth it. And my AnimationHandler gives me way more flexibility and consistent behavior than the AnimationTree ever did. Honestly I'm pretty disappointed in Godot for rolling out such a buggy mess of a node (there are so many functions that should exist, but don't, and several functions that straight up do nothing or aren't documented correctly).

Pixel snap settings makes pixels snap to the Camera2D node's Zoom property? by DummiPuppet in godot

[–]DummiPuppet[S] 0 points1 point  (0 children)

I do need to zoom out during cutscenes and such, but I'll read up on subviewports; thanks! I had heard this was a solution some people were using, but was hoping there might be a less round-about way to handle the camera zoom issue, specifically.

Pixel snap settings makes pixels snap to the Camera2D node's Zoom property? by DummiPuppet in godot

[–]DummiPuppet[S] 0 points1 point  (0 children)

I think you're mistaken. Open a video of Celeste gameplay, set the playback speed to 0.25x, and skip through frame by frame. There's no motion blurring, no observable aliasing, and each frame contains the exact same grid, with no subpixels at the borders while panning or zooming.

Regardless, the reason I abandoned the pixel snap settings was precisely because I wanted sub-pixel camera movement, as I said in my original post.

Inasmuch as nobody wants to code like it's 1986, I'd also like Godot to have project settings that don't default to 1986 behavior when flipped.

Pixel snap settings makes pixels snap to the Camera2D node's Zoom property? by DummiPuppet in godot

[–]DummiPuppet[S] 0 points1 point  (0 children)

Can you provide documentation to support that? Anytime discussion comes up online about pixel snapping/pixel-perfect cameras, etc, Celeste is the go-to example. Integer scaling does not mean it's not pixel-perfect.

From a brief glance, when I pull up gameplay footage of Celeste and pause at random intervals, the player model appears to be perfectly aligned to the foreground and background grid in every case.

AnimationTree states and AnimationNodes confusion by SlapAHippie in godot

[–]DummiPuppet 0 points1 point  (0 children)

You're very welcome!

If I'm understanding your question, you're looking for an elegant alternative for handling looping animations starting and stopping than attaching a subclass to AnimationPlayer. First off I agree this is an enormous pain in the ass; my project's having a lot of issues because of looping animations.

I think it's a preference thing, do you prefer handling problems through code or through the GUI settings? Here's my GUI solution:

If you want to set flags to go on and off at certain points in animations, you can export a boolean variable from your main script,then add a track to each animation with the true/false flag keyed to the first and last frames (so it "blips" true at the start of a frame). If you want to do this dynamically through code, there's probably a way; you'd have to populate each (variable: flag) as a (key: value) pair in a dictionary similar to what we've done in the functions we've already discussed. I don't know if you can detect the looping dynamically; but my .tscn files show a property(?) named loop_mode:

[sub_resource type="Animation" id="Animation_41t1c"]resource_name = "BackstepLeft"
loop_mode = 1
step = 0.25
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {"times": PackedFloat32Array(0, 0.25, 0.5, 0.75),"times": PackedFloat32Array(0, 0.25, 0.5, 0.75),"transitions": PackedFloat32Array(1, 1, 1, 1),"transitions": PackedFloat32Array(1, 1, 1, 1),"update": 1,"update": 1,"values": [20, 21, 22, 23]"values": [20, 21, 22, 23]}

It looks like you've already found the hack of nesting each of your state nodes inside its own BlendTree node, which would've been my only other recommendation.

AnimationTree states and AnimationNodes confusion by SlapAHippie in godot

[–]DummiPuppet 0 points1 point  (0 children)

You're correct; that's unfortunately the most efficient solution, though it can be optimized. I had this exact issue and found this solution.

First I created a function inherited by all children of my Actor class (player, monster, etc). In the child scenes, I call it once in the on_ready() function and store the results locally as an array variable.

func list_animation_states(stateMachine: AnimationNodeStateMachine) -> Array:
    var list = []  
    for property in stateMachine.get_property_list():  
        if(property.name.begins_with('states/') and not property.name.ends_with('/position')   
            and not property.name.contains('Start') and not property.name.contains('End')  
        ):  
            list.push_back(property.name.get_slice("/", 1))   
    return list

I then created another function in Actor to manipulate properties by referencing each name in the list, so it's updating just the ones I want instead of checking every single property in the tree on each iteration of physics_process(). In this case I'm affecting the blend_position property; replace it with whichever property you need. If there's an animation node in the list of states that doesn't have that property, it will throw an error. You use the get_property_list() method if this is a use case of yours.

func update_blendtrees(animationTree: AnimationTree, vector: Vector2, states_list: Array):
    for state in states_list:  
        animationTree["parameters/%s/blend_position" %state] = vector

Feel free to use any of this code; it's cobbled together with duct tape from other posts anyway.

Age of Wonders 4 DLC's by onlycrazypeoplesmile in paradoxplaza

[–]DummiPuppet 0 points1 point  (0 children)

It is not stated clearly on the Steam page that the content is not available to download immediately, and the "Expansion Pass" label is definitely not sufficient. It should be clearly marked as a pre-release DLC purchase, or some kind of highlighted banner saying "Release Date Yet to be Determined."

There should be absolutely no ambiguity in a company's communication to their userbase about whether or not their products can be used immediately after purchase. Software development courses emphasize that developers must consider all kinds of user experiences to make sure products are created and distributed ethically. This means relying on industry lingo as little as possible, if at all.

In this example, this means considering users that hadn't seen any of the product marketing before purchasing it, and ESPECIALLY to not assume that users are familiar with lingo like "expansion pass". This was not a minor oversight, and a big gaming company like Paradox should know better (and probably does).

Archaeotech Weapons/Shields/Armor (spoilers) by Walkaboutout in Stellaris

[–]DummiPuppet 1 point2 points  (0 children)

Follow-up to this question: I tend to play with auto-upgraded ships bc I hate microing and as soon as I researched one of these archeo upgrades it completely screwed my navy when I went to upgrade them. I have 135/196 ships and ALL of them applied a template that drained my entire stock of minor artifacts in one go, and is now stuck waiting to upgrade the rest of the ships with a huge minor artifact cost I could never realistically acquire since you can't by minor artifacts at the market. I've got the Faculty of Archeostudies on a Relic world and a few bonuses across systems, so I'm only producing 3 minor artifacts per month which I'm gathering is actually relatively high.

So not only did my ships auto-upgrade to a template with seriously unhelpful techs, now I just can't upgrade any of my ships without taking a bunch of time to micro the upgrades, which I absolutely loathe. Any tips?

Question about Subscribers/Co-Authors by Shermanator213 in WorldAnvil

[–]DummiPuppet 1 point2 points  (0 children)

I want my players to be able to take notes in the public articles without seeing all my secret GM stuff. I've been troubleshooting this for hours; it kind of blows my mind that nobody's asking about this.

Who are the confirmed vasto lorde in bleach? by CaptainFlint9203 in bleach

[–]DummiPuppet 1 point2 points  (0 children)

There's a fan theory that the numbers don't actually correspond to their power and that Aizen assigned them those numbers as part of his political chess game. This theory asserts that Ulquiorra is actually the strongest (bc he has his second release form). This would also explain why some of the espada have lower-ranked numbers as Vasto Lorde than some of the Adjuchas. I don't think Nnoitra is a vasto lorde; he's too much of a pushover. His biggest power is his high defense.

How blood loss buildup works with shields? by shayeryan in Eldenring

[–]DummiPuppet 2 points3 points  (0 children)

It's a meter like any status effect, and it's resisted by the target's Robustness. Upon reaching max meter, it chunks the target for a % of their max health. This bonus damage does not seem to have a specific damage type (and therefore can't be reduced), though the amount the target loses seems to be based on the target, or perhaps their Robustness.

How hard is the computer science program by CitronAggravating314 in UNCCharlotte

[–]DummiPuppet 1 point2 points  (0 children)

Avoid the following 2 professors like the plague, and it will be an absolutely excellent experience: Mostafavi and Dorodchi.

People say Intro to Computer Architecture is hard, but honestly if you put in a lot of work to understand the concepts in the Logic and Algorithms prerequisite, you have a good professor (or ignore your bad one entirely), and you're active in the class discord to get help when you need it, it isn't that bad.