Project Harmonia

82 readers
3 users here now

A work-in-progress life simulation game.

GitHub

founded 1 year ago
MODERATORS
1
 
 

Itโ€™s a crate for server-authoritative networking. We use it for Project Harmonia, but it's general-purpose.

Highlights:

  • Relationships networking. Use relationships to specify which entities should be replicated in a single message.
  • Immutable components support. Replication is automatically applied via insertion for them.
  • replicate_mapped now deprecated. Regular replicate now works for all components.
  • Support for no_std and environments without atomic CAS, such as thumbv6m.

๐Ÿ“œFull changelog ๐Ÿ“ฆbevy_replicon

2
 
 

It's an input manager for Bevy, inspired by Unreal Engine Enhanced Input. We use it for Project Harmonia, but it's general-purpose.

This is a double release to make migrating to Bevy 0.16 easier for users:

  • v0.10.0 targets Bevy 0.15. It replaces the confusing GamepadStick preset with the much more flexible Axial preset, and introduces Clamp modifier.
  • v0.11.0 updates to Bevy 0.16 with no breaking changes. It adds support for no_std and per-context schedule configuration (useful for networking), which wasn't possible to implement in 0.15.

๐Ÿ“œFull changelog ๐Ÿ“ฆbevy_enhanced_input

3
 
 

Bevy 0.16 is around the corner with many exciting features!

I'm currently working on adding support for some of them in my networking crate, bevy_replicon.

I just finished implementing immutable component support.

Next up: relations! I outlined the idea in this comment. Hope I can get it implemented before the 0.16 release ๐Ÿ™‚

As for my game, I'm considering making an interesting announcement about it soon.

4
 
 

It's an input manager for Bevy, inspired by Unreal Engine Enhanced Input. We use it for Project Harmonia, but it's general-purpose.

This release contains many changes, most notably the component-based API for contexts. We've also reworked the documentation, now including a quick-start guide that walks you through the API. We would appreciate your feedback ๐Ÿ™‚

๐Ÿ“œFull changelog ๐Ÿ“ฆbevy_enhanced_input

5
 
 

It's an input manager for Bevy, inspired by Unreal Engine Enhanced Input. We use it for Project Harmonia, but it's general-purpose.

This release contains many changes, most notably the component-based API for contexts. We've also reworked the documentation, now including a quick-start guide that walks you through the API. We would appreciate your feedback ๐Ÿ™‚

๐Ÿ“œFull changelog ๐Ÿ“ฆbevy_enhanced_input

6
1
submitted 1 month ago* (last edited 1 month ago) by Shatur@lemmy.ml to c/projectharmonia@lemmy.ml
 
 

It's an input manager crate for Bevy, inspired by Unreal Engine Enhanced Input. We use it for Project Harmonia, but itโ€™s general-purpose.

I love our trigger-based API, but the push-style API needed improvement. Previously, users had to read values from a resource - unergonomic and a bit confusing.

Now, contexts are components! This makes our push-style API similar to LWIM while keeping all the trigger-based ergonomics ๐Ÿ™‚

See more details in the PR.

I recently received blessing from Alice (author of LWIM) to upstream this crate as a future Bevy input abstraction. But first, we need to polish the API - it's much easier to iterate on while in a separate crate.

7
 
 

Itโ€™s a crate for server-authoritative networking. We use it for Project Harmonia, but it's general-purpose.

A small release with improvements to the messaging backends API and ergonomics. I wanted to draft these changes before Bevy 0.16 to simplify the migration.

I also drafted a new RC release that supports Bevy 0.16 with no_std support! Nothing is feature-gated, the crate now completely no_std. Aeronet's author is working on bringing no_std support to aeronet, so you should be able to use it together with Replicon for some unusual platforms soon ๐Ÿ™‚

๐Ÿ“œFull changelog ๐Ÿ“ฆbevy_replicon

8
 
 

It's a crate for dynamic and contextual input mappings for Bevy, inspired by Unreal Engine Enhanced Input. We use it for Project Harmonia, but it's general-purpose.

After some brainstorming with Alice (the author of LWIM), I replaced trait-based context creation with triggers. It was quite a significant refactor, but defining reloadable bindings in observers is so convenient.

There are also other minor ergonomic improvements and bugfixes. See the changelog for more details.

๐Ÿ“œFull changelog ๐Ÿ“ฆbevy_enhanced_input

9
 
 

Itโ€™s a crate for server-authoritative networking. We use it for Project Harmonia, but it's general-purpose.

Notable changes

  • Connected clients are now represented as entities.
    • All related APIs are now component-based.
    • Entity is used to refer to a client everywhere, but ClientId is still present as a persistent identifier across reconnects.
    • Fast iteration and O(1) lookups.
    • Users can insert their own components or even replicate these entities.
    • Simplifies messaging backend integration.
  • Switch from bincode to postcard.
    • Better varint serialization to save bandwidth.
    • Opens the door for no_std support after the 0.16 release.

