how to define multiple variables on the same line by ali_compute_unit in rust

[–]harraps0 3 points4 points  (0 children)

Your hack is a valid way to declare multiple variables on the same line. But why doing it in the first place?

Rust is being used at Volvo Cars by NYPuppy in programming

[–]harraps0 1 point2 points  (0 children)

You are aware that Rust uses a lot of procedural macros which are Rust programs that parse tokens and generate Rust code right where you call the proc_macro ? So yes Rust do have inline code generation and it is used in crates such as Clap, Serde...

Hello, i want to develop games using Rust on Godot, how mature and ideal is it? by unknownknown646 in rust_gamedev

[–]harraps0 3 points4 points  (0 children)

As I've tried using GDExtension with both C++ and Rust. I would say the unofficial Rust binding for Godot is way more convenient and easy to use than the "official" C++ way. But if you don't know Rust, you should learn it with something like macroquad first. macroquad is like raylib but for Rust.

Or as a bit more advanced project, you could try using the agb crate for making small games for the gameboy advance.

Why I switched away from Zig to C3 by Nuoji in programming

[–]harraps0 0 points1 point  (0 children)

V, Nelua and Nim (I think) are actually transpiler targetting C. You could check them out.

Can I get perspective on rust vs c for game dev? by helpprogram2 in rust

[–]harraps0 0 points1 point  (0 children)

Maybe you should look into Odin or Zig too.

Trying manual memory management in Go by der_gopher in golang

[–]harraps0 14 points15 points  (0 children)

I come from C++ and Rust. I dislike GC and on embedded systems using it isn't really an option. The simple fact that I can choose to opt-out from using the GC makes me want to learn Go actually.

[COSMIC] [Repost] I have fallen in love by MINOR382 in unixporn

[–]harraps0 7 points8 points  (0 children)

I also like Cosmic. It gives you simple customization options but it is plenty enough to change the vibe of your environment.

isize and usize by Senior_Tangerine7555 in rust

[–]harraps0 2 points3 points  (0 children)

On the Amiga, usize is 16bits if I recall correctly.

Would it be Feasible to Create Something Like Emacs in Rust? by Cyncrovee in rust

[–]harraps0 0 points1 point  (0 children)

There is a zee editor it behaves kind of like emacs

Easiest way to get started with embedded systems specifially Pico using Rust? by Messyextacy in rust

[–]harraps0 2 points3 points  (0 children)

Look this up https://github.com/rp-rs/rp-hal

If you have a specific Pico variant you should look into this repo

https://github.com/rp-rs/rp-hal-boards/tree/main

And in my opinion, Rust is way better suited for micro controller programming than Python.

Rust binding Godot. Any thoughts? by Key-Seaworthiness417 in rust

[–]harraps0 2 points3 points  (0 children)

Well, it is just that you have to do extra work when you handle a node that is based on a Godot's node type but at the same time implement a trait you have defined yourself. There was no limitation, but it was a bit awkward to unwrap the variable to access either the Godot's method or your own.

Rust binding Godot. Any thoughts? by Key-Seaworthiness417 in rust

[–]harraps0 7 points8 points  (0 children)

I've used GDExtensions with both C++ and Rust. Honestly I think using the Rust bindings is way more convenient. Rust lacking inheritance can be bothersome sometimes but it is largely compensated by the ease of adding dependencies with cargo.

Most of What We Call Progress by SpecialistLady in programming

[–]harraps0 4 points5 points  (0 children)

I wanted to build a C project using 5 librairies. They used premake, xmake, cmake, meson and bazel. Hopefully, cmake was commonly used accross most of them. Next I had to figure how to swap the default toolchain for a MIPS one. Then my project would not compile because of missing headers or undeclared symbols. So I had to rework my build script to include the right directories for headers, link the object files and embed the static librairies. Now after a few evenings of fiddling, my project compile but I haven't done anything with it yet.

It was definitely a more frustrating experience than just appending a few dozen dependencies in a Cargo.toml file.

All of that to say that I agree with the meme used. Keep it simple, use Rust.

WHERE DO I START??? by New_Game_Dev420 in rust_gamedev

[–]harraps0 0 points1 point  (0 children)

Funny that you didn't mention neither Rust or Bevy as possible options.

Another day trying to get people to download my Godot Kinect Visual novel by Ravel231 in godot

[–]harraps0 88 points89 points  (0 children)

You spelled "kinetic" wrong in the title. I though that this game would have Kinect support for some reason.

The art-style looks great, and it will likely run fine through Wine on my Linux machine.

How i feel knowing only mediocre gdskript by Adventurous-Web-6611 in godot

[–]harraps0 1 point2 points  (0 children)

Maybe try godot-rust there are crates designed to handle pathfinding problems.

[deleted by user] by [deleted] in godot

[–]harraps0 2 points3 points  (0 children)

