Space Engineers

Space Engineers

View Stats:
C#
Is coding in C# worth it?
< >
Showing 1-15 of 16 comments
Jack Schitt Mar 10, 2024 @ 6:41am 
I've been struggling to learn it for a very long time. I, personally, haven't been able to come to understand it. It has many other uses other than for this game. To my knowledge it's a versatile language that's used for thousands of different purposes, much like C++ is.

Here is a free course for it. Keep in mind Space Engineers use of the C# language only uses certain parts of it. That is, again, from what I understand about what we can do with it in this game in particular.
https://www.freecodecamp.org/news/learn-c-sharp-programming/
Shillelagh Mar 10, 2024 @ 7:31am 
Mostly in my experience, yes.
ShadedMJ Mar 10, 2024 @ 8:03am 
Depends on your definition of worth it.... By the phrasing of your question, my guess is not worth it for you. Scripting takes effort and determination.

I write a lot of scripts for players. My post history has many of them. I am against the notion of charging players for scripts.

Within the game, I don't use scripts made by others and write them myself. There are various controller blocks, and scripts in the workshop to do quite a lot. The game has been around for a while now.

C# is MIcrosoft's version of Java (not JavaScript). C# from Microsoft is version 12 but Space Engineers is using version 6 from 2015 and is in a restricted environment. If you want real-world credit/experience for writing code then Space Engineers is the wrong way to do it.

Though if you want to get into scripting in Space Engineers, I and others can point you to resources to get you started. Its all free.
Last edited by ShadedMJ; Mar 10, 2024 @ 8:05am
~WiFiEmoGirl~ Mar 10, 2024 @ 9:30pm 
Originally posted by ShadedMJ:
By the phrasing of my question, you have judged semi-correctly. I am unsure what all you can do in this game with C#. With the AI blocks and EC, automation is very easy to acquire. I do not know all that C# can do in game.

