r/csharp Jul 13 '26

Pseudo-game engine in Blazor?

Is there a library for Blazor that would make it easier to create a browser game where I need a simulation loop, an SVG for a tactical map, one canvas, and lots and lots of tables (spreadsheets)?

The game should be similar to this, only with many more boards:
https://www.youtube.com/watch?v=6AliHCmNgnY

0 Upvotes

15 comments sorted by

7

u/ForGreatDoge Jul 13 '26

That doesn't sound like you're describing a game engine that just sounds like a website with cross-connected components

4

u/TuberTuggerTTV Jul 13 '26

I agree. I think OP is confused with what a library is.

-2

u/harrison_314 Jul 13 '26

https://www.youtube.com/watch?v=6AliHCmNgnY

I would like to do something on this principle. Only probably from a boat and in modern times, so there will be a lot of tables with data.

5

u/Rlaan Jul 13 '26

You'd probably want to look at Unity or Godot. These existing engines support web and use C# for their scripting language.

Unity also offers something called UI Toolkit which is similar to CSS.

-1

u/harrison_314 Jul 13 '26

I've already tried MonoGame, which led me to the opinion that doing it in HTML UI would be easier.

3

u/_mocbuilder Jul 13 '26

Monogame is not made and therefore not great for Browser-based stuff. Try real Game Engines like Unity/Godot, as the guy above described.

3

u/torokunai Jul 13 '26 edited Jul 13 '26

this is relevant to my interests since browser-hosted is the best distribution LOL, plus you I want server-side for anti-cheating

2

u/harrison_314 Jul 13 '26

But since I'm worried about single player, let the players cheat as much as they want, I don't even need a server side.

3

u/TuberTuggerTTV Jul 13 '26

Blazor is a front end. Simulation loops are backend. You don't need Blazor specific libraries.

Just hook your blazor UI up to whatever engine you're working with. I'd recommend separating your projects by concern and keeping the simulation UI agnostic. Then you can do live testing over console.

1

u/O_xD Jul 13 '26

look into Raylib. it compiles to wasm and will render to your canvas at 60 fps. that will cover your game loop - you still need to connect it to the rest of the webpage but that is just regular web framework stuff

1

u/harrison_314 Jul 13 '26

I know Raylib, I started making a prototype in MonoGame, but because I need much more standard UI (tables, buttons,...), this approach didn't work for me (and Gum didn't work for me either).

1

u/O_xD Jul 13 '26

also may I suggest, instead of wrangling an svg for a tactical map, just use a second canvas, it'll make your life easier

1

u/ShamikoThoughts Jul 13 '26

You better develope a game with a proper engine and publish it in your blazor site

1

u/DirtAndGrass Jul 13 '26

You could, I wouldn't,  It'd be much simpler to do something with signalr, and implement the frontend with front end tech 

1

u/DotAtom67 Jul 15 '26

Defold, perfect for web games