EditSC: Survicalcraft world editor (and how I discovered Elm)

I’m currently working on EditSC, which is a browser-based tool for editing Survivalcraft worlds. I started working on it in December 2019. You can try it here (i develop directly on this server): https://dullgo.pythonanywhere.com/editsc/

Survivalcraft worlds have 2 files in a zip archive: a binary chunks file for storing blocks, and an XML project file that stores things like entities and world settings.

My original idea was to do all of the processing of the world on the server, which uses Python. That was a very stupid idea since it would take up so much resources on the server.

So about a week later I decided to just do everything in the browser. I only used TypeScript. I had not heard about Elm, and I didn’t know how to use many of the features in TypeScript. Basically every error happened during runtime. After about a day I finally got it to extract the zip archive and render the chunks using Three.js.

In January I read this series that was in my daily Medium digest: So You Want to be a Functional Programmer. At first I saw Elm’s syntax as very confusing, but soon I decided to learn more about Elm. I soon started to love it before I even started using it.

I eventually started rewriting EditSC. Now I’m using Elm with TypeScript (and I now know much more about TypeScript). Elm is used for the UI and processing the project file, and I use TypeScript for the chunks file. I love Elm so much. I love the confidence of knowing that my code works if it compiles.

One of the things I’m using is the elm-ui framework. It makes it super easy to build user interfaces, and you don’t have to deal with hard to fix CSS problems when using Elm UI.

1 Like

Do you have a .scworld file people could use? Otherwise it’s hard to try out your world editor.

1 Like

So there is this discord server for survivalcraft that has some dropbox links for scworld files, but i dont have the invite link, so i will just list a few of the dropbox links here:

Edit: I got the invite link now; you can join here. World download links are in #sc-worlds, and I also have my own channel for EditSC: #edit-sc-project

1 Like

Another important thing I forgot to mention about EditSC is that I plan to add the ability to write extensions that add functionality to EditSC, similar to MCEdit’s filters.

I plan to implement a system that allows extensions to be written in Elm. Has anyone done something like that before?

Also it currently doesn’t support large worlds. If you try importing a world and it gets stuck on “extracting zip entries” then it probably means the world is too large. There is an upcoming Survivalcraft release which will make worlds smaller, which might help. Maybe I will eventually have to implement zip extraction in WebAssembly. Or could it be done in Elm? I think not

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.