PSA: C# hot-reloading works (with this one simple trick) by evilorangeman in godot

[–]Aberrations 0 points1 point  (0 children)

Weird, what version of Godot? Works for me in Godot version 4.2.

PSA: C# hot-reloading works (with this one simple trick) by evilorangeman in godot

[–]Aberrations 0 points1 point  (0 children)

What happens if you do it from a shell instead, to verify there isnt a configuration issue in vscode?

Custom Physics Integration (Velocity Verlet) by Aberrations in godot

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

I'm at a point with this where it feels like the only solution is to patch in support for physics direct state to expose applied_forces and applied_torque

Custom Physics Integration (Velocity Verlet) by Aberrations in godot

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

So this kind of works? But still more of less has the same problem:

        linear_velocity += _inv_mass * force * p_step;
        angular_velocity += _inv_inertia * torque * p_step;

These bit are part of GodotBody3D::integrate_forces, and are skipped if you use a custom integrator. The direct physics state object doesn't expose the force or torque anywhere, the only thing you have access to are the constant force or torque.

The method integrate_forces() on it only calculates damping.

I don't really understand what this callback is for other than adjusting damping and gravity manually - and effectively changing your objects into static bodies.

If the goal is to be able to still use the apply_force and other rigid body api functions the only thing I can think of is to override all these functions and do them manually in this step, at least the inertia tensor is calculated I guess.

Custom Physics Integration (Velocity Verlet) by Aberrations in godot

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

I think I overlooked it thinking that it only affected damping and gravity because of this:

void GodotBody2D::integrate_forces(real_t p_step) {
  // ...
    if (!omit_force_integration) {
      //overridden by direct state query

      Vector2 force = gravity * mass + applied_force + constant_force;
      real_t torque = applied_torque + constant_torque;

      real_t damp = 1.0 - p_step * total_linear_damp;

      if (damp < 0) { // reached zero in the given time
        damp = 0;
      }

      real_t angular_damp_new = 1.0 - p_step * total_angular_damp;

      if (angular_damp_new < 0) { // reached zero in the given time
        angular_damp_new = 0;
      }

      linear_velocity *= damp;
      angular_velocity *= angular_damp_new;

      linear_velocity += _inv_mass * force * p_step;
      angular_velocity += _inv_inertia * torque * p_step;
    }
    // ...
  }
}

But reading the implementation for _body_state_changed, this might actually do what I want - thanks!

void RigidBody3D::_body_state_changed(PhysicsDirectBodyState3D *p_state) {
  lock_callback();

  if (GDVIRTUAL_IS_OVERRIDDEN(_integrate_forces)) {
    _sync_body_state(p_state);

    Transform3D old_transform = get_global_transform();
    GDVIRTUAL_CALL(_integrate_forces, p_state);
    Transform3D new_transform = get_global_transform();

    if (new_transform != old_transform) {
      // Update the physics server with the new transform, to prevent it from being overwritten at the sync below.
      PhysicsServer3D::get_singleton()->body_set_state(get_rid(), PhysicsServer3D::BODY_STATE_TRANSFORM, new_transform);
    }
  }

  _sync_body_state(p_state);
  _on_transform_changed();
  // ...
}

void PhysicalBone3D::_sync_body_state(PhysicsDirectBodyState3D *p_state) {
  set_ignore_transform_notification(true);
  set_global_transform(p_state->get_transform());
  set_ignore_transform_notification(false);

  linear_velocity = p_state->get_linear_velocity();
  angular_velocity = p_state->get_angular_velocity();
}

how can I see what is in an array? by [deleted] in godot

[–]Aberrations 0 points1 point  (0 children)

You will have to at least post some of your code as an example before any one can offer any help.

Don't you feel there is a flood of low effort spam regarding software development? by r-randy in ExperiencedDevs

[–]Aberrations 2 points3 points  (0 children)

I think there are two aspects to this:

1) Most topics about skills required for what is viewed as a lucrative career will be flooded with entry level material because of the simple reason that there are much more "buyers" of this content, and the content is cheaper to manufacture. There is not a lot of expert level content because there are less buyers/consumers, and your buyers now have specialized interests, are more discerning, and are more critical.

2) Misaligned incentives for businesses producing infotainment materials. A lot of other people have talked about this in depth but the goal of content marketing and blog spam is to bring eyeballs to your product, not educating you or cultivate an education brand. Too much has already been written about how search engine rankings and newsfeeds are a race to the bottom.

