1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

[Beta] Space Engineers Workbench - A feature rich IDE for Space Engineers program development.

Discussion in 'Programming (In-game)' started by King, Dec 3, 2015.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. King

    King Trainee Engineer

    Messages:
    50
    Hello all. My name is Tim and I'm a professional and hobbyist software developer. I had posted my original thread in the modding forum, but I think this forum may be more appropriate. For the last few weeks, I've been developing an IDE specifically tailored for writing Space Engineers programs. I've made a lot of progress in the last week and I feel like it is fairly stable and ready for a beta release.

    I'm the only one developing it and it's in my spare time, so one thing I'm really lacking in is testers. I know some more experienced developers are going to have their own setup in Visual Studio all figured out, but my goal is to provide a more lightweight solution. There are a number of features that could make the tool better and aren't yet implemented, but it's a step in the right direction. I feel like Space Engineers has a good future and getting past the hurdles of installing and configuring Visual Studio can open the door to a lot more would-be script developers.

    I also have my own idea of how things should be, but that isn't always the best way. Input from experienced and inexperienced users alike would be invaluable. And keep in mind, the UI may seem intimidating to some at first, but I just have every window open in the screen shots for annotations.

    So, without further adieu, here is a list of features and resources (mostly copied from the dev site).


    Description:

    SE Workbench is a development environment designed to help facilitate the creation and organization of in-game scripts, out of game. The focus of this project is to provide most of the tools one would expect from a development platform without the hassle of configuring Visual Studio. The goal is to overcome technical hurdles and make scripting in Space Engineers something anyone can begin learning to do, regardless of their background or experience.


    Features:
    • Syntax Highlighting and Auto-Completion.
    • Functions as an out-of-game script checker that builds scripts based on the limitations set forth by Space Engineers.
    • Script collections that allow the developer to separate larger scripts into multiple files and folders.
    • Inclusions allow developers to include the contents of other scripts in their current program.
    • Blueprint program importing and editing.
    • Basic integrated IL viewer for allowed namespaces.
    • Script Organization using a directory structure.


    Screenshots:

    https://raw.githubusercontent.com/gilgame/SEWorkbench/master/Doc/seworkbench-1.png
    https://raw.githubusercontent.com/gilgame/SEWorkbench/master/Doc/seworkbench-2.png


    Site: https://github.com/gilgame/SEWorkbench
    Download: https://github.com/gilgame/SEWorkbench/releases

    Bug Reports and Feature Requests: https://github.com/gilgame/SEWorkbench/issues
     
    Last edited: Apr 17, 2016
    • Like Like x 8
  2. Sinbad

    Sinbad Senior Engineer

    Messages:
    2,788
    Ooooh, ill try this out tonight. I've been using notepad++ so far. I tried visual studio and almost instantly hit a 50 foot wall of 'I don't know what I'm doing'
     
    • Like Like x 1
  3. Neunzehn

    Neunzehn Trainee Engineer

    Messages:
    58
    I've opened it up and tried one of my unfinished project. It works as a charm. I guess the next step would be adding an in game environment for the scripts since you never know what kind of ships your scripts are run on.
    ----------------------------
    P.S. Could you add auto formatting?
     
    Last edited: Dec 3, 2015
    • Like Like x 1
  4. Hellothere!

    Hellothere! Apprentice Engineer

    Messages:
    412
    Will definitely test this later today.
     
    • Like Like x 1
  5. Malware

    Malware Master Engineer

    Messages:
    9,867
    Dammit you beat me to it!
     
    • Like Like x 2
  6. Sinbad

    Sinbad Senior Engineer

    Messages:
    2,788
    competition is good! keep going anyway. im still making a planetary GPS even though Pennywise beat me to it.

    had a quick play with it, looks good so far. doing hardware development tonight, ill have a better try this weekend when i get into scripting the new beast :)
     
    • Agree Agree x 1
  7. King

    King Trainee Engineer

    Messages:
    50
    Do you mean something like this? Since I'm already using a lot of SharpDevelop's code, I can see how they're doing it and implement that. I don't think it'll be too difficult. I'd also like to add the ability to just remove trailing white space. That's one of the ones that annoys me =D

    And while I'm here, I'd like to mention to every one that all the text editor options will eventually be configurable, such as font type and size, tabs versus spaces, etc (even formatting). I just haven't gotten to it yet.
     
  8. King

    King Trainee Engineer

    Messages:
    50
    Or join up! I wouldn't mind sharing some of the workload :)
     
  9. Neunzehn

    Neunzehn Trainee Engineer

    Messages:
    58
    yeah. I have to format my own code coding in SE environment and its pretty annoying considering other coding I did never require such.
    Another thing I figured might be a good feature is that add smart class link between scripts. You need to copy and paste every single class in SE, but with your marvelous invention maybe we could do something like include<class.h> when coding and if you import it into SE somehow it automatic copy every class for you.
     
  10. King

    King Trainee Engineer

    Messages:
    50
    When you run a script in a script collection, it will compile the contents of every file in the collection into a single tab window. Or do you mean in a broader, general scope?
     
  11. Neunzehn

    Neunzehn Trainee Engineer

    Messages:
    58
    That could work, but that's not what I mean. I tend to write a separate class for every type of blocks I used, and every time I need to include those files into a project and copy paste them into SE. You know, encapsulation and reuse of code. I know it's sounds like a minor issue, but that is what I meant.
     
  12. posthy

    posthy Apprentice Engineer

    Messages:
    122
    Good job, looks very promising. But I already have a feature request if I may :) Please highlight all occurrences of a selected word! Visual Studio and Notepad++ does that and it helps a lot to find where do I use a variable.
    Also bracket pair highlighting would be useful.
     
    Last edited: Dec 4, 2015
  13. King

    King Trainee Engineer

    Messages:
    50
    I see what you're saying and it makes sense. Scripts in the sense of Space Engineers are all separate programs with no reference to each other, and that would make reusing code cumbersome. Over time, we're going to end up with the same, small reusable bits over code copied and pasted in many different places. That'll make it hard to keep track of unless you're keeping a master copy elsewhere. And if you make changes to that master copy, you'd have to update every other script that uses it.

    If you're only maintaining a couple scripts, it is trivial, but it's almost a necessity in scalability. Huh, kinda like OOP. :D


    Okay, I gave it some thought and I'd like to avoid using some sort of include directive in each file. It's easy, but having a references section in the project would make more sense because otherwise there will just be a lot of repeating "include <somefile>" in every file in the project. I'll think some ideas over a bit and see where I end up. Thanks for the input!
     
  14. Sinbad

    Sinbad Senior Engineer

    Messages:
    2,788
    @King ok, been using this for a few hours, and i have a request and a suggestion,

    the request is:
    can the autocomplete suggestions be made to require a specific key press (like enter?) to insert the suggested text (opt in, rather than opt out with 'Esc')? i keep typing 'if' then a space and it replaces it with IFormatProvider. i also have the unfortunate habit of naming acceleration variables as Acc, so when i type 'Acc=' it inserts 'AccessViolationException=' i like auto complete as a feature so i would prefer to leave it enabled, but the way it works now slows me down more than it helps.

    the suggestion is:
    forgive me if im just missing an existing feature or use strange terms here; can the library be used to create discrete methods as indevidual files, named for their methods, then they are assembled as the project for a complete script.
    so we could make a Main file, and a couple of other methods, as well as a Class file for objects and properties declared outside main.
    then when viewed as a project, the editor builds a complete script by inserting Main, then any Methods in the library Main calls, then checks the class file for any objects or properties that main or the other methods use, and inserts those at the top. the generated file would be the completed script.
    that way we could maintain a library of modules and class properties that can be viewed and edited with ease, but are only included in the final script if the main method actually uses them.
     
  15. DON78

    DON78 Trainee Engineer

    Messages:
    51
    BUG: When opening a project on a mapped drive (from a nas) the program crashes

    beside of that: the thing i always wanted! thumbs up!

    Regards DON
     
  16. King

    King Trainee Engineer

    Messages:
    50

    Hey, I'm glad to hear people are trying it out. :)

    Actually, I think the problem you're running into is that you're typing "if" outside the scope of a method. Each script file needs to be either a member, enum, nested class, or the like.

    This will show "if" appropriately in the code completion window:
    Code:
    void Main(string argument)
    {
    if
    }
    

    While this will show "UriFormat" in the auto complete (which is correct given the scope):
    Code:
    void Main(string argument)
    {
     
    }
    if

    Because of the way the auto complete works, every file is a nested segment of code within a class. This is what the code looks like that is wrapping your script:
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Sandbox.ModAPI.Ingame;
    using Sandbox.ModAPI.Interfaces;
    using VRageMath;
    using VRage.Game;
     
    public static class Script
    {
    	public static IMyGridTerminalSystem GridTerminalSystem = null;
     
    	// start of your code file
    	void Main(string argument)
    	{
    		// logic in here is okay
    	}
    	
    	// objects out here is okay
     
    	// end of your code file
    }


    I may not be explaining it very well, but currently, you can add an item to a project called a "collection." The code in each file within a collection is compiled into a single resulting script when you press F5 with any one of them open in the editor. These files also have the benefit of sharing the code-completion. Meaning, a method called "DoSomeStuff()" in one file, can be accessed in your Main() method in a completely different file. As long as they're contained within the same "collection."

    Down the road I'll probably add a right click menu option in the Project Explorer to "build" the collection without any of the files currently open.

    I hope that sheds some light.


    Edit: Oh, and regarding the last bit, "we could maintain a library of modules and class properties"

    Neunzhen suggested roughly the same thing, so I've added a feature request here with a small description. I agree that it would be very useful, similar to including external libraries in a Visual Studio project.
     
    Last edited: Dec 5, 2015
    • Informative Informative x 1
  17. King

    King Trainee Engineer

    Messages:
    50
    I'm not able to reproduce this. I moved a demo project over to a NAS, with a path that looks like this: \\org-nas1\pathto\myproject\myproject.seproj

    I also changed all the paths in the project file to match that structure. I was able to open the project, add files, and see that changes to the files on the NAS.

    The only reason I copied one instead of creating a new project is because I didn't set up a network drive on this box with a drive letter, so the NAS isn't reachable through the current New Project dialog.

    What does the path look like to the project you're opening up? Either way, I'm eventually going to move all the IO code to a wrapper with better error handling, so if I can't figure it out, we can at least get a message about what it's choking on.
     
  18. Sinbad

    Sinbad Senior Engineer

    Messages:
    2,788
    @King, I think that is my autocorrect issue, I write top to bottom, rather than between the brackets: I don't add method closing curlies until I'm done writing the method.
     
  19. DON78

    DON78 Trainee Engineer

    Messages:
    51
    hmmm ... i can't reproduce it anymore, too. The only difference in my local setup is, that i mapped the NAS-drive on a driveletter.

    P:\Scripting\SE\SEWorkbench\ScanSensors\ScanSensors.seproj
     
  20. King

    King Trainee Engineer

    Messages:
    50
    I added some error handling for opening a project in the build I uploaded last night. If it happens again we'll get an error message this time. Honestly it was an oversight. I temporarily wrapped most of the other IO operations in a try/catch. Not sure why I missed that one.
     
  21. haibusa2005

    haibusa2005 Trainee Engineer

    Messages:
    40
    It doesn't start for me. Windows 10, laptop HP h6p53ea. Run as administrator doesn't make a difference. The process Gilgame.SEWorkbench.exe appear in task manager for a couple of seconds and then disappears. Updating .net framework doesn't help. I will be happy to point me in some direction.
     
  22. King

    King Trainee Engineer

    Messages:
    50
    Do you have Space Engineers installed on the machine you're running it on? Also, are you running anti-virus? It runs for a couple seconds because it's attempting to find and copy over some of the Space Engineers DLL files. So if it keeps doing that, the copy failed.I may need to change to program to request elevated privileges when copying them. Until then, if it's Anti-virus blocking its operation, you may need to add an exception for the workbench exe.
     
  23. gothosan

    gothosan Junior Engineer

    Messages:
    723
    I want to try it but when I attempt to run it the program close and the event recorder say there is a problem...
     
  24. gothosan

    gothosan Junior Engineer

    Messages:
    723
    windows event log says System.NullReferenceException in Gilgame.SEWorkbench.Program.GetSandboxPath() and Gilgame.SEWorkbench.Program.Main(System.String[])
     
    • Like Like x 1
  25. IcedLance

    IcedLance Trainee Engineer

    Messages:
    17
    I believe IDE requires SE to be installed on the machine, it was mentioned in readme file in beta1, which somehow didn't make it to beta2 package, but still available on project page.
    At least that's how I got that error.
     
  26. gothosan

    gothosan Junior Engineer

    Messages:
    723
    Obviously I have SE installed on my machine, I have disabled firewall and anti viruse and still it won't run :(
    is there a specifice place where I should extract the files from the zip file?
     
  27. IcedLance

    IcedLance Trainee Engineer

    Messages:
    17
    Nope, I'm afraid it's something only creator can help with as I don't know how this IDE looks for SE installation, but maybe manualle fetching libraries from game folder will help.

    Just in case some files are missing or idk, here's a copy of working SEToolbox folder:
    https://www.dropbox.com/s/1wbl4dgty869m9k/SEWorkbench_MyCopy.zip?dl=0
    Sorry, I'm too lazy to check if it's any different from one on my laptop, where I get same error as you. Just checked with stock .zip and there's at least twice as many files.
    Ofc it'll become outdated with next patch since it's supposed to grab files from game folder.
     
    • Like Like x 1
  28. Krypt

    Krypt Junior Engineer

    Messages:
    584
    Why I need to use this app instead of Visual Studio?
     
  29. gothosan

    gothosan Junior Engineer

    Messages:
    723
    @IcedLance tried still dont work.. I have windows 8.1 and even with highest priviliges as well as disarmed AV and FW and it does not run
     
  30. IcedLance

    IcedLance Trainee Engineer

    Messages:
    17
    You DON'T have to use this app. You're welcome to use whatever you like.
    However this one is literally more than a thousand times more lightweight than VS (11MB VS 25GB) and is optimised for writing in-game scripts and includes several SE-specific features.

    All hail Tim, the maker of Thing!

    Can't help it then, gotta wait for the author.
     
    • Like Like x 1
Thread Status:
This last post in this thread was made more than 31 days old.