|
| 1 | +# 4.0.0 (2021-02-28) |
| 2 | +## SUMMARY |
| 3 | +**🔥 Breaking changes** |
| 4 | + |
| 5 | +This major release significantly overhauls WC3MapTranslator since the release of WarCraft III: Reforged. There are a few breaking changes in this release. |
| 6 | + |
| 7 | +The two largest changes include a new usage contract and changes to the terrain `.json` format, both of which are detailed below. This release also integrates the latest file formats, after a few changes to the war3map formats to support Reforged. |
| 8 | + |
| 9 | +The old usage contract meant that developers had to instantiate translators, which didn't make much sense. Now translators are static classes that can be used directly after importing. |
| 10 | + |
| 11 | +The `.json` format for terrain gets rid of the bulky `tile` objects and returns to a one-dimensional mask array for things like ground height, boundary flags, etc. In an older version of WC3MapTranslator, terrain used to be a multi-dimensional array of rows, followed by the `tile` object format. The problems with the `tile` object format were two-fold: (1) file size would blow up (e.g. a 29kB `.w3e` file would become a 1199kB `.json` terrain file); and (2) the bulky `tile` objects did not lend themselves to the spirit of having a diff-able JSON file. We believe that a single-dimensional array will allow developers to more easily see differences between JSONs. |
| 12 | + |
| 13 | +Another exciting change is a new [WC3MapSpecification](https://github.com/ChiefOfGxBxL/WC3MapSpecification) repository for documenting the war3map specifications. This is a living document, meaning it may be updated in-place as our understanding of the file formats improves! |
| 14 | + |
| 15 | +## FEATURES |
| 16 | + * 🔥 Improve usage contract: |
| 17 | + * Translators are now exported by this library (e.g. `import { ObjectTranslator } from 'wc3maptranslator'`) |
| 18 | + * Translators no longer need to be instantiated to be used |
| 19 | + * 🔥 Change terrain format: |
| 20 | + * Tiles are now defined via "masks", for ground height, texture, variation, etc. |
| 21 | + * Before: `tiles` is an array of objects... `{ groundHeight, waterHeight, boundaryFlag, flags, groundTexture, groundVariation, cliffVariation, cliffTexture, layerHeight }` |
| 22 | + * After: a one-dimensional array for each of the above fields... e.g. for a 64x64 map, `groundHeight` is an array of 65*65=4225 tile points |
| 23 | + * Some fields have been renamed into camelCase for consistency: |
| 24 | + * `customtileset` -> `customTileset` |
| 25 | + * `tilepalette` -> `tilePalette` |
| 26 | + * `clifftilepalette` -> `cliffTilePalette` |
| 27 | + * Upgrade to latest file formats |
| 28 | + * Sounds version upgraded from `1` -> `3` |
| 29 | + * Info version upgraded from `25` -> `31` |
| 30 | + * Add more type safety: |
| 31 | + * Translator results from `jsonToWar()` and `warToJson()` are now typed by `WarResult` and `JsonResult`, respectively |
| 32 | + * `JsonResult` is generically typed to describe what it contains (e.g. `Sound[]`) |
| 33 | + * Introduced new `angle` type, which is an alias for `number`; `angle`'s should always be specified in degrees, not radians |
| 34 | +## FIXES |
| 35 | + * Resolve `[DEP0005] DeprecationWarning: Buffer()` warning in `HexBuffer.ts` |
| 36 | + * Fix scoping issues on `*Translator.ts`, `HexBuffer.ts` and `W3Buffer.ts` where certain fields that should be `private` were marked as `public` |
| 37 | + * Fix InfoTranslator reading random item table ID length as 1 instead of 4 |
| 38 | + * Fix potential null-terminator errors related to string or character-array fields |
| 39 | +## MAINTENANCE |
| 40 | + * Upgrade to Node 14.x LTS |
| 41 | + * Upgrade to npm 7.x |
| 42 | + * Upgrade `round-to` 4.1.0 -> 5.0.0 |
| 43 | + * Upgrade `@types/fs-extra` 8.1.0 -> 9.0.7 |
| 44 | + * Upgrade `@types/mocha` 7.0.1 -> 8.2.1 |
| 45 | + * Upgrade `@types/node` 12.12.28 -> 14.14.31 |
| 46 | + * Upgrade `fs-extra` 8.1.0 -> 9.1.0 |
| 47 | + * Upgrade `mocha` 7.0.1 -> 8.3.0 |
| 48 | + * Upgrade `nyc` 15.0.0 -> 15.1.0 |
| 49 | + * Upgrade `ts-node` 8.6.2 -> 9.1.1 |
| 50 | + * Upgrade `tslint` 6.0.0 -> 6.1.3 |
| 51 | + * Upgrade `typescript` 3.8.2 -> 4.2.2 |
| 52 | + * The project structure has changed: |
| 53 | + * `examples` sub-project directory is removed |
| 54 | + * Refer to `USAGE.md` for how to use the code |
| 55 | + * Add all contributors to `package.json` |
| 56 | + * Resolve all security issues via `npm audit fix` (5 low, 1 high, 1 critical) |
| 57 | +## TESTING |
| 58 | + * Travis CI will now use Node 14 LTS to build the project |
| 59 | + * `test` directory now contains the WC3 and JSON data files the tests require |
| 60 | + * Implement the StringsTranslator test |
| 61 | + * Resolve all broken unit tests, most of them being reversion tests |
| 62 | +<!-- |
| 63 | +# x.y.z (YYYY-MM-DD) |
| 64 | +## SUMMARY |
| 65 | +**🔥 Breaking changes** |
| 66 | +## FEATURES |
| 67 | +## FIXES |
| 68 | +## MAINTENANCE |
| 69 | +## TESTING |
| 70 | +--> |
| 71 | + |
| 72 | +# Previous versions |
| 73 | +The `CHANGELOG.md` file was introduced with the 4.x release. For details on previous changes, please refer to https://github.com/ChiefOfGxBxL/WC3MapTranslator/releases. |
0 commit comments