Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nxsaken/petnat
A Petri net plugin for Bevy Engine.
https://github.com/nxsaken/petnat
bevy bevy-engine game-development petri-nets state-machine
Last synced: 2 months ago
JSON representation
A Petri net plugin for Bevy Engine.
- Host: GitHub
- URL: https://github.com/nxsaken/petnat
- Owner: nxsaken
- Created: 2023-12-28T17:49:20.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-01-16T11:52:54.000Z (11 months ago)
- Last Synced: 2024-09-28T15:03:38.952Z (3 months ago)
- Topics: bevy, bevy-engine, game-development, petri-nets, state-machine
- Language: Rust
- Homepage:
- Size: 47.9 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Rust](https://github.com/nxsaken/petnat/actions/workflows/rust.yml/badge.svg)](https://github.com/nxsaken/petnat/actions/workflows/rust.yml)
[![Crates.io](https://img.shields.io/crates/v/petnat.svg)](https://crates.io/crates/petnat)
[![Crates.io](https://img.shields.io/crates/d/petnat.svg)](https://crates.io/crates/petnat)
[![docs.rs](https://img.shields.io/docsrs/petnat)](https://docs.rs/petnat/latest/petnat/)A Petri net plugin for [Bevy Engine](https://github.com/bevyengine/bevy). 🍾
## About
`petnat` equips you with [Petri nets](https://en.wikipedia.org/wiki/Petri_net) to use in your Bevy projects.
It's a powerful way to model states, processes, resources, and more.This is a very experimental project, and I mostly started it because I wanted to play with Petri nets
and improve my Rust. I am not sure about the possible usefulness of this plugin, but I hope to discover
how I can improve it with time and usage.## Rough idea
1. Build a model using places and transitions.
2. Define a `PetriNet` resource.
3. Add a `Token` component to an entity.
4. Mark some (probably initial) places with the `Token` according to the model.
5. Fire transitions when it makes sense according to the model.
6. Implement game logic based on the current marking of the `Token`.## Examples
Examples can be found in the [`examples`](examples) directory.