I do not intend on using it for any real-world anything, just in Space Engineers. If I wanted for real-world use I would use unity (i think they use C#), but being a gamedev seems like an absolute nightmare, so ♥♥♥♥ no.

For comparison, I used to play Stormworks and used microcontrollers extensively. I used a lot of "logic gates" and other similar options, however I did occasionally use Lua (usually to simplify mathematical processes, and improve or maintain the efficiency of the microcontroller)--of which I did for fun, not experience or others.

However, I was curious to learning C# for SE as SE is a vibrant game compared to Stormworks. It was already a pain in the ass to learn (mainly due to lack of motive)--the easiest programming language--Lua, and even then I have not "learned" the entire programming language. Although, because microcontrollers are near-essential for any "advanced" vehicle in Stormworks, learning bits and pieces of Lua was well worth it.

On the otherhand, I am completely blank on what I could use it for in SE. Especially with scrips being unavailable on servers, I feel like learning C# for them would be mundane. The least I want to do is "learn" C#, and then have it not be useful in SE.

Last edited by ~WiFiEmoGirl~; Mar 10, 2024 @ 9:34pm
Originally posted by ShadedMJ:
C# is MIcrosoft's version of Java (not JavaScript). C# from Microsoft is version 12

Er... not quite. It's more along the lines of Microsoft's attempt to apply Java's concepts, features and workflow to C++'s syntax and data structures.

That's actually a bit of the issue here. As someone with experience with the C family of languages including C++ and embedded C for Texas Instruments MSP and Atmel AVR microcontrollers, I can say with experience that the C family in general is tricky to learn, at least at first. Keen probably should have looked into a Python implementation for in-game scripting, honestly, since it's less held back by the limits of programmable blocks and a lot easier to work with.

Originally posted by Cat:
It was already a pain in the ass to learn (mainly due to lack of motive)--the easiest programming language--Lua

Lua's... weird. It's not really a true programming language so much as it is a scripting and definitions syntax standard. Every Lua implementation is different, and it's because the available functions for those implementations are specific to the program you're using them with.
Jack Schitt Mar 11, 2024 @ 12:05am 
The debate this thread is turning into is off-topic and irrelevant to the question Cat asked.
Is it worth it? If you want to write your own scripts for the game: Yes.
If you just want to put things together and have them work: No. There's probably already a script on the workshop we can find and use that already does it.

In my opinion, because of how the use C# being limited by what the game allows us to do with it, Easy Automation is probably our best option if we don't already know C#.
~WiFiEmoGirl~ Mar 11, 2024 @ 12:21am 
Originally posted by Jack Schitt:
Is it worth it? If you want to write your own scripts for the game: Yes.
If you just want to put things together and have them work: No. There's probably already a script on the workshop we can find and use that already does it.

In my opinion, because of how the use C# being limited by what the game allows us to do with it, Easy Automation is probably our best option if we don't already know C#.
Similar to Stormworks' microcontrollers, I enjoy understanding and being able to fine-tune or change the functionality of microcontrollers. With that being said, it seems worthwhile, if translated to Space Engineers. However, if C# is limited in instrumentation and/or usability, then it may be a waste of time.

Now, I wonder how 'Easy Automation' compares to my statement. Would it allow modification for my needs, or would I be better off attempting to script whatever I need?
Last edited by ~WiFiEmoGirl~; Mar 11, 2024 @ 12:22am
ShadedMJ Mar 11, 2024 @ 5:17am 
Originally posted by Cat:
... On the otherhand, I am completely blank on what I could use it for in SE. Especially with scrips being unavailable on servers, I feel like learning C# for them would be mundane. The least I want to do is "learn" C#, and then have it not be useful in SE.
Almost everybody does it reverse to your method, they have a goal, and look through the workshop. They either find what they want, or don't find the right thing, then they either learn script programming or ask someone who does. Why learn scripting when the task has already been done by 10 people before you that put the solution in workshop?

Is it worth it for you? With just that, it sounds like you haven't played the game a lot. If you'd study the game, you'd know your answer. In order to make scripts, you need to know the mechanics of the game. Doesn't sound like you have. Its probably going to be a year to get the basics working at best. You ready to commit to that?

As such, scripts are not allowed on most servers because it is very easy to make a script that is inefficient. That causes lag for ALL the other players. It takes effort to make efficient scripts. I'm on a server now with scripts enabled and I'm pretty sure one player is using a script that is causing lag and the server is useless to me with that player on.
Last edited by ShadedMJ; Mar 11, 2024 @ 5:28am
Jack Schitt Mar 11, 2024 @ 5:28am 
Originally posted by Cat:
Originally posted by Jack Schitt:
Is it worth it? If you want to write your own scripts for the game: Yes.
If you just want to put things together and have them work: No. There's probably already a script on the workshop we can find and use that already does it.

In my opinion, because of how the use C# being limited by what the game allows us to do with it, Easy Automation is probably our best option if we don't already know C#.
Similar to Stormworks' microcontrollers, I enjoy understanding and being able to fine-tune or change the functionality of microcontrollers. With that being said, it seems worthwhile, if translated to Space Engineers. However, if C# is limited in instrumentation and/or usability, then it may be a waste of time.

Now, I wonder how 'Easy Automation' compares to my statement. Would it allow modification for my needs, or would I be better off attempting to script whatever I need?

That's my thought and suggestion; If you're only planning to use C# coding to write scripts for this game in my opinion it's a waste of time to learn the full suite of the language because Space Engineers doesn't use the entire suite.

I don't have Stormworks but I watched a few minutes of a tutorial on microcontrollers for that game. No. It's not the same. Microcontrollers for Stormworks seems to only do logic. Easy Automation for Space Engineers does everything a script can do easier than writing a C# script. An example:

This is a C# script that turns any light named "MyLight" off:
IMyInteriorLight light; public Program() { light = GridTerminalSystem.GetBlockWithName("MyLight") as IMyInteriorLight; } public void Main(string argument, UpdateType updateSource) { light.Enabled = false; }

Doing it with Easy Automation:
@LightOff { OnOff_Off MyLight }

It's a much easier using EzAuto to write scripts and automate things without using any timer blocks at all. We can use EasyAuto to do multiple things with one snippet of code:
@Example { OnOff MyLight OnOff_On Thruster Open of Door 2 = False Delay 3000 Depressurize of Airvent = True

The EazyAuto script above toggles any block named MyLight on if it's off and off if it's already on. It also turns all blocks named Thruster ON, closes any door named Door 2 then waits 3 seconds (for the door to close) and pressurizes the room with any airvent named Airvent.

Doing all that with a C# script would be much more involved, more lines of code, and a crapload more complicated for someone if they don't know C# code very well.

And, yes, Easy Automation is specifically and only for this game. C# has a plethora of uses it can be used for to write programs to do.
Last edited by Jack Schitt; Mar 11, 2024 @ 5:39am
Jack Schitt Mar 11, 2024 @ 5:38am 
Originally posted by ShadedMJ:
Almost everybody does it reverse to your method, they have a goal, and look through the workshop. They either find what they want, or don't find the right thing, then they either learn script programming or ask someone who does.
...OR... they use Easy Automation if they know it exists. I know I've seen similar scripts too that do basically the same thing as Easy Automation does that some players might use instead but I don't remember what that one's called.

Originally posted by ShadedMJ:
Why learn scripting when the task has already been done by 10 people before you that put the solution in workshop?
:) the same point I was trying to make.
Mollymawk Mar 11, 2024 @ 7:12am 
Originally posted by Cat:
Is coding in C# worth it?

The gains are without question.

But the cost varies for each person:

I've been thinking in code since the early 80's so for me to get something working in a day or two of tinkering is fine and fun.

If I had to make cool stuff in Space Engineers by writing French Poetry then I maybe would not bother and would just use other peoples poems from the workshop.

Jam apple Mollymawk. Jab it England.
Last edited by Mollymawk; Mar 11, 2024 @ 7:15am
If you're looking to learn C# and want a fun way of creating solutions, C# scripting in Space Engineers might be interesting. Learning C# just to program scripts in SE? That's not a huge return. But to each their own.

Having some experience in another language, even BASIC helps when trying to learn the concepts of programming C# scripts in SE. Jumping in cold might be a bit challenging.
Short answer: Yes.

Long answer: I learned C# (and programming overall) by starting off with the game's programmable block, and eventually moved up to mod scripting. Even with many of the new automation blocks being able to close the gap on stuff you can do without scripting, there's still a lot of stuff that's either easier to achieve with scripting (ie not adding block-bloat to your grid), and some stuff that's still only really possible with scripts.

I've mostly moved on from Scripting/Modding in SE, but the time I spent with it resulted in me learning a real skill that I'm able to apply elsewhere (ie game dev, etc).
Kimo Mar 11, 2024 @ 4:57pm 
Originally posted by Cat:
Is coding in C# worth it?
All the good arguments here!
I'd like to point out on the learning curve.

I learned Basic as a kid on a C64 40 years ago. Learned MS-DOS on 386, after a longer break PHP, started with Phyton, did some hacks in Java, C+ ... for private projects like homepages, databases, games, ... MS Visual Basic I used in a professional context.

After all, I can read code and write simple things on my own. But mostly I change existing code to my needs or bring different snippets together. I'm not a programmer! I can tinker with code. That C64 was the best thing my Dad could buy.

Writing "good" code (short, sweet, performant; yes, code can be sexy!) is a project of several years of learning. Because experience, experience, experience. I myself played guitar instead.

Having that said: all coding was a brillant help NOT being a computer's slave, to understand how and what computer do when.

I encurage everyone to learn some programming: good for brain training, logic, technical independency and competence throughout life. SE can be a good motivation, I guess. :) But without experience in other languages the start will be steep. It's C~.

First you need to theoritically understand the syntax and how variables work (studying). Then read simple code and start expanding it in a simple way, or add another code snippet to work together. So you'll get the hang of it by doing.

If you want to play and automate SE, use Easy Automation.
If you want to expand your understandings, learn to code -- but it's gonna be a longer ride. There is no highway to coding. But many tutorials and Google searches.

I felt like I wanted to know this if I were you. :)
Originally posted by Jack Schitt:
The debate this thread is turning into is off-topic and irrelevant to the question Cat asked.

What debate? I was just clarifying things, and also making an observation about Keen's choice of scripting language.
Last edited by A Fat, Angry Serval; Mar 11, 2024 @ 6:36pm
< >
Showing 1-15 of 16 comments
Per page: 1530 50

Date Posted: Mar 9, 2024 @ 10:32pm
Posts: 16