@jameskim
@fruitlingvalley unwrapping the tech behind the UX part 1
Starting a series of technical posts to discuss how Fruitling Valley works behind the scenes.
😀 Part 1: Optimistic Actions
If you tap to harvest, animations and harvested fruit should be visible instantly—not 6 seconds later, when the transaction confirms.
We have around 40 types of actions to support (plant, hatch, build, collect, ...)
⛓️ A typical onchain flow looks like this:
1. Tap to harvest
2. Send transaction (~1s)
3. Wait for inclusion (~2s)
4. Wait for receipt (~ 4s)
5. Parse logs
6. Update state
That’s multiple seconds before the player sees any feedback.
For a game, that’s UNACCEPTABLE.
🍓 How Fruitling Valley works
1. Press harvest
2. *Simulate the transaction locally (< 50ms)*
3. Update state *immediately*
4. Send the transaction onchain
5. Wait for tx confirmation
6. If logs match → nothing changes
6.b. If logs differ → recompute + re-render
The player experiences instant feedback. The chain remains the source of truth.