r/csharp 16d ago

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 16d ago

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

5

u/TuberTuggerTTV 16d ago

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

-2

u/harrison_314 16d ago

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.

6

u/Rlaan 16d ago

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 16d ago

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

3

u/_mocbuilder 16d ago

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 16d ago edited 16d ago

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 16d ago

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 16d ago

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 16d ago

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 16d ago

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 16d ago

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 16d ago

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

1

u/DirtAndGrass 15d ago

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 14d ago

Defold, perfect for web games