game engine to pair #64
Replies: 2 comments 1 reply
-
|
That's like exactly the type of game I'm making 🤣 It's called Stratum. You can actually play a small singleplayer demo I made for my university application (a month ago) over here: https://thereddeveloper.github.io/CGLPortfolio/demo So of course the client is made entirely with ply-engine. For the server: I'm starting on a cheap VPS, but I've already implemented pub async fn allocate_machine(db: &Database) -> Result<String, String> {
if !is_on_flyio() {
return Ok(get_machine_id());
}
match get_flyio_machines().await {
Ok(machines) => {
if machines.is_empty() {
log::error!("Not even this machine exists, what the fuck, where are all the machines?");
return Err("no_flyio_machines".to_string());
}
let mut machine_counts: Vec<(String, u32)> = Vec::new();
for machine in &machines {
match db.matches_on_machine(machine).await {
Ok(count) => machine_counts.push((machine.clone(), count)),
Err(e) => {
log::warn!("Failed to get match count for {}: {}", machine, e);
}
}
}
machine_counts.sort_by_key(|m| m.1);
for (machine, _) in machine_counts {
if let Ok(true) = is_alive(machine.clone()).await {
return Ok(machine);
}
}
log::error!("All machines are unhealthy!!!!!!!!!!");
Err("all_machines_unhealthy".to_string())
}
Err(e) => {
log::error!("Failed to get machines: {}", e);
return Err(format!("failed_to_get_machines/{}", e));
}
}
}I'm using docker-compose with My For the API I'm using For the Database I'm using I have a single file pub struct Database {
pool: PgPool // DO NOT MAKE THIS PUBLIC. ALL SQL MUST BE IN THE impl BELOW.
}
impl Database {This lets me keep it out of my actual code and reuse it. I have a Some other interesting dependencies I have in there might be |
Beta Was this translation helpful? Give feedback.
-
|
Many thanks for this and your work . Still some questions. Why actix? Do you aim web mostly that's why websocket? How that will scale for you for concurency users? If you would need.authorative movement handled too, still websocket? UDP, was you thinking about it? So Ply is aimed to be more like ui tool or full engine for apps/games? Aiming for front client part only or server stuff too? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I would like to ask as I saw your blog entry. What stack curently you would advise in rust to go for multiplayer, aauthorative small game with heavy ui and 2d gameloop.
Beta Was this translation helpful? Give feedback.
All reactions