- Joined
- Jun 28, 2009
- Messages
- 49
Hi Hive,
I want to introduce a work-in-progress project I have been building: SharpForge, a C# scripting toolchain for Warcraft III: Reforged map development.
The goal is not to replace the World Editor, JASS/Lua knowledge, or the existing Warcraft III scripting ecosystem. SharpForge is intended to sit alongside an existing map workflow, allowing selected systems to be written in strongly typed C#, transpiled into plain Lua, bundled with existing Lua modules, and injected into a
This is still early and very much WIP, but it has reached the point where I would like feedback from people who have experience maintaining Warcraft III maps and Lua codebases.
SharpForge currently consists of several small tools:
The generated Lua is meant to stay readable and predictable. SharpForge does not try to hide the Warcraft III API behind a new object model. For example,
Generated C# types are emitted under a configurable root table, so they can coexist with existing Lua modules and map globals without taking over the whole scripting environment.
The main design principles are:
1. Do one thing and do it well
The transpiler only transpiles C# to Lua. The builder handles Lua bundling and map injection. JASS binding generation is a separate concern. I am trying to avoid one large magical build system that owns the entire map pipeline.
2. Integrate with existing workflows
World Editor still owns terrain, object data, placed units, and normal map editing. SharpForge is meant to fit into a source-controlled scripting workflow, not replace the editor.
3. Incremental migration
Existing Lua modules should keep working. New C# code can call Lua, Lua can call generated output, and a project can move one subsystem at a time instead of requiring a full rewrite.
4. Small runtime surface
SharpForge does not try to translate the whole .NET standard library into Lua. The runtime helpers are intentionally minimal, and only fit what real map authors need.
5. Plain and performant Lua output
The output should be direct Lua with an understandable, fine-tuned, and Lua-worldly structure, not an opaque VM or heavy compatibility layer.
6. Assisting in writing better code
SharpForge should help map authors avoid common Warcraft III scripting pitfalls without turning into a restrictive framework. Stable collection iteration, stable sorting, desync warnings, and warnings for mutating collections while iterating are all meant to make behavior more predictable across players and easier to reason about while debugging. The goal is not just to emit Lua that runs, but to guide projects toward code that is deterministic, maintainable, and less likely to fail in subtle multiplayer-only ways.
7. Better debugging
SharpForge should make failures easier to see, reproduce, and understand. Engine callbacks to be wrapped with pcall automatically so script errors do not silently break the map or disappear into Warcraft III’s runtime behavior, while still reporting the error clearly instead of hiding it. On top of that, optional debugging libraries can bring an inspector-style workflow to Warcraft III modding, closer to the kind of tooling Unity developers expect: live object state, clearer runtime visibility, and a more industrial-level of feedback than the community has traditionally had.
One important part of the project is interop with existing Lua code.
SharpForge supports raw Lua interop calls, such as requiring modules, reading/writing fields, calling global functions, and invoking Lua methods. It also supports typed wrapper classes for known Lua modules, so C# code can use a more IDE-friendly shape while still lowering to normal Lua calls.
This is important to me because I am currently using SharpForge to gradually develop one of my own Warcraft III Lua script projects. The project was originally written in Lua, and I do not want to throw that work away. Instead, I am moving suitable systems over step by step, while keeping existing Lua modules active and callable.
That migration experience is one of the main reasons SharpForge is designed around coexistence rather than replacement.
SharpForge already supports a growing subset of C# lowering, including classes, namespaces, static and instance methods, constructors, fields, properties, loops, conditionals, inheritance basics, interfaces, arrays, simple collection helpers, delegates/events in limited form, and some exception handling patterns.
There are still many areas that need more work, especially around deeper generics, broader async behavior, edge cases in lowering, diagnostics, and real-world ergonomics.
So I would not describe this as production-ready yet. It is a toolchain under active development, and I am deliberately testing it against real Warcraft III Lua code rather than only toy examples.
I would especially appreciate feedback on the project. Like
I am also interested in criticism. If there are parts of this idea that seem fragile, overcomplicated, or likely to fail in real map projects, I would rather hear that early.
Thanks for reading. I am sharing this as a WIP because Hive Workshop has many experienced Warcraft III modders and scripters, and I think this is the right place to get grounded feedback before pushing the toolchain further.
I want to introduce a work-in-progress project I have been building: SharpForge, a C# scripting toolchain for Warcraft III: Reforged map development.
The goal is not to replace the World Editor, JASS/Lua knowledge, or the existing Warcraft III scripting ecosystem. SharpForge is intended to sit alongside an existing map workflow, allowing selected systems to be written in strongly typed C#, transpiled into plain Lua, bundled with existing Lua modules, and injected into a
.w3x map.This is still early and very much WIP, but it has reached the point where I would like feedback from people who have experience maintaining Warcraft III maps and Lua codebases.
What SharpForge Is
SharpForge currently consists of several small tools:
sf-transpile: transpiles C# source files into Luasf-build: bundles Lua dependencies and can inject the generated bundle into a mapsf-jassgen: generates C# binding stubs fromcommon.j/blizzard.j- a GUI wrapper for coordinating the tools
The generated Lua is meant to stay readable and predictable. SharpForge does not try to hide the Warcraft III API behind a new object model. For example,
KillUnit(unit) remains KillUnit(unit), not something like unit.Kill().Generated C# types are emitted under a configurable root table, so they can coexist with existing Lua modules and map globals without taking over the whole scripting environment.
Design Philosophy
The main design principles are:
1. Do one thing and do it well
The transpiler only transpiles C# to Lua. The builder handles Lua bundling and map injection. JASS binding generation is a separate concern. I am trying to avoid one large magical build system that owns the entire map pipeline.
2. Integrate with existing workflows
World Editor still owns terrain, object data, placed units, and normal map editing. SharpForge is meant to fit into a source-controlled scripting workflow, not replace the editor.
3. Incremental migration
Existing Lua modules should keep working. New C# code can call Lua, Lua can call generated output, and a project can move one subsystem at a time instead of requiring a full rewrite.
4. Small runtime surface
SharpForge does not try to translate the whole .NET standard library into Lua. The runtime helpers are intentionally minimal, and only fit what real map authors need.
5. Plain and performant Lua output
The output should be direct Lua with an understandable, fine-tuned, and Lua-worldly structure, not an opaque VM or heavy compatibility layer.
6. Assisting in writing better code
SharpForge should help map authors avoid common Warcraft III scripting pitfalls without turning into a restrictive framework. Stable collection iteration, stable sorting, desync warnings, and warnings for mutating collections while iterating are all meant to make behavior more predictable across players and easier to reason about while debugging. The goal is not just to emit Lua that runs, but to guide projects toward code that is deterministic, maintainable, and less likely to fail in subtle multiplayer-only ways.
7. Better debugging
SharpForge should make failures easier to see, reproduce, and understand. Engine callbacks to be wrapped with pcall automatically so script errors do not silently break the map or disappear into Warcraft III’s runtime behavior, while still reporting the error clearly instead of hiding it. On top of that, optional debugging libraries can bring an inspector-style workflow to Warcraft III modding, closer to the kind of tooling Unity developers expect: live object state, clearer runtime visibility, and a more industrial-level of feedback than the community has traditionally had.
Lua Interop
One important part of the project is interop with existing Lua code.
SharpForge supports raw Lua interop calls, such as requiring modules, reading/writing fields, calling global functions, and invoking Lua methods. It also supports typed wrapper classes for known Lua modules, so C# code can use a more IDE-friendly shape while still lowering to normal Lua calls.
This is important to me because I am currently using SharpForge to gradually develop one of my own Warcraft III Lua script projects. The project was originally written in Lua, and I do not want to throw that work away. Instead, I am moving suitable systems over step by step, while keeping existing Lua modules active and callable.
That migration experience is one of the main reasons SharpForge is designed around coexistence rather than replacement.
Current Status
SharpForge already supports a growing subset of C# lowering, including classes, namespaces, static and instance methods, constructors, fields, properties, loops, conditionals, inheritance basics, interfaces, arrays, simple collection helpers, delegates/events in limited form, and some exception handling patterns.
There are still many areas that need more work, especially around deeper generics, broader async behavior, edge cases in lowering, diagnostics, and real-world ergonomics.
So I would not describe this as production-ready yet. It is a toolchain under active development, and I am deliberately testing it against real Warcraft III Lua code rather than only toy examples.
Feedback I Am Looking For
I would especially appreciate feedback on the project. Like
Does the overall direction make sense for serious Warcraft III map development?I am also interested in criticism. If there are parts of this idea that seem fragile, overcomplicated, or likely to fail in real map projects, I would rather hear that early.
Thanks for reading. I am sharing this as a WIP because Hive Workshop has many experienced Warcraft III modders and scripters, and I think this is the right place to get grounded feedback before pushing the toolchain further.
Last edited:

