Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@
<PackageVersion Include="Veldrid.StartupUtilities" Version="4.8.0" />
<PackageVersion Include="Veldrid.Utilities" Version="4.8.0" />
<PackageVersion Include="War3Api.Object" Version="1.31.1-rc.11" />
<PackageVersion Include="War3Net.Build" Version="6.0.0" />
<PackageVersion Include="War3Net.Build.Core" Version="6.0.0" />
<PackageVersion Include="War3Net.CodeAnalysis" Version="6.0.0" />
<PackageVersion Include="War3Net.CodeAnalysis.Decompilers" Version="6.0.0" />
<PackageVersion Include="War3Net.CodeAnalysis.Jass" Version="6.0.0" />
<PackageVersion Include="War3Net.CodeAnalysis.Transpilers" Version="6.0.0" />
<PackageVersion Include="War3Net.Build" Version="6.0.1" />
<PackageVersion Include="War3Net.Build.Core" Version="6.0.1" />
<PackageVersion Include="War3Net.CodeAnalysis" Version="6.0.1" />
<PackageVersion Include="War3Net.CodeAnalysis.Decompilers" Version="6.0.1" />
<PackageVersion Include="War3Net.CodeAnalysis.Jass" Version="6.0.1" />
<PackageVersion Include="War3Net.CodeAnalysis.Transpilers" Version="6.0.1" />
<PackageVersion Include="War3Net.CodeAnalysis.VJass" Version="0.1.0" />
<PackageVersion Include="War3Net.Common" Version="6.0.0" />
<PackageVersion Include="War3Net.Common" Version="6.0.1" />
<PackageVersion Include="War3Net.CSharpLua" Version="2.0.2" />
<PackageVersion Include="War3Net.CSharpLua.CoreSystem" Version="2.0.2" />
<PackageVersion Include="War3Net.Drawing.Blp" Version="6.0.0" />
<PackageVersion Include="War3Net.Drawing.Blp" Version="6.0.1" />
<PackageVersion Include="War3Net.IO.Casc" Version="0.1.0" />
<PackageVersion Include="War3Net.IO.Compression" Version="6.0.0" />
<PackageVersion Include="War3Net.IO.Mpq" Version="6.0.0" />
<PackageVersion Include="War3Net.IO.Slk" Version="6.0.0" />
<PackageVersion Include="War3Net.IO.Compression" Version="6.0.1" />
<PackageVersion Include="War3Net.IO.Mpq" Version="6.0.1" />
<PackageVersion Include="War3Net.IO.Slk" Version="6.0.1" />
<PackageVersion Include="War3Net.Modeling" Version="0.1.0" />
</ItemGroup>
</Project>
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

---

<p align="center">
<img src="assets/images/war3net-banner.png" alt="War3Net Banner">
</p>

<p align="center">
<b>
Expand Down Expand Up @@ -78,9 +82,9 @@ Full list of current and planned packages:
| [War3Net.Rendering] | Render Warcraft III models using [Veldrid]. | *Coming soon™* |
| [War3Net.Replay] | Parse replay (.w3g) files. | *Coming soon™* |
| [War3Net.Runtime] | Execute JASS and Lua map scripts using [NLua]. | *Coming soon™* |
| [War3Net.Runtime.Core] | C# implementation of Warcraft III's backend code. | *Coming soon™* |
| [War3Net.Runtime.Api.Blizzard] | Blizzard.j API implemented in C#. | *Coming soon™* |
| [War3Net.Runtime.Api.Common] | API for [War3Net.Runtime.Core], similar to [War3Api.Common]. | *Coming soon™* |
| [War3Net.Runtime.Core] | C# implementation of Warcraft III's backend code. | *Coming soon™* |

