Tag: rust
#
I've just one-shotted an iterator with a lifetime in #rust. Is this what it feels like when the language finally clicks?
Link:How not to learn Rust
Link: https://dystroy.org/blog/how-not-to-learn-rust/#
#gamedev progress on hotel game:
- did some further refactoring to rendering function
- added room highlighting when building new rooms and selecting bed rooms for new guests
Not sure if I should be proud or embarrassed about this #rust code :D
// mark building tile
if let Some(mut r) = match game.mouse_action {
MouseAction::BuildGrill => Some(Room::new_grill()),
MouseAction::BuildStairs => Some(Room::new_stairs()),
MouseAction::BuildBedroom => Some(Room::new_bed_room()),
MouseAction::BuildCorridor => Some(Room::new_corridor()),
MouseAction::BuildRestaurant => Some(Room::new_restaurant()),
MouseAction::BuildWineCellar => Some(Room::new_wine_cellar()),
_ => None,
} {
// rendering code
}
#
Insights from the weekend:
- Claude Sonnet 3.7 is the first #GenAI I tried out that actually produced usable code. The code is not pretty but it was the first time I was impressed by an AI system being able to produce non-trivial code and being able to adjust it to feedback.
- I should stop using #python for one off scripts to convert data. The #rust ecosystem has a similar maturity. Building such scripts takes roughly the same time in both languages, but the rust system will finish the job order of magnitudes faster.
- When your rust program feels slow you probably forget
--release.
#
#gamedev progress on unnamed hotel game:
- Spent a lot of time trying to streamline the guest AI code. This is something I still can wrap my head around entirely, partially due to #rust, mainly as this is something I never worked on before.
- Corridors and doors are now rendered in front of rooms. Rooms are only shown if someone is in them.
- Added simple buttons as start of UI.
- It's now possible to place new rooms.
#
I'm missing the vocabulary for googling this.
Is there a better way to write this? I want to filter a vector of enums to elements that match one specific pattern.
.filter(|r| match r.kind {
RoomKind::BedRoom(_) => true,
_ => false
})
Link:ECS in Rust
Link: https://ianjk.com/ecs-in-rust/Guide on how to build a simple ECS in #rust.
#
#gamedev progress:
Slow progress in the last couple of sessions. I've started to implement employees. Employees work at rooms/stations whenever a guest wants to interact with them (e.g. booking a room). I'm not yet 100% happy with the implementation (blaming my #rust skills).
Additionally implemented a hunger+restaurant prototype.
#
#gamedev progress:
I'm in the mood for game development again. This is the progress after the second evening on a yet unnamed game.
Not much yet just:
- rendering ground
- rendering rooms