Goblinstorm: Rise of Rinkollette Web Port




 Goblinstorm: Rise of Rinkollette can now be played in a web browser! Over the past few days, I converted the C# build, https://github.com/MrOnosa/learn-you-a-game-jam-2024, into GDScript. Now anyone can play it on the web for free!

The ported version's source code can be found at https://github.com/MrOnosa/Goblinstorm-Rise-of-Rinkollette-Web

I've noticed that there is a bit of lag at the start of each game, but it goes away quickly. I'm curious if there is a way to address these lag spikes.

Porting a Godot 4.2 project from C# to GDScript was pretty easy. Here was how I did it, step by step.

  1. Created a new project in Godot Engine 4.2.2 (Not the .Net/mono version)
  2. Copied over all the assets, scenes, and an empty scripts folder
  3. I opened the old project.godot and the new one, and copied over all the settings that weren't pertaining to C# itself. So, the autoload section, the display section, gui, input, and rendering sections. This saved me a lot of time reconfiguring the project again.
  4. Converting from C# to GDScript is the tedious part. Start with any autoloaded scripts first. Then, start with scenes that depend on nothing but the default Godot nodes. Convert those first. From there, you'll want to go from the bottom up for each scene in your game. For example, the title screen didn't have any custom-built dependencies, so I was able to port that over and test it quickly. However, the "level" scene depended on many other scripts I'd written that needed to be converted to GDScript, so I had to rewrite all of those first. 
    1.  I used an LLM to do most of the heavy lifting. Don't be afraid to be very specific with your prompts. Here is what I wrote to port witch.cs to witch.gdscript: Port witch.cs into a gdscript file for Godot 4. Assume `gm` is a separate node that will be autoloaded. Use change_scene_to_file instead of change_scene. When converting the ShaderMaterial, use this as an example ".material.set("shader_parameter/difference", interpolatedValue)". Use tabs instead of spaces. The [Export] attribute should be converted like this @export var Speed : int. The [Signal] attribute should be converted using this as an example signal HealthChanged(healthUpdate: HealthUpdate). 
    2. One mistake I made was not adhering to a firm set of conventions in my GDScript code, so I ended up with some C# conventions and some GDScript conventions. This resulted in a few bugs that were hard to track down.
    3. Beware math! A few times, the LLM would convert math functions to it's own weird thing instead of using Godot functions. For example, Mathf.MoveToward(Velocity.X, 0, Speed); was converted to lerp(Velocity.X, 0, Speed) instead of  move_toward(velocity.x, 0.0, Speed).
  5. Once each scene is ported over and all the code is error free, set-up each scene. I noticed that anything that was "exported" had to be specified. For example, in my game, the Pink Goblin runs faster than the Green Goblin, so I had to change those properties again in the ported version.
  6. Signals for the parent scene worked out of the box for me. However, scenes for child nodes needed to have their signals setup again.


I hope this helps! Both the C# and GDScript versions of this game are open source, so feel free to dive in to find concrete examples of how I did it. The majority of the process was streamed at https://www.twitch.tv/captain_onosa. If anyone would like me to upload the process to YouTube, let me know.

Files

Goblinstorm: Rise of Rinkollette (Web) Play in browser
Jul 09, 2024

Leave a comment

Log in with itch.io to leave a comment.