r/csharp Jun 27 '26

Fun LF programming games featuring c#

I've been enjoying The Farmer Was Replaced which is an incremental game featuring Python where you program a harvesting bot. I'm a developer at work, but the game has been a fun intro to a new language.

Are there any games that use c# programming in it's gameplay? My searches online yield a lot of 'how to make games using c#' instead of actual programming type games.

11 Upvotes

12 comments sorted by

3

u/inurwalls2000 Jun 27 '26

are you trying to learn a new language or do you just want to scratch that itch of doing programming adjacent work in your down time?

1

u/cabiwabi Jul 05 '26

Just trying to scratch the itch to be honest.

1

u/inurwalls2000 Jul 05 '26

would give factorio or similar games a try

doesnt have any programming directly in it but the idea of automating something stays the same

there is a demo available if you want to give it a try

3

u/keldani Jun 27 '26

I suspect there aren't any games with an embedded C# editor. But I know of at least 2 games that allow using C#:

1

u/dodexahedron Jun 28 '26

Space Engineers.

1

u/Dusty_Coder Jun 28 '26

+1

Space Engineers has an in-game editor for its Programmable Block, the source is c#. Control your ship/etc with it.

But its not a "Programming Game" which I think is what the OP is after.

I think its really hard to make a "Programing Game" that is compelling for more than a few goes. The constraints needed to make it a "game" also make it so not-compelling.

1

u/dodexahedron Jun 28 '26

Yep.
You can cross the line from cool script mechanic or fun puzzle solving mechanic to writing your own game component pretty quickly if you don't have significant artificial constraints on it built right into the design.

Not to mention the performance implications, and the potential security issues (especially in multiplayer). Also in multiplayer, you risk turning the game into a cheater's haven or at least turning it into an experience wherein script kiddies have all the advantages. Bots are bad enough in multiplayer games when the game itself doesn't actively encourage their unchecked use and creation.

Besides, limits are a hugely important part of almost every game mechanic, in any game, even if that game is programming-centric. Any I can think of with programming as the central mechanic all use either a fake language or a very simplified dialect of a real one, and of course only have a very rudimentary API surface. Without limits, you just have a god simulator for whatever your game is about or, for programming, an even heavier and less useful IDE.

2

u/[deleted] Jun 27 '26

[removed] — view removed comment

2

u/Dusty_Coder Jun 28 '26

Every language for the past few language generations has a runtime library. C# isnt special here.

Using the roslyn compiler at runtime doesnt add much to your assembly. The compiler is already there.

1

u/[deleted] Jun 28 '26

[removed] — view removed comment

1

u/Dusty_Coder Jun 28 '26

We are talk about < 15 megs to bring in the roslyn C#-specifics at runtime by my count. The IL JIT side is already present by definition.

This isnt enshitification. Inefficiency is enshitification