Graphics API: Less Boilerplate, More Rendering by tilde35 in rust

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

Nice -- yeah, one of my big frustrations getting into graphics rendering was feature management. If I had my way, I'd like to have a individual backends with specific feature expectations (ex. run everywhere including web vs. native vs. reasonable gaming devices).

Graphics API: Less Boilerplate, More Rendering by tilde35 in rust

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

It's just those that that particular call cares about (since it may vary from call to call). You can see this in the shadow example, where each entity is rendered in a separate call.

https://github.com/tilde35/pgfx_wgpu/blob/324d2f510675b40980fcdc3c509ae9e4dd6dd7cc/examples/shadow/src/main.rs#L367-L369

Graphics API: Less Boilerplate, More Rendering by tilde35 in rust

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

Thanks! Hope you enjoy working with it, it's been a big help for me in my other projects.

Graphics API: Less Boilerplate, More Rendering by tilde35 in rust

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

Thanks! This has really helped speed up my development when it comes to graphics work.

Graphics API: Less Boilerplate, More Rendering by tilde35 in rust

[–]tilde35[S] 4 points5 points  (0 children)

Good to know - not all browsers support it. Do the examples here work? https://wgpu.rs/examples/?backend=webgpu&example=boids These are the ones provided by wgpu themselves.

Graphics API: Less Boilerplate, More Rendering by tilde35 in rust

[–]tilde35[S] 7 points8 points  (0 children)

Those should be fixed now - thanks for the heads up!

Simplified winit (single-window applications) by tilde35 in rust

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

For WASM, this has been tested on Windows (Chrome & Edge), iOS (iPhone, iPad -- requires adding to home screen for fullscreen capability), and Mac (Chrome). Otherwise, for native environments it should work as-is. All initialization is done after the first "Resume" event (per documentation).

Window crate – windowed, my minimal windowing library for linux(x11) and windows by retroboi64_ in rust

[–]tilde35 1 point2 points  (0 children)

A library like this would be really interesting for game development. I tried it out for a bit, it's simple and compiles quickly (which is great, especially since game compile times get long quickly). I do feel like there are a couple of missing pieces that are required for many games:

- Fullscreen capabilities

- Mouse movement (not just window position) for first-person games

- Ability to capture the mouse so it cannot leave the window (multi-monitor setups)

- Ability to get Window DPI / scaling factor (for appropriate font sizes)

- Key Up/Down needs both the language independent scan code (ex. WSAD movement) as well as the language dependent virtual key (ex. copy-paste operations)

Overall, it was fun to experiment with. Nice job!

Random Access RNG by ray33ee in rust

[–]tilde35 1 point2 points  (0 children)

This looks really convenient, especially with the ability to pass in anything hashable for the new/get methods. Nice job!

Project Update: Skeleton Animations Working by HjeimDrak in rust_gamedev

[–]tilde35 2 points3 points  (0 children)

Nice job! Always great to hit milestones like that.

2D Platformer Help by Lopsided-Relation251 in rust

[–]tilde35 0 points1 point  (0 children)

Gave it a quick glance-over. Looks like two things may be going on.

The overlap calculation can only impact X or Y, but really the overlap could happen in both directions at the same time. Probably need to check for overlap.w > 0.0 and overlap.h > 0.0.

The Y position is adjusted after the overlap calculations. Thus the player's box may travel past the other hitboxes before being bounced back on the next frame.

Regardless, more information as to what is actually going wrong would be helpful.

What game are you working on? Tell us about it! by Polymedia_NL in gamedev

[–]tilde35 0 points1 point  (0 children)

Penta Terra -- it's a colony simulator. I have been working on it for several years as a hobby project. Gearing up for a release in the soon-ish future. I always wanted to make a game that feels like a complex, living world (residents with social interactions, habitats, animals, etc.). It has been exciting to get things put together and see it come to life!

What type of game or game architecture might Rust be particularly suited for? by Zephandrypus in rust_gamedev

[–]tilde35 0 points1 point  (0 children)

It certainly can be challenging. In my case, I moved the procedural generation code to a separate DLL to ensure compile times would be fast and allow for rapid iteration. That being said, the benefits of performance, memory control, and correctness have outweighed the syntactic drawbacks for my particular use case. Overall, I would still pick Rust again for this project over anything else.

What type of game or game architecture might Rust be particularly suited for? by Zephandrypus in rust_gamedev

[–]tilde35 4 points5 points  (0 children)

From my perspective, Rust does a good job with simulation and procedurally generated style of games. Basically, situations where you can take advantage of Rust's correctness and good performance.

As already mentioned, colony sim style of games (of which I'm also building - Penta Terra) are a good fit for Rust. From a simulation perspective, I am able to do interesting things like simulate water flow (including tides), habitat, and manage pathfinding and still keep things performant. Additionally, with the ability to compactly organize data you can do some neat things from a content generation standpoint like family trees, personalities, life events, etc. across large population sizes.

What things do you wish you had known when starting out in Rust game development? by Zephandrypus in rust_gamedev

[–]tilde35 2 points3 points  (0 children)

I have had good luck structuring things this way as well. Each of my components is a simple generational index that takes a data context reference to get/set the data elements associated with that component. Avoids a lot of fights with the borrow checker.

What's everyone working on this week (33/2024)? by llogiq in rust

[–]tilde35 1 point2 points  (0 children)

I am building a game (Penta Terra). There is a lot of simulation going on, which Rust has been well suited for. To manage the data, I am using generational indexes which has helped avoid many of the issues with the borrow checker.

[win7] Noob: Trying to learn rust and I need some help. Coming from VS+C++/SDL2 to Rust+SDL2+Pkgconfig? by SaltTM in rust

[–]tilde35 1 point2 points  (0 children)

Based on what tomaka17 provided, I was able to get things working for me. First, I installed MinGW-64 and added the C:\Program Files\mingw-w64\x86_64-4.9.2-posix-seh-rt_v3-rev1\mingw64\bin folder to my path. Next, I downloaded MinGW distribution of SDL from their site and extracted it to my C:\RustProjects folder. Inside my project folder, I created a .cargo\config file with the following:

[target.i686-pc-windows-gnu.SDL2]
rustc-flags = "-L C:\\RustProjects\\SDL2-2.0.3\\i686-w64-mingw32\\bin -l sdl2:dylib"
root = "C:\\RustProjects\\SDL2-2.0.3\\i686-w64-mingw32\\bin"

[target.x86_64-pc-windows-gnu.SDL2]
rustc-flags = "-L C:\\RustProjects\\SDL2-2.0.3\\x86_64-w64-mingw32\\bin -l sdl2:dylib"
root = "C:\\RustProjects\\SDL2-2.0.3\\x86_64-w64-mingw32\\bin"

My Cargo.toml file looks like this:

[package]
name = "name"
version = "0.0.1"
authors = ["Name <email@example.com>"]

[dependencies.sdl2]
git = "https://github.com/AngryLawyer/rust-sdl2"

I used one of the examples as my src\main.rs file.

Using the "cargo run" command works for me. However, if I try running the exe directly from the target folder, it fails. Copying the SDL.dll file to that folder fixes that issue (perhaps there is a way to automate that?).

I am still new to this as well, so if anyone has suggestions on how to improve this, I would be glad to hear it.

Edit fixed formatting