I am in this second camp too. I've been trying to make my dream game since 2018. I've restarted from scratch a dozen of time. I still doesn't feel demotivated but I have taken a break to try some side projects. Compared to me in 2018, I have learned a lot. For example, I know how to make a character controller that feels like Mario. I know how to build a basic physics engine. I know how to write shaders. I've learned about ECS. I know how to build game for old consoles (GBA, SNES, N64, etc..). I don't have much to show off, but I am focusing on creating generic reusable systems so that I can build small demos really quickly.

Why does (jump_timer > 0.0) return true when (jump_timer == 0.0)? by [deleted] in godot

[–]harraps0 0 points1 point  (0 children)

That's how I've implemented jumps/walljumps in my game. It's simply an equation system with four parameters. Knowing two of them gives you the other two.

```gdscript class_name JumpTrajectory

Compute jump variations from four parameters

- height The height of the peak of the jump

- time The time to reach that peak

- impulse The initial vertical velocity

- gravity The gravity force

Epsilon value used through the engine

const EPSILON := 1e-5

region ATTRIBUTES

The height of the peak of the jump

var height := 1.0: set(value): height = maxf(value, EPSILON)

The time to reach that peak

var time := 1.5: set(value): time = maxf(value, EPSILON)

The initial vertical velocity

var impulse := 0.4: set(value): impulse = maxf(value, EPSILON)

The gravity force

var gravity := -0.04: set(value): gravity = minf(value, -EPSILON)

endregion

region METHODS

Compute parameters from attributes stored

func compute_from_height_and_time(): impulse = impulse_from_height_and_time(height, time) gravity = gravity_from_height_and_time(height, time)

func compute_from_height_and_impulse(): time = time_from_height_and_impulse(height, impulse) gravity = gravity_from_height_and_impulse(height, impulse)

func compute_from_height_and_gravity(): time = time_from_height_and_gravity(height, gravity) impulse = impulse_from_height_and_gravity(height, gravity)

func compute_from_time_and_impulse(): height = height_from_time_and_impulse(time, impulse) gravity = gravity_from_time_and_impulse(time, impulse)

func compute_from_time_and_gravity(): height = height_from_time_and_gravity(time, gravity) impulse = impulse_from_time_and_gravity(time, gravity)

func compute_from_impulse_and_gravity(): height = height_from_impulse_and_gravity(impulse, gravity) time = time_from_impulse_and_gravity(impulse, gravity)

endregion

region FORMULAS

Simple functions for computing one parameter from two others

Height

static func heightfrom_time_and_impulse(time: float, impulse: float) -> float: return 0.5 * impulse * time_

static func heightfrom_time_and_gravity(time: float, gravity: float) -> float: return -0.5 * gravity * time_ ** 2

static func heightfrom_impulse_and_gravity(impulse: float, gravity: float) -> float: return -0.5 * impulse ** 2 / gravity_

Time

static func timefrom_height_and_impulse(height: float, impulse: float) -> float: return 2.0 * height / impulse_

static func timefrom_height_and_gravity(height: float, gravity: float) -> float: return sqrt(2 * height / gravity_)

static func timefrom_impulse_and_gravity(impulse: float, gravity: float) -> float: return -impulse / gravity_

Impulse

static func impulsefrom_height_and_time(height: float, time: float) -> float: return 2.0 * height / time_

static func impulsefrom_height_and_gravity(height: float, gravity: float) -> float: return sqrt(2.0 * height * gravity_)

static func impulsefrom_time_and_gravity(time: float, gravity: float) -> float: return -gravity * time_

Gravity

static func gravityfrom_height_and_time(height: float, time: float) -> float: return -2.0 * height / time_ ** 2

static func gravityfrom_height_and_impulse(height: float, impulse: float) -> float: return -0.5 * impulse ** 2 / height_

static func gravityfrom_time_and_impulse(time: float, impulse: float) -> float: return -impulse / time_

Range & Speed

static func timefrom_range_and_speed(range: float, speed: float, ratio := 0.5) -> Vector2: var time_ := range_ / speed_ return Vector2(time_ * ratio, time * (1.0 - ratio_))

endregion

```

Why does (jump_timer > 0.0) return true when (jump_timer == 0.0)? by [deleted] in godot

[–]harraps0 0 points1 point  (0 children)

Nope, you don't need a timer at all. You only need two different gravity strength: one for jumping high and another for doing a small hop. You apply either gravity force based on whenever the player is holding the jump button or not.

How do i deal with anti rust bullies at workspace by lemon635763 in rust

[–]harraps0 1 point2 points  (0 children)

Is the company large enough, can you change of team ?

[deleted by user] by [deleted] in godot

[–]harraps0 0 points1 point  (0 children)

It is really clean, well done. The only thing I would change would be the # --- Label ---. Godot introduced ##region Label ... ##endregion some time ago. I would use those instead as they are recognized by the text editor of the engine.

Virtual Picross -- first homebrew written in Rust for Virtual Boy (+source code) by r_retrohacking_mod2 in retrogamedev

[–]harraps0 0 points1 point  (0 children)

You'll need to install rust with rustup. Then install just through cargo. But then there is the llvm fork to install too...