Posted: Mon Jun 08, 2020 2:15 am Post subject:
I figured out how to add new map tiles to the game
As you can see from the attached image, I figured out how to add new map tiles to the game.
Because the map editor currently has a hardcoded list of map tiles (and probably also wouldn't read data from mods anyway I suspect) I had to manually hex edit the .bin file for the map but otherwise its currently working.
What I did to add new map tiles to the game was:
1.Create art for the map tile (or in this case copy it from elsewhere
2.Add a new entry to the theater xml file (TD_TERRAIN_DESERT.XML in my case) that points at the new map tile.
3.Add a new TemplateTypeClass definition to cdata.cpp with the appropriate data
4.Add the new tile to the end TemplateTypeClass::Pointers array in cdata.cpp
5.Add the new tile to the end of the TemplateType enum in defines.h
6.Place the TD_TERRAIN_DEFINITION.XML, map tile file and TiberianDawn.dll in the correct locations in a test mod
7.Grab a map and hex edit the .bin file so it points at the new tile
8.Go in-game, activate the mod then play skirmish on the map.
and 9.Watch as my new map tile appeared in game and worked correctly.
So the only remaining limitation is that you can't place your new tiles in the editor.
I DID however discover that it is 100% NOT possible to add a totally new theater to the game (even ignoring the editor).
Of course with map tile IDs being limited to a single byte in TD (it can only go from 0 to 255) you are limited in how many new map tiles you can add to the game (red alert upgraded that limit to 2 bytes)
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Mon Jun 08, 2020 3:25 am Post subject:
The editor uses the existing DLL files, so it might be possible that we may need to add something in the source code to make it recognize the new terrain tiles.
At DEFINES.H, there are lists of TerrainType, SmudgeType, OverlayType, and TemplateType. I believe in this case it seems to be TemplateType, where you would need to add something.
Then, in CDATA.CPP, you need to add your template as a static TemplateTypeClass const, like the sample below:
Despite what the source code (and DLLIntefaceEditor.cpp in particular) would lead you to believe, the map editor for the remasters does not load either TiberianDawn.dll or RedAlert.dll at all. Its a .NET application so you can decompile it and poke around and if you look at MobiusEditor.TiberianDawn.TemplateTypes and MobiusEditor.RedAlert.TemplateTypes you can see exactly where its all hardcoded. QUICK_EDIT
Having studied the map editor internals a bit more, I see nothing that would prevent the map editor from being modified (either by Petroglyph or by some clever hacker who knows a lot more than I do about how to decompile and modify .NET applications) so that it would read all the data it needs (for buildings, infantry, overlays, smudges, templates, terrain and units) from a file (probably XML given that its used everywhere else) rather than being hardcoded.
I did try some VERY clever hex editing (the sort I wouldn't recommend anyone who doesn't know what they are doing try) on a copy of the map editor (since I didn't want to mess up the original exe) and was able to get it to display my new tile in-editor and place it on a map (and have the resulting map work in-game) so other than the hardcoded list of map tiles, there appears to be nothing standing in the way of being able to place new map tiles in the editor... QUICK_EDIT
I have tried all kinds of .NET decompilers and none will decompile into something that I can then recompile. All of them produce errors when I try to recompile the output.
And its great that people are working on making the code compile standalone and turning on the internal map editor and stuff but this is the "C&C Remastered Collection Editing Forums" and not the "Original C&C Editing Forums" and those of us here need the remastered map editor (or a new editor written for the remasters and drawing using remaster graphics) rather than one written for the original game. QUICK_EDIT
Joined: 24 May 2004 Location: Flanders (Be) Posts:300000001
Posted: Wed Jun 10, 2020 3:32 pm Post subject:
Re: I figured out how to add new map tiles to the game
jonwil wrote:
I DID however discover that it is 100% NOT possible to add a totally new theater to the game (even ignoring the editor).
Um. I pulled that off in C&C95 and it honestly wasn't hard at all...
In fact, Jungle theater should still be in the game. You just have to go over the tilesets and terrain items to make sure they are usable in the new theater, since all these things have an "ownership", just like stuff you can build in-game has house ownership flags.
So is the issue the GlyphX side then? What exactly doesn't work for a new theater?
jonwil wrote:
and those of us here need the remastered map editor (or a new editor written for the remasters and drawing using remaster graphics) rather than one written for the original game.
Why? The map format is 100% the same, and doesn't include graphics. _________________ QUICK_EDIT
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Wed Jun 10, 2020 7:13 pm Post subject:
Quote:
Why? The map format is 100% the same, and doesn't include graphics.
I need a different map editor because the current one requires NET Framework 4.7.2 and I don't want to update my old version of Windows 10 because I don't trust the direction that Microsoft takes their operation system into, neither its automatic testing methods. I'm stuck to Net Framework 4.6.2 here. QUICK_EDIT
I agree with Nyerguds, although it would be nice if there was an editor which used the remaster assets, its not a deal breaker since the formats are all still the same and mods will still need to produce low res assets to support that view in the remasters anyhow. QUICK_EDIT
Joined: 26 Apr 2003 Location: Somewhere in Germany
Posted: Mon Jun 15, 2020 9:13 pm Post subject:
Blade wrote:
and mods will still need to produce low res assets to support that view in the remasters anyhow.
Well, for Snow we can just use the 1.06c assets, and for something like Jungle I'd honestly just copy-paste Temperate and modify the terrain-specific palette until the result looks remotely acceptable. QUICK_EDIT
Joined: 26 Apr 2003 Location: Somewhere in Germany
Posted: Sun Jun 28, 2020 1:35 pm Post subject:
Re: I figured out how to add new map tiles to the game
Nyerguds wrote:
So is the issue the GlyphX side then? What exactly doesn't work for a new theater?
In my case I tried adding snow terrain to TD, but the remaster tileset completely falls back to temperate terrain, and ignores my snow tileset xmls.
Your snow.mix works flawlessly in legacy graphics mode, so the issue isn't on the dll side, I think (I triple-checked every possible place in the DLL code anyway).
I did list my TD_TERRAIN_SNOW.XML in TERRAINS.XML, and I also made sure the .DDS files work and are in the correct location by modifying TD_TERRAIN_WINTER.XML to load the snow files, which works fine, too.
For the record, my snow xml is just a renamed duplicate of the above modified winter xml, so it's not missing entries or anything of that sort. If the engine was loading it, it should work just as well as the winter one does.
But the GlyphX side still seems to ignore my added xml and just falls back to the TEMPERATE one. I scanned the entire CONFIG.MEG for winter entries to be sure I didn't forget anything, but found nothing else that would need changes at the xml side.
Currently at a loss here. QUICK_EDIT
If you look at the tileset XMLs, you can see a TilesetTypeClass entry with a name such as Common_Misc or RA_VFX or TD_Terrain_Desert.
The GlyphX engine (though some means I dont have any idea about) appears to have logic that determines (based on the game and the theater) exactly which of these tilesets to load.
Since the game has no knowledge of your new tileset (say, TD_Terrain_Snow or whatever you have called it) it wont load that tileset into the list of tilesets it uses when searching for a tile (template, terrain, overlay, building etc) to draw. QUICK_EDIT
Posted: Sun Jul 05, 2020 11:14 am Post subject:
Re: I figured out how to add new map tiles to the game
Nyerguds wrote:
jonwil wrote:
I DID however discover that it is 100% NOT possible to add a totally new theater to the game (even ignoring the editor).
Um. I pulled that off in C&C95 and it honestly wasn't hard at all...
In fact, Jungle theater should still be in the game. You just have to go over the tilesets and terrain items to make sure they are usable in the new theater, since all these things have an "ownership", just like stuff you can build in-game has house ownership flags.
Came here to hijjack this a little bit. Struggle in adding a new theater in RA Remaster right now. Planning to port the TD Deserts to RA. For test-purposes im working witht he snow tilesets so I dont have to change the templates.
What I did so far:
- added THEATER_DESERT in Defines.H and the define THEATERF_DESERT
- enlarged all TEMPERATE/SNOW templates in CDATA.CPP with THEATERF_DESERT (and some in TDATA.CPP too)
- extraced the snow tilesets and moved em in the correction folder
- created RA_TERRAIN_DESERT.xml based on the snow variant
- linked it in TILESETS.XML
- changed the map information with "DESERT" in map file and JSON via notepad++
- and finally, the bummer, added following in the CONST.CPP: {"DESERT","DESERT","DES"},
While compiling is no issue, as long as the CONST.CPP entry is added, the map will crash on load. So I believe, I miss something the const.cpp is refering to. And without the const.cpp the map will load correctly but the map will fall-back to TEMPERATE since it cant find any DESERT stuff (cause the const isnt added).
Does anybody have a clue what I'm missing here? QUICK_EDIT
I cannot get this to work... I am trying to add a new overlay (TD) instead of a map tile, but the game just crashes on startup. I've included the art files, the entries in the XML files for the three theaters, the required changes in the code, but nothing. Even if I solely include the .megs without the .dll it crashes.
The only thing I can think of is it missing the legacy art? I don't know if that's required, but otherwise I'm at a loss. QUICK_EDIT
Here's a zip with the xmls and the two code files. I'm trying to add blue tiberium. I've included a picture of how I inserted the art of the overlay into TEXTURES_TD_SRGB.MEG (it's the same art as the regular tiberium for now). It seems right to me, but I thought I'd include it nonetheless
I've inserted the terrain .xml's in DATA/XML/TILESETS/ in CONFIG.MEG.
You shouldn't be editing megafiles.xml or any of the meg files, you should have all the files loose in the mod's folder (that's how you are supposed to do it).
Oh jeez, I had no idea. I replaced some art a while ago and used a .meg for that, and that worked, so that's why I did it like this. Glad I don't have to muck about with meg files anymore!
That did the trick, it doesn't crash anymore. I can't get it to show up properly though, whenever I add BTI1 in a custom map, nothing appears. I've tried putting all the files into "Data", or keeping the folder structure like in the meg files, but no dice so far. QUICK_EDIT
I have my custom overlays working in-game, but I cannot make it display the art. I have made the tiles into a wall for now (since classing them as tiberium makes them default to the standard green tiberium). The code works fine, I cannot pass the tiles like with a concrete wall, but no art appears.
I cannot understand what's wrong, since everything seems to be in place. I've included all the files in the attachment. Just include an overlay tile with the name "bti1" in a map. Any help would be greatly appreciated!
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum