Nyerguds / MobiusMapEditor

Enhanced version of the C&C Tiberian Dawn and Red Alert map editor based on the source code released by Electronic Arts.
Other
23 stars 3 forks source link

Bug: few issues when saving with moebius v1.5.0.2 (accents and waypoints) #7

Closed X-Raym closed 10 months ago

X-Raym commented 10 months ago

Hi,

Thanks for your works on this, definitely nice improvements here and there on the editor, especially the fact it is not linked to steam, appreciated !

I got few issues when saving a .ini file from Moebius, and reopening a .ini file in native editor.

First, it seems Moebius doesn't handle special characters in Description, contrary to the native editor.

Second, there is a issue with waypoints. If I create a map in Moebius editor, it will be abble to work properly on be saved from the native editor, because of this error:

I have to delete the waypoints home, and create a new one from native editor. Then it works.

I passed the two .ini files (one from moebius, and one "corrected" manually in the native editor so that the file can be saved and open in C&C) into a diff checker, and despite Uppercase mismatch (which may not be too much trouble, unless for debugging), it seems the waypoints ID doesn't match (point 26 in moebius is point 28 in native editor) ?

Here are the two files : https://gist.github.com/X-Raym/76aee1314423607f8e70fc3d4e7c7a87

The _native version is the one corrected in native editor, the other is the one created in Moebius. To reproduce the error above, just open this last file into native editor and try to save. You should get the popup.

Cheers !

Nyerguds commented 10 months ago

I got few issues when saving a .ini file from Moebius, and reopening a .ini file in native editor.

Why would you want that, though? I strive to keep the map format as closely as possible to the original Westwood format. Try opening original missions from the game in the native editor, and you will have exactly the same problems.

First, it seems Moebius doesn't handle special characters in Description, contrary to the native editor.

Did you try that in the actual game, though? Mobius handles them better. It saves the classic briefing in classic DOS-437 text encoding, and the remaster's one-line briefing in UTF-8, so that the missions will be handled correctly both by the original game and by the remaster. This gives a strange-looking result if you just open the file in Notepad, because it will not know what encoding the overall file has and will show both types wrong, but inside the games, it all works correctly.

The files you uploaded show an incorrect interpretation of this; the first one looks like it was interpreted as Windows-1252 encoding and then re-saved as UTF-8, and the second one is UTF-8 encoding. It shows those together as if they were the same thing, but they really aren't. If you would instead open both of these files in a hex editor, you'd see the contents of the "Text" line are the same in the Mobius version and the native one. The only thing I did was make sure that the classic briefing uses the correct encoding to be used in the classic game.

And yes, if you open a mission in a text editor that is not specifically aware of text encodings, this means you might corrupt special characters if you re-save it from there. But I don't really see how that's my problem; I already know that re-saving a mission that contains special UTF-8 characters in Win11 notepad will add a three-byte "byte order mark" at the start of the file that will make the remaster completely refuse to see the file as valid mission. So my advice... simply don't do that.

You might need to read up on text encoding to fully understand what is going on there.

Second, there is a issue with waypoints. If I create a map in Moebius editor, it will be abble to work properly on be saved from the native editor, because of this error:

They messed up the positions of the special waypoints in the native editor by increasing the multiplayer starting points from 6 to 8 without compensating and decreasing the amount of waypoints between these start points and the special waypoints at the end. The real special waypoints are indeed 25, 26 and 27. The game does not read or handle anything farther. In fact, if you check out the editor code in the official source release on the Electronic Arts github, this problem is already fixed there, but the fix was never published into the game.

Again, try them in-game. If you use the native editor, none of these special waypoints will actually work. The editor's checks are on the wrong indices.

X-Raym commented 10 months ago

I got few issues when saving a .ini file from Moebius, and reopening a .ini file in native editor.

Well, precisely because I got errors when saving with moebius, and reopening in native editor helps debugging.

But I don't really see how that's my problem;

Ok let's close this ticket then, I didnt meant to annoy you in any way.

Thx for your work

Nyerguds commented 10 months ago

reopening in native editor helps debugging.

Not really... all that does is show you how buggy the original editor is. Using that as standard seems like the opposite of de-bugging to me :-\

The best way to see if anything is wrong is still just to try it in the game itself. If something doesn't work correctly there, in terms of special characters, or scripting, waypoints, placed down objects... yea, then I'll fix it in the editor. But not to fix how it looks weird in Notepad, or to accommodate the buggy original editor. The whole point of this project is to replace the native editor with something that works better.