this post was submitted on 13 Dec 2024
14 points (100.0% liked)

Bevy

269 readers
9 users here now

A community for discussion around the bevy game engine! https://bevyengine.org/

founded 1 year ago
MODERATORS
 

I’m working on a life simulation game with the working title Project Harmonia.

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!

top 2 comments
sorted by: hot top controversial new old
[–] StudioLE@programming.dev 1 points 1 week ago (1 children)

How did you implement the undo/redo logic?

I presume you don't delete the entities on undo but hide them instead? Then you can show them again if redo is triggered?

[–] Shatur@lemmy.ml 1 points 1 week ago

I have a special trait that generates a reverse command. And store a stack of commands. Here is the source.

I presume you don’t delete the entities on undo but hide them instead?

No, I do a full despawn. Just remember it's data to spawn again thanks to the mentioned trait.