Some of the above packages are based on code from other repositories:
- *[War3Net.Drawing.Blp]:* [SereniaBLPLib](https://github.com/WoW-Tools/SereniaBLPLib)
Expand Down
Binary file added assets/images/war3net-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/war3net-icon-border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions assets/images/war3net-icon-border.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/war3net-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions assets/images/war3net-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions docs/news/war3net-v6-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# War3Net v6.0.0 — Rebuilding the JASS Engine

*Released: January 25, 2026*

**War3Net v6.0.0** is a **stepping-stone release** that begins a major rework of the JASS code analysis engine. This is foundational work—not a finished product.

> **Note:** The JASS rework is ongoing. Expect additional breaking changes in future releases as the new architecture matures.

---

## What's New

### Lossless JASS Parsing

The core of v6: a redesigned syntax model in `War3Net.CodeAnalysis.Jass`. **Tokens and trivia** make it possible to parse and re-render JASS with byte-for-byte accuracy—preserving whitespace, comments, and exact source formatting.

- **`JassSyntaxToken`** — Tokens with leading/trailing trivia
- **`JassSyntaxTrivia`** — Whitespace, newlines, and comments
- **`JassSyntaxKind`** — Unified enum for literals, operators, and keywords

### Streamlined Script Building

`War3Net.Build`'s `MapScriptBuilder` gets a cleaner API:
- Methods write directly to `IndentedTextWriter` for better performance
- Removed Roslyn C# syntax export for global variables—use `GenerateGlobals` and transpile manually instead

### Other Changes

- **`W3MathF`** — New class for floating-point math
- **`EscapedStringProvider`** — Moved to `War3Net.CodeAnalysis.Jass`
- **Bugfix** — `MapInfo.EditorVersion` JSON deserialization

---

## Why This Release Matters

v6 lays the groundwork for one of War3Net's two major initiatives on the [roadmap](https://github.com/Drake53/War3Net#roadmap).

**JASS Language Suite** — The new token/trivia system is the first step toward fault-tolerant parsing, semantic analysis, and LSP support. Future goals include intelligent script adaptation across game versions and a VSCode extension with full IDE features for JASS.

---

## The Road to v6

This release has been years in the making. Work began in 2022 with an ambitious goal: expand the library with a vJASS parser built on top of the existing JASS parser. That effort quickly revealed fundamental limitations in the original JASS implementation—limitations that couldn't be papered over.

What followed was a lengthy process of backporting architectural changes from the vJASS work into the core JASS parser. The token/trivia system, the unified syntax kinds, the shift from interfaces to abstract classes—all of these emerged from lessons learned while tackling vJASS's more complex grammar. The original syntax classes were kept simple to mirror CSharpLua's Lua syntax classes. The rework, by contrast, draws heavy inspiration from Roslyn.

The final push to release came with assistance from AI coding agents, which helped accelerate the tedious boilerplate changes that come with any large-scale refactor: updating dozens of syntax node classes, ensuring consistent patterns across the codebase, and handling the mechanical work that would otherwise consume months of development time.

---

## Migration

v6 includes breaking changes:
- Interfaces → abstract classes (`IExpressionSyntax` → `JassExpressionSyntax`)
- Specific literals → generic `JassLiteralExpressionSyntax` with `JassSyntaxKind`
- Operator enums → token kinds (`BinaryOperatorType.Add` → `JassSyntaxKind.PlusToken`)

See the full [migration guide](https://github.com/Drake53/War3Net/blob/master/docs/guides/jass-migration-guide-v5-to-v6.md).

---

Questions or feedback? [Open an issue](https://github.com/Drake53/War3Net/issues).
8 changes: 8 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@

<PackageReleaseNotes>https://github.com/Drake53/War3Net/tree/master/docs/changelogs</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/Drake53/War3Net</PackageProjectUrl>

<PackageIcon>war3net-icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup Condition="'$(PACK)'=='true'">
<None Include="$(MSBuildThisFileDirectory)../assets/images/war3net-icon.png" Pack="true" PackagePath="\" Visible="false" />
<None Include="$(MSBuildProjectDirectory)/README.md" Pack="true" PackagePath="\" Visible="true" />
</ItemGroup>

<ItemGroup Condition="'$(PACK)'!='true'">
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>$(MSBuildProjectName).Benchmarks</_Parameter1>
Expand Down
129 changes: 129 additions & 0 deletions src/War3Net.Build.Core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# War3Net.Build.Core

## About

War3Net.Build.Core is a .NET library for parsing and serializing Warcraft III map and campaign files. It provides complete support for reading, modifying, and writing all war3map and war3campaign archive formats. It is part of the [War3Net](https://github.com/Drake53/War3Net) modding library.

## Key features

* Parse and serialize all war3map file formats (environment, units, doodads, triggers, object data, etc.)
* Parse and serialize war3campaign files
* Support for binary, JSON, and text serialization formats
* `Map` and `Campaign` classes for working with complete archives
* `MapBuilder` for creating and modifying map archives
* Selective loading with `MapFiles` and `CampaignFiles` flags for optimal performance
* Support for both classic Warcraft III and Reforged format versions

## How to Use

### Open and read a map

```csharp
using War3Net.Build;

// Open a map file
var map = Map.Open("path/to/map.w3x");

// Access map metadata
string mapName = map.Info?.MapName;
int playerCount = map.Info?.Players.Count ?? 0;

// Access placed units
var units = map.Units?.Units;
foreach (var unit in units ?? [])
{
Console.WriteLine($"Unit {unit.TypeId} at ({unit.Position.X}, {unit.Position.Y})");
}
```

### Load only specific map components

```csharp
using War3Net.Build;

// Load only the components you need for better performance
var map = Map.Open("path/to/map.w3x", MapFiles.Info | MapFiles.Units | MapFiles.Doodads);
```

### Modify and save a map

```csharp
using War3Net.Build;

// Open an existing map
var map = Map.Open("path/to/map.w3x");

// Modify map properties
if (map.Info is not null)
{
map.Info.MapName = "My Modified Map";
map.Info.MapDescription = "A map modified with War3Net";
}

// Save the modified map
var builder = new MapBuilder(map);
builder.Build("path/to/output.w3x");
```

### Read individual map files using extension methods

```csharp
using System.IO;
using War3Net.Build.Extensions;

// Read a specific map file directly
using var stream = File.OpenRead("war3map.w3e");
using var reader = new BinaryReader(stream);

var environment = reader.ReadMapEnvironment();
Console.WriteLine($"Map size: {environment.Width}x{environment.Height}");
```

### Work with campaign files

```csharp
using War3Net.Build;

// Open a campaign file
var campaign = Campaign.Open("path/to/campaign.w3n", CampaignFiles.All);

// Access campaign metadata
string campaignName = campaign.Info?.CampaignName;
var maps = campaign.Info?.MapButtons;
```

## Main Types

The main types provided by this library are:

* `War3Net.Build.Map` - Represents a complete Warcraft III map with all its data files
* `War3Net.Build.Campaign` - Represents a complete Warcraft III campaign
* `War3Net.Build.MapBuilder` - Fluent builder for creating and modifying map archives
* `War3Net.Build.MapFiles` - Flags enum for selective map component loading
* `War3Net.Build.CampaignFiles` - Flags enum for selective campaign component loading
* `War3Net.Build.Info.MapInfo` - Map metadata including name, author, players, and forces
* `War3Net.Build.Info.CampaignInfo` - Campaign metadata
* `War3Net.Build.Environment.MapEnvironment` - Terrain data including tiles, cliffs, and water
* `War3Net.Build.Widget.MapUnits` - Placed units in the map
* `War3Net.Build.Widget.MapDoodads` - Placed doodads (decorative objects) in the map
* `War3Net.Build.Script.MapTriggers` - GUI trigger definitions
* `War3Net.Build.Object.UnitObjectData` - Custom unit modifications
* `War3Net.Build.Object.AbilityObjectData` - Custom ability modifications

## Related Packages

* [War3Net.Build](https://www.nuget.org/packages/War3Net.Build) - Generate JASS map scripts and compile maps
* [War3Net.CodeAnalysis.Jass](https://www.nuget.org/packages/War3Net.CodeAnalysis.Jass) - Parse and render JASS source files
* [War3Net.IO.Mpq](https://www.nuget.org/packages/War3Net.IO.Mpq) - Read and write MPQ archives
* [War3Net.IO.Slk](https://www.nuget.org/packages/War3Net.IO.Slk) - Parse SLK (data table) files

## Feedback and contributing

War3Net.Build.Core is released as open source under the [MIT license](https://github.com/Drake53/War3Net/blob/master/LICENSE). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/Drake53/War3Net).

* [File an issue](https://github.com/Drake53/War3Net/issues)
* [Submit a pull request](https://github.com/Drake53/War3Net/pulls)

## Disclaimer

This README was generated with the assistance of AI and may contain inaccuracies. Please verify the information and consult the source code for authoritative details.
2 changes: 1 addition & 1 deletion src/War3Net.Build.Core/War3Net.Build.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<PropertyGroup>
<Description>Parsers and serializers for war3map files.</Description>
<PackageTags>warcraft3</PackageTags>
<PackageTags>modding;parser;serializer;war3map;warcraft3;wc3</PackageTags>
</PropertyGroup>

<ItemGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
Loading