Libove Blog

Personal Blog about anything - mostly programming, cooking and random thoughts

#

#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
}

Screen Recording of my hotel game. It shows the highlighting of available bed rooms and placing new rooms


#

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:

  • generalized character rendering to share code between guests and employees.
  • Added support for different animations. Animations are determined by the current action executed by the character.
  • Employees are now rendered with new character system.

Animation in hotel game


#

#gamedev progress on hotel game:

  • further work on sprites in new format
    • 32x32 for characters
    • 48x48 for rooms
  • added roof to the hotel
  • shirt and pants color of each guest is now randomized

Screenshot of a hotel game showing the new roofs




#

#gamedev progress:

  • game world is now rendered with a scaling. Default canvas has a size of 640x360 to nicely scale for common resolutions.
  • UI is still rendered at full screen resolution.
  • started to rework guest sprite. Choose a sprite size of 32x32 and started work on animation (4 frame walk cycle, 2 frame idle cycle)
  • Separated body parts into individual sprites to allow customizing each guest with different skin and cloth colors and hair styles.

Screenshot of an unnamed hotel game with new scaling and guest sprite. The guest sprite looks out of place.


#

#gamedev progress:

  • added two new rooms (grill and wine cellar). These will function as extensions of the restaurant in the future.
  • employees now "reserve" work stations to avoid multiple employees going to the same station
  • restaurant visitors now have to be seated by employees.