188 points · by lukastyrychtr · 6y ago · 54 comments
[0] Of course, for smoothness/convenience one could do some basic checks on the client.
Your techniques may work for you but don't make the mistake of thinking they're universal.
For example, in the online multiplayer version of Ludo I'm currently building, I trigger the die roll animation on the client but the actual dice are rolled on the server, which then calculates what moves are possible based on the game state and sends that + the value of the roll to the client. The client doesn't know anything about the rules of Ludo, it simply knows how to parse and render the move format as well as send the ID of the picked move to its source of truth (in this case, the server).
I also appreciate the load testing! For the curious, we're at 30 open rooms, and I'm seeing:
- 0.0 server load
- 2.6 MB of RAM used by nginx + its worker process
- 4 MB used by pont-server
The rooms persist as long as there's at least one connected player in them. Exiting + rejoining a room under the same name will let you continue to accumulate points under that name.
(Rejoining isn't perfectly seamless: you won't necessarily be dealt the exact same hand, and if you exit + rejoin while it's your turn, your turn will be skipped)
Here is a Svelte starter template for Rust (webasm) + Svelte:
I started such a thing a while back, but progressively decided the design wasn’t right for Rust, and so headed in a somewhat different direction, and then shelved the project after deciding to implement what I had had in mind differently.
`import module from './crate/Cargo.toml'`
from Svelte directly, and get Hot Module Reloading for free ?
I'm using a very similar architecture for https://boardgamelab.app/.
The WebAssembly performance boost will make a difference once I've implemented MCTS bots for the platform.
Do you have the option to generate different bot difficulty levels?
The basic version just uses Monte Carlo Tree Search and the game's victory condition to play the game. This won't result in a very strong bot for most games, but is a reasonable opponent to play your game against (which is very useful when designing a game).
Options to make the bot stronger involve giving it hints and shorter term objectives.
As someone interested in Rust but not currently using it, what is the state of async? An expansion on the bullet points following regarding runtime scope would be interest.
You can get into a state where there are no valid moves though: https://imgur.com/1WLufcx
I considered adding some kind of fix for that, but a fresh game is a mere refresh away, and I liked the opinion on Board Game Geek [1]:
> It's probably also worth noting that if this happens then all players involved need to re-visit some ideas of basic strategy.
[1] https://boardgamegeek.com/thread/861192/if-game-stuck-perfec...