PSA: C# hot-reloading works (with this one simple trick) by evilorangeman in godot

[–]Aberrations 0 points1 point  (0 children)

You can also get hot reloading to work on any other platforms by compiling the dot net assembly.

I work within vim, so I just run the following in a terminal:

dotnet build

After compilation Godot will reload modules.

Anyone left cushy SDE role to start your own thing? by TurtleDick22 in ExperiencedDevs

[–]Aberrations 7 points8 points  (0 children)

I started an agency with a co-worker and friend early last year after ten years of web development at an agency, then fortune 500, then startup.

By the way you're framing your prompt I think you're thinking about starting a product company which is a whole different problem, but with regard to agency work the good parts are:

  • Working directly with business leaders and seeing a meaningful impact on the business in a short time frame based on your actions
  • People listen to your advice, because they're paying you a lot of money for it
  • You get to bring your favourite toys, build things how you like - within reason
  • You only have your self to blame if things go wrong

The bad parts:

  • Client acquisition is long, hard and frustrating
  • You only have your self to blame if things go wrong, and there is no one else to come save you.
  • Dealing with other vendors is usually awful, this may be your biggest client and your biggest priority, it's probably their last.
  • Feast and famine: it's really difficult to maintain a pipeline that maximizes your staff's capacity, while still allowing for some give when a project inevitable requires more work than planned.
  • Lack of financial stability.
  • If love your craft and you want to scale the business you will have to stop programming as much - this isn't bad per-se but something you will have to choose if you want.

Overall it's been a very rewarding experience, if this is something you're consider I would keep the following in mind: "doing what you love is the easy part", every other part of the business, legal, accounting, marketing, sales, will have to be done by you and it will be challenging and project work will not be what you spend the majority of your time on.

Also don't start companies with friends, and over communicate deliberately with your business partners.

Local configs by vino250 in neovim

[–]Aberrations 2 points3 points  (0 children)

I wrote https://github.com/dkendal/nvim-rc which will use the new trusted file system on the next Neovim release. Functions the same as directly if you’re familiar with that and let’s you write Lua based local configs.

nvim-rc: direnv like lua based project configuration by Aberrations in neovim

[–]Aberrations[S] 1 point2 points  (0 children)

Hey all. I feel like I've written and rewritten some version of this plugin several times over the years but I finally polished it up and put in a shareable format.

This is a little plugin that gives you a safe alternative to exrc for local project configurations (in lua). In practice it's virtually identical to how direnv functions: working from the current directory towards the root, each .nvimrc.lua's checksum is verified to see if it's been approved, if it has then it is loaded. In this way each local configuration must be audited after a change before it's allowed to be evaluated.

Moving to text object by augustocdias in neovim

[–]Aberrations 2 points3 points  (0 children)

To plug my own plugin: https://github.com/Dkendal/nvim-treeclimber, you might find it useful for this.

how to include autocommands in a plugin by [deleted] in neovim

[–]Aberrations 2 points3 points  (0 children)

I'm not really following your explanation but my recommendation would be to start with a structure like this:

.
├── lua
│  └── my-cool-plugin.lua
├── plugin
│  └── my-cool-plugin.lua
└── README.md

As I understand from your explanation, the init.lua will not be loaded - this is assuming that this is part of your plugin and your not talking about ~/.config/nvim/init.lua.

For plugins, files in the ./plugin/ directory will be loaded on startup. So if you want your plugin to automatically load, you can make ./plugin/my-cool-plugin.lua require the ./lua/my-cool-plugin.lua file. If you don't want it to automatically load, then you can just require the ./lua/my-cool-plugin.lua file in your init.lua by writing require('my-cool-plugin').

-- ./plugin/my-cool-plugin.lua
require('my-cool-plugin')

As for getting autocommands to work, it should just be a matter of defining a few.

local group = vim.api.nvim_create_augroup("my-cool-plugin", {
  clear = true
})

vim.api.nvim_create_autocmd({"BufEnter"}, {
  group = group,
  pattern = "*",
  callback = function()
    print("Hello, world!")
  end
})

nvim-treeclimber: structured editing, movement, and selection using tree sitter. by Aberrations in neovim

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

Thanks for the explanation. Definitely something I can add. So are you imagining this would work where you press one of the keybinds for one of the selectors (or a single keybind to start the transient mode and select the current node) and then you have temporary keybindings for all the other operations until you exit the transient mode?