I also rewrote the quick start guide. My recent talk at Bevy Meetup #9 helped me with this. It now contains much more information, including details on how to write a messaging backend or implement client-side prediction. I also tried to make it as user-friendly as possible. Feedback about it is highly appreciated!

๐Ÿ“œFull changelog ๐Ÿ“ฆbevy_replicon

10
 
 

For the past few days, I've been working on the ultimate quick-start guide for bevy_replicon.

It now contains much more information, including details on how to write a messaging backend or implement client-side prediction. My talk at the last Bevy meetup helped me with this. Any feedback is appreciated ๐Ÿ™‚

11
 
 

Previously, I used a special ClientId type to refer to connected clients and stored their data in several resources.

I wasn't satisfied with this API and decided to try turning them into entities. Now, Entity is the identifier, and components store related data. I'm quite happy with the results, but waiting for a review from the second maintainer: https://github.com/projectharmonia/bevy_replicon/pull/423

If you have any suggestions or ideas, feel free to comment ๐Ÿ™‚

Just preparing the crate to the upcoming talk at Bevy Meetup #9. Still in a break from actual game development.

12
 
 

It's a virtual meetup about Bevy, and I will be one of the speakers!

My topic will be Networking in Bevy with ECS replication, where I'll talk about bevy_replicon and networking in general.

I'm currently focused on crates that I use in the game, just to take a small break from the project. But I hope to get back to it soon :)

13
1
submitted 3 months ago* (last edited 3 months ago) by Shatur@lemmy.ml to c/projectharmonia@lemmy.ml
 
 

Itโ€™s a crate for server-authoritative networking. We use it for Project Harmonia, but it's general-purpose.

Kinda our 30th anniversary ๐Ÿ˜… This release introduces remote triggers. The API is similar to our networked events. Hereโ€™s a quick showcase for client triggers:

app.add_client_trigger::<DummyEvent>(ChannelKind::Ordered)
    .add_observer(receive_events)
    .add_systems(Update, send_events.run_if(client_connected));

fn send_events(mut commands: Commands) {
    commands.client_trigger(DummyEvent);
}

fn receive_events(trigger: Trigger<FromClient<DummyEvent>>) {
    info!("received event {:?} from {:?}", trigger.event, trigger.client_id);
}

Server triggers have a similar API. Targeting entities is also supported.

We now also provide an example backend and examples that directly from the bevy_replicon repo. The examples have also been re-written to take advantage of the latest Bevy and Replicon features.

๐Ÿ“œFull changelog ๐Ÿ“ฆbevy_replicon

14
 
 

Refined the bindings menu for my game and ported it into a standalone example for bevy_enhanced_input.

Alice (the author of LWIM) and I quite like the main concepts of the crate, and weโ€™re planning to refine it further to create the ultimate input manager ๐Ÿ™‚

15
1
Remote triggers (github.com)
submitted 3 months ago* (last edited 3 months ago) by Shatur@lemmy.ml to c/projectharmonia@lemmy.ml
 
 

Spend last week working on remote triggers for bevy_replicon.

Tried many approaches and finally satisfied with the implementation and public API.

Client triggers example:

app.add_client_trigger::<DummyEvent>(ChannelKind::Ordered)
    .add_observer(receive_events)
    .add_systems(Update, send_events.run_if(client_connected));

fn send_events(mut commands: Commands) {
    commands.client_trigger(DummyEvent);
}

fn receive_events(trigger: Trigger<FromClient<DummyEvent>>) {
    let FromClient { client_id, event } = trigger.event();
    info!("received event {event:?} from {client_id:?}");
}

Server triggers example:

app.add_server_trigger::<DummyEvent>(ChannelKind::Ordered)
    .add_observer(receive_events)
    .add_systems(Update, send_events.run_if(server_running));

fn send_events(mut commands: Commands) {
    commands.server_trigger(ToClients {
        mode: SendMode::Broadcast,
        event: DummyEvent,
    });
}

fn receive_events(trigger: Trigger<DummyEvent>) {
    info!("received event {:?} from server", trigger.event());
}

Observers are so nice, I use them in my game a lot and not having them networked was quite limiting.

After a review from second maintainer I will merge it and draft a new release ๐Ÿ™‚

16
 
 

It's a crate for dynamic and contextual input mappings for Bevy, inspired by Unreal Engine Enhanced Input.

Actions now have a parameter that requires inputs to reset to zero before activation and continue consumption after context removal until they return to zero. This is very useful if you want to use the same input to toggle between contexts.

See the changelog for more details.

๐Ÿ“œFull changelog ๐Ÿ“ฆbevy_enhanced_input

17
1
submitted 3 months ago* (last edited 3 months ago) by Shatur@lemmy.ml to c/projectharmonia@lemmy.ml
 
 

It's a crate for dynamic and contextual input mappings for Bevy, inspired by Unreal Engine Enhanced Input.

It's a small release. I'm quite happy with the API, just wanted to make a few adjustments. Here are some highlights:

  • Replace SmoothDelta modifier with SmoothNudge. It uses StableInterpolate::smooth_nudge, which properly interpolates inputs across frames.
  • Remove InputContext::MODE. All contexts now work like InputContext::Exclusive (the default). If you want to share the same input across multiple entities, use a separate "controller" entity for a context and apply inputs to the desired entities. This approach is more efficient and explicit, so it's not worth having a special case in the crate for it.

