Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tung/ruggrogue
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.1
Choose a base ref
...
head repository: tung/ruggrogue
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 6, 2022

  1. remove why not use systems part of entity component system book chapter

    Shipyard creator @leudz correctly pointed out that the entire
    justification in that section was incorrect, so comment it out for now.
    
    There was a real reason that RuggRogue preferred functions over systems,
    but it definitely wasn't whatever was written here.
    tung committed Jul 6, 2022

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Copy the full SHA
    02ad1cd View commit details

Commits on Aug 10, 2024

  1. Copy the full SHA
    164ff83 View commit details
Showing with 9 additions and 5 deletions.
  1. +2 −0 README.md
  2. +7 −5 book/entity-component-system.md
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# RuggRogue

itch.io: <https://tungtn.itch.io/ruggrogue>

Website: <https://tung.github.io/ruggrogue/>

Fight monsters and find loot as you battle your way to the bottom of the dungeon!
12 changes: 7 additions & 5 deletions book/entity-component-system.md
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ In the object-oriented style of modelling game data, problems like this end up p
Game data modelled with entities and components instead avoids both of those issues; see Catherine West's RustConf 2018 closing keynote ([video](https://www.youtube.com/watch?v=aKLntZcp27M) and [notes](https://kyren.github.io/2018/09/14/rustconf-talk.html)) for more information.

In a game built fully in the ECS-style, *systems* are just functions that manipulate groups of entities according to what components they have.
However, RuggRogue mostly does *not* use Shipyard's systems, for reasons that will be discussed later.
<!-- However, RuggRogue mostly does *not* use Shipyard's systems, for reasons that will be discussed later. -->

## Shipyard 0.4

@@ -282,6 +282,7 @@ let (player_id, weapon_id, armor_id) = {

This pretty much covers all of the ways that RuggRogue uses Shipyard to handle its own game data.

<!--
## Why not use Systems?
As mentioned earlier, RuggRogue uses Shipyard for entities and components, but it mostly does *not* use its systems.
@@ -343,7 +344,7 @@ fn my_subsystem(cs: View<C>) {
{
world.run(|bs: View<b>| {
// do stuff with bs...
world.run(my_subsystem); // <-- Can't borrow 'world' twice!!!
world.run(my_subsystem); // <- Can't borrow 'world' twice!!!
});
}
```
@@ -370,15 +371,15 @@ fn my_sub_subsystem(ds: &View<D>) {
// do stuff with ds...
}
fn my_subsystem(cs: &View<C>, ds: &View<D>) { // <-- Getting longer...
fn my_subsystem(cs: &View<C>, ds: &View<D>) { // <- Getting longer...
// do stuff with cs...
my_sub_subsystem(ds);
}
{
world.run(|bs: View<B>, cs: View<C>, ds: View<D>| { // <-- Getting longer...
world.run(|bs: View<B>, cs: View<C>, ds: View<D>| { // <- Getting longer...
// do stuff with bs...
my_subsystem(&cs, &ds); // <-- Getting longer...
my_subsystem(&cs, &ds); // <- Getting longer...
});
}
```
@@ -407,6 +408,7 @@ fn my_subsystem(world:&World) {
RuggRogue works with many different component types and functions that call each other, so `world:borrow` ends up being much easier to use most of the time.
`world::run` tends to be used with small, self-contained functions that don't call many other functions.
-->

## Conclusion