See the changelog for more details.

๐Ÿ“œFull changelog ๐Ÿ“ฆbevy_enhanced_input

18
 
 

Getting it to compile wasn't too hard, thanks to the migration guide and deprecation warnings.

I took the time to rewrite my logic using new features like observers, fallible params, required components, picking, etc. The rewrite is massive: 98 files changed, 5197 insertions, 6303 deletions. And that's excluding Cargo.lock - it's all code.

I really like the changes. They made the code much clearer. Next, I plan some work on my crates.

19
1
submitted 4 months ago* (last edited 4 months ago) by Shatur@lemmy.ml to c/projectharmonia@lemmy.ml
 
 

Played with the lighting setup.

Switched from ACES to TonyMcMapface (Bevy's default). While ACES is very common, it forces a very specific aesthetic and makes everything look burned. TonyMcMapface is "boring", but it's good because it provides more control over the aesthetic.

I also tweaked the lighting color, adjusted the environment map intensity, and disabled bloom.

Here is the before and after.

before after

20
 
 

Over the last two weeks, I worked on walls. I needed precise placement for apartment building.

  • Added angle and length visualization.
  • Lengths and angles are now rounded (can be disabled by holding Alt).
  • Added ordinal angle snapping (can be enabled by holding Shift).
  • Simplified and optimized mesh generation.

I need a dashed gizmo style to make it look nicer. I opened an issue and it was implemented in less than 24 hours. Bevy development velocity is ๐Ÿคฏ

21
1
Undo/redo functionality (cdn.masto.host)
submitted 4 months ago* (last edited 4 months ago) by Shatur@lemmy.ml to c/projectharmonia@lemmy.ml
 
 

Finished adding undo/redo functionality for all game actions. All logic is also networked using bevy_replicon ๐Ÿ™‚

Next, Iโ€™m planning to work on house-building to create cities. I planning to implement apartment buildings first.

If you know any games where you can build apartments - let me know. Looking at prior art always helps!

22
1
submitted 5 months ago* (last edited 5 months ago) by Shatur@lemmy.ml to c/projectharmonia@lemmy.ml
 
 

When I migrated my game to bevy_enhanced_input, I added gamepad support. I figured itโ€™d be fun to see if the game could run on a device like this.

It's a pocketable handheld with SD865 running Android and only 960p display. But making it work was surprisingly easy - just needed to tweak Cargo.toml and my main function.

However, there's a catch: GilRs, the input library Bevy uses, doesnโ€™t support Android ๐Ÿ˜ข So, for now, I can only rely on touch controls, which Iโ€™ll properly support later.

Just wanted to tinker with it a little bit. Not very useful for the game at this stage, but since it's a hobby project, sometimes I just need to do something fun to stay motivated for bigger tasks.

23
 
 

Working on my game right now and making adjustments to the API along the way. This release allows attaching modifiers and conditions to sets and improves the ergonomics of the Negate modifier.

๐Ÿ“œFull changelog ๐Ÿ“ฆbevy_enhanced_input

24
 
 

Itโ€™s a crate for server-authoritative networking. We use it for Project Harmonia, but it's general-purpose.

This release, I focused on improving the API for potential rollback crates. We now have full world access in writing functions, a way to reliably check for update messages (optional and needs to be enabled by rollback crates since it costs a little more traffic), and events to react nicely to confirmed ticks.

Currently, there is only one crate in development by another developer that implements a Rocket League rollback style, which is great for physics-based games. But it would be useful to have a "classic" rollback crate, which is better suited for shooters, so maybe weโ€™ll see more rollback crates in the future!

I also improved the serialization. Replication messages are now more compact thanks to variable integer encoding, while still using a single buffer for performance.

Next I planning to focus on the game, just needed to address some feedback for my crates ๐Ÿ™‚

๐Ÿ“œFull changelog ๐Ÿ“ฆbevy_replicon

25
 
 

It's a crate for dynamic and contextual input mappings for Bevy, inspired by Unreal Engine Enhanced Input.

Some highlights:

  • Action events now have statically known types (bool, f32, Vec2 or Vec3), depending on the action configuration.
  • Assigning inputs, modifiers, and conditions now works like Bevy systems: you can pass multiple items in tuples.
  • Binding presets now structs.
  • Many ergonomic improvements for passing input.

I didnโ€™t plan all of these, but a user suggested these ideas and contributed PRs for most of them! I couldn't resist ๐Ÿ˜…

Iโ€™ve drafted two releases:

  • 0.3.0 includes all the improvements.
  • 0.4.0 updates to Bevy 0.15.0.

This way, you can address the breaking changes in 0.3.0 before updating to Bevy 0.15.0, avoiding the need to handle everything at once.

๐Ÿ“œFull changelog ๐Ÿ“ฆbevy_enhanced_input

view more: next โ€บ