Jump to content

[Updated] Map and Mission Editor new major version 2.0 pre-release 2


Recommended Posts

Posted (edited)

[UPDATE] The second pre-release version is now available, including important new features! Go to this post for download and more information: https://forum.dune2k.com/topic/28802-map-and-mission-editor-new-major-version-20-pre-release/?do=findComment&comment=400216

Hello all!

It's time for a new major version of D2kEditor! Version 1.4 did not get any final official release, but it looks that it had so many and huge changes and new features from last version 1.3, so I decided that it really deserves a new major version number.

All the changes and new features are described and discussed in the other thread (https://forum.dune2k.com/topic/28587-updated-1462020-map-and-mission-editor-v14-release-candidate-3-full-of-improvements-and-new-features/), but I'm making this new thread. The current version is yet far from being complete, but I just wanted to give it away for anyone who is interested in it and eager to try it out!

Here's download for the first pre-release version: [OUTDATED] Please take pre-release version 2 from here

And here is changelog (this includes ONLY the changes made since last release, v1.4 rc3):

Changed: Spice Bloom graphics is now transparent

Added support for new Mission Launcher:
- New fields under additional Mission.ini file settings:
  "Campaign folder", "Mods folder", "Colours.bin file", "Players.ini file", "Intel ID"
- Editor can load custom COLOURS.BIN file for individual mission, specified under "Colours.bin file" field
- Editor can load custom player names from .ini file for individual mission, specified under "Players.ini file" field
- Editor can load modified buildings&units graphics for individual mission from specified Campaign and Mods folder
- Editor can load modified buildings&units configuration for individual mission from specified Campaign and Mods folder
- Last two points are useful for mapping with modded game resources (i.e. new/replaced units)
- Editor will load following graphics/config files for individual mission from this folder structure:

{Dune2000 root folder}
|- CustomCampaignData
  |- {Campaign folder}
     |- Colours
        |- {Colours.bin file}
     |- Players
        |- {Players.ini file}
     |- {Mods folder}
        |- graphics
           |- structures.bmp
           |- misc_objects.bmp
        |- config
           |- structures.ini
           |- misc_objects.ini
           |- buildings.txt
           |- buildings2.txt
           |- units.txt
        |- data
           |- bin
              |- TILEDATA.BIN

And here is the VERY COMPLETE changelog since version 1.3. A huge list, isn't it?

Spoiler

Added: Smooth spice rendering. Thin spice and thick spice is now drawn exactly how it appears in game.
Added: Save minimap image feature
Added: Mark Wall & Concrete owner side feature. Available as 4th toggle button "Own" below minimap (or Ctrl+W).
       "Show unknown specials" option was moved under Settings menu.
Fixed: Outpost and Modified Outpost are visually distinguished by antenna turn direction.
Changed: Spice Bloom graphics is now transparent
Fixed: The "Maximized" window property is now preserved for all dialogs when you close and open program again.
Fixed: The last used directory for various open/save dialogs is preserved independently for each dialog.
Fixed: Some key shortcuts (i.e. Ctrl+G) will no longer select a preset
Fixed: Scrolling map with arrows will always work in Terrain mode
Added: In Structures mode, use Up/Down keys to select building/unit in a list, and Left/Right keys to switch between
       Misc Objects, Building and Unit lists
Added: You can use Shift + mouse wheel up/down to change brush size
Added: You can hold Ctrl + click to map to easily and quickly switch to Select mode and start a selection 
Added: Select structures only mode. You can set the checkbox "Structures" next to "Select mode" radio button to
       third (grayed) state, which means select structures only. Useful for copying or moving a base layout.
Added: Area type in Select mode. You can make a selection only of tiles of specified type, which makes possible to
       select more precise non-rectangle areas. If you hold Shift, the selected area is erased, which makes possible to
       easily move the area around.
Added: Using "Reopen map" immediately after starting program will open the map which was open last time.
Added: New dialog window to change a tileset. When you start new map, this dialog will open so you can select a tileset.
Added: Named tilesets. You can give tileset a user-friendly name which will display on tileset selection dialog. 
Added: Reload tileset option. Useful when you modify tileset .ini file.
Changed: In D2kEditor.ini file, the default tileset is not specified as tileset index, but as tileset name 
         (setting was renamed to "DefaultTilesetName").
Changed: Editor will ask for saving changes to your map upon closing program instead of only confirming exiting program.
         This works for map and events modifications, does not work for mission properties and AI modificatios. 
Added: When starting editor for first time and it can't detect your game location automatically, it will prompt you to
       navigate to game location manually with a file open dialog
Added: Editor checks for more map errors when saving map or launching map. It checks additionally for:
       - Spice blooms limit (30 max)
       - Total structures limit (1000 max)
       - Refineries per player limit (10 max)
       - 0 credits or tech level on player with active AI
       - Reinforcement or Starport delivery events with 0 units
Added: Total column to map statistics
Fixed: Map statistics grid scrolling with mouse wheel
Added: Tile Attribute Editor will warn and ask you when you attempt to save over original game's TILEATRx.BIN file
Added: Editor will load contents of custom TEXT.UIB file, if it is specified in mission .ini file.
       The "Test map" feature will automatically launch game with custom TEXT.UIB file.
Added: Preset Helper feature (accessible from "Open tileset" window). Here you can easily design a block preset and copy
       its code to tileset .ini file, or directly use that block in terrain editor.
Fixed: Event and Condition notes will move position accordingly when you reorganize, delete or add events/conditions
Added: Buttons to move units and conditions up and down in event's unit and condition list
Added: New Deploy action "Stay" for Reinforcement and Unit Spawn events, renamed other deploy actions 
Added: Show key shortcuts option in Event grid and Condition grid popup menu
Added: Player names loaded from "config\players.ini" file are used in all places in editor and no longer hardcoded
Added: Minimap colors for buildings and units are loaded from game's COLOURS.BIN file. Original COLOURS.BIN file
       is shipped with editor.
Changed: Allegiance buttons on Mission settings window are changing in this order: Enemy -> Ally -> Neutral
Added: Defence areas can be selected directly from map. A button will appear when you select a defence area in AI editor.
Added: Use random paint map feature. Predefined 128*128 background map of clean sand and rock is used for painting.
       The advantage is better distribution of random sand/rock tiles and more natural look. Can be turned on in Settings.
Fixed: Spacebar was not always working for switching from block preset window to tileset window
Added: Remap tiles feature
Added: "D2k Mapping Manual" document

Four major new features and changes:
1) Added support for new Mission Launcher and added a built-in launcher into D2kEditor.
   Also added support for loading per-mission/per-mod editor configuration, player names and colors.
2) Merged TileAtrEditor program into D2kEditor, so D2kEditor now has built-in Tile Attribute editor. 
   TileAtrEditor became obsolete and no longer needed.
3) Significant improvements related to creating maps using custom tilesets. 
   Creating maps using custom tilesets is now much easier and faster.
4) Major changes in tileset configurations (tileset .ini files) related to new features and improvements.
   You will need to update your custom tileset .ini files to make them compatible with this version of program.

Ad 1)
- New fields under additional Mission.ini file settings:
  "Campaign folder", "Mods folder", "Colours.bin file", "Players.ini file", "Intel ID"
- Editor can load custom COLOURS.BIN file for individual mission, specified under "Colours.bin file" field
- Editor can load custom player names from .ini file for individual mission, specified under "Players.ini file" field
- Editor can load modified buildings&units graphics for individual mission from specified Campaign and Mods folder
- Editor can load modified buildings&units configuration for individual mission from specified Campaign and Mods folder
- Last two points are useful for mapping with modded game resources (i.e. new/replaced units)
- Editor will load following graphics/config files for individual mission from this folder structure:

{Dune2000 root folder}
|- CustomCampaignData
  |- {Campaign folder}
     |- Colours
        |- {Colours.bin file}
     |- Players
        |- {Players.ini file}
     |- {Mods folder}
        |- graphics
           |- structures.bmp
           |- misc_objects.bmp
        |- config
           |- structures.ini
           |- misc_objects.ini
           |- buildings.txt
           |- buildings2.txt
           |- units.txt
        |- data
           |- bin
              |- TILEDATA.BIN

Ad 2)
- Tile Attribute editor is now available from main menu under Tileset.
- You can edit the current tileset used by current map. Swithching tileset would change it for current map too. 
- You save map and tile attributes independently. When you save attributes, changes will apply immediately to your map.
- There is "Test in-game" feature (F8) that would save attributes and launch current map in game.

- You can now edit all 32 game attributes. Previously only 7 attributes (which were present in original TILEATRx.BIN files)
  were editable, but according to latest TILEATRx.BIN research, it was discovered that the other attributes are internal
  attributes used by game during gameplay for various purposes. You can achieve various effects using those additional
  attributes, for example place a real working concrete on a map.
- Editor attributes (special attributes used only by the editor to recognize which tile is sand, rock, dune tile etc.) are
  no longer part of TILEATRx.BIN files, because they conflicted with internal game attributes. You no longer need to 
  distribute two separate versions of TILEATRx.BIN files: one for game and one for editor.
- Editor attributes are stored inside tileset .ini file and editor saves them into .ini file automatically.
- TILEATRx.BIN files are no longer distributed with the program. The program loads these files from game folder.

- Added more flexible ways how you can filter tiles by attributes. Added "Filter tiles having any of attributes" mode,
  as well as "Filter tiles by rule" mode. Removed "Mark infantry-only" mode as this was just a specific case of a rule.
- "Filter tiles by rule" is the most advanced mode, where you can specify which attributes tiles need to have (either
  all of any of them) and which attributes tiles must not have (basically combination of all three previous filter modes).
  In this mode you can easily design your rule and then use it in your tileset .ini file.
- Added new view modes: "Draw minimap colors" and "Draw fill area groups" mode. These modes can help you design minimap
  color rules and fill area rules in your tileset .ini file, as you can easily and immediately see the result here.
- Added "Edit tile hint text" mode. Tile hint text is a text that displays in game when you move mouse cursor over that
  tile. In original tilesets this is used only on spice tiles.

Ad 3)
- In Terrain editing mode, there are now 4 common paint groups and 8 tileset-specific paint groups (12 paint groups total).
- The 4 common pain groups are reserved for Thin Spice, Thick Spice, Concrete and Void. The latter two are not commonly
  used in maps, but are potentially usable for new designs, or in custom tilesets. For example concrete can be used for
  decoration (in original tilesets it cannot be built on it), but it can be made buildable using specific tile attributes 
  and used as real concrete in for example Dune 2 tileset. The Void could be used to make non-rectangle maps, or it is 
  useful for indoors tilesets (i.e. Heighliner).
- The 8 paint groups can be used for any terrain types. The original tilesets use no more tha 3 types (Sand/Rock/Dunes) 
  or 4 types (Ice), however, in custom tilesets you can use all 8.
- Improved "Auto-Smooth edges" feature (Shift-Click) and made it more flexible and configurable for custom tilesets.
  You can take advantage of this feaure for any terrain type in custom tilesets, it is not strictly limited for
  Rock and Dunes edge in original tilesets.
- Added "Restrict painting" feature, which will let you paint specific tiles only on specific terrain type (i.e. spice and
  dunes can be painted only on sand, concrete can be painted only on rock). This can be turned off in Settings menu.
- Added support for block presets with "blank" tiles. You can now have presets of any shape (not strictly rectangle shape).

Ad 4)
- Added "name" property under [Basic] section for specification of user-friendly tileset name
- Changed the way how rules (minimap color rules, fill area rules) are specified. Rules are now specified in this form:
  $attrubites_tile_must_have
  -OR-
  $attrubites_tile_must_have;$attrubites_tile_must_not_have
  If $attrubites_tile_must_have is negative, it means tile must have ANY of specified attributes.
  To design a rule, you can simply use specific filter on Tile Attributes editor and just copy the rule specification.
- Fill area rules now have names. The names correspond to area types in Select mode.
- You can specify up to 12 paint groups in [Paint_Tile_Groups] section.
  Groups A,B,C,D are reserved for thin spice, thick spice, concrete and void.
  Groups 1-8 are tileset-specific groups you can use for any terrain type.
- The list of tiles used by a paint group is no longer specified by marking those tiles by editor attributes 
  (Paint type 1-4), but directly as part of paint group specification ("GroupX.paint_tiles"). You can specify same tile
  number multiple times, which would increase probability of that tile being randomly selected.
- The block presets used by "Auto-smooth edges" feature (Shift-click) are specified with "GroupX.smooth_preset_group" and
  "Group2.smooth_presets" properties. The presets are specified as list of keys on keyboard. There are three different 
  modes of "Auto-smooth edges" feature:
  1) 20 presets mode: used by original Dune2000 tilesets. Uses 12 1x1 blocks and 8 2x2 curved blocks.
  2) 12 presets mode: uses only 1x1 blocks (4 straight blocks, 4 corners, 4 inner turns).
  3) 14 presets mode: 12 presets plus two double-corner presets (used in for example Warcraft 2 tilesets)
- Added paint group restruction rule, which can be specified as "GroupX.restriction_rule"
- The [Spice_Settings] section was completely removed. The spice minimap colors are now specified as additional minimap 
  color rules. The thin/thick spice name, tile and restriction rule is specified as part of paint group A and B.
- Spice is now also specified as separate fill area group.
- Changed way how custom block presets (= blocks consisting of tiles not continuously arranged in tileset) are specified.
  You no longer need to specify them under separate [Custom_Blocks] section, but directly under [Block_Preset_Group_X]
  section along with standard blocks. To distinguish custom blocks, the width and height must be negative.
  You can utilize "Preset Helper" feature to easily design a block preset, and then copy its code and paste to .ini file.
- Normal block presets are represented as "width.height.tileset_x.tileset.y", but you can newly specify them also in
  simplified form "width.height.tile_index"
- Added "default_paint_group" under [Basic] section which is used to fill a new map. If not specified, group 1 is used.

 

Enjoy! Looking forward to your feedback.

D2kEditorv2.0pre1.zip

Edited by Klofkac
  • Upvote 1
Posted

Alright. download it already. Avast like to "suspect" about your editors but usually after a while it sais it is safe, so I cannot open it right now.
But I will being to use from now on my new work.
I will try the thing with the Custom folder-stuff because I want to rename "Smuglers" as "ordos" and "ordos" as another thing.

{Players.ini file}

The lines that have the "{}" means "you can rename as you want" if I am not wrong, right?

Those deployable menus (intel, colour.bin file, mods.file) will reconize already existing folders I guess, just like with the music. Good thing I was cautious and instead making multiple "campaign folders" per every campaign or single mission of mine, I grouped all my works (that needed something extra) as the same campaign-name and inside there are several mods-folder for every thing.

6 hours ago, Klofkac said:

Also, now I'm leaving for vacation without access to my computer, so I simply did not want to let you wait for quite a long time without anything new to try.

Enjoy your vacation; thanks for all the work.

Do you want this almost-definitive version to be in the Index?

  • 2 weeks later...
Posted

Great work! 

Probably a no-need-to-fix, I got a EInOutError when I loaded it with my working folder, which has some modified bin files. The cause appears to be the use of a modded Colours.bin which contained only colors for 3 houses (96 bytes) for my experimentation, instead of the expected 8 houses.

npnf56X.png

The application closes after acknowledging this error message. A possible improvement could be to indicate to the user which file has an issue, but it is more of a nice to have.

Enjoy your vacation nonetheless!

 

 

Posted
On 7/14/2020 at 4:47 PM, lovalmidas said:

Probably a no-need-to-fix, I got a EInOutError when I loaded it with my working folder, which has some modified bin files. The cause appears to be the use of a modded Colours.bin which contained only colors for 3 houses (96 bytes) for my experimentation, instead of the expected 8 houses.

Uh oh, it's definitely crashing due to attempting to load an invalid file. I'm actually pretty surprised you made a Colours.bin file with only 3 entries - is the game itself able to load this at all, or it is crashing?

Posted (edited)

I found a big problem on your editor.

This is a mission that was already release for a while know, but I wanted to launch the game to get some ingame screenshots.

However, I am getting this error:
image.png.114ac0e99ca022f1afbb2f908914243c.png

And to show you that this error makes no sense, here the stats on the game:

image.thumb.png.e90c4c9683df9a3bcebf5883c7bf3ebe.png

Sandworm side only have units, don't own a single building, in fact, not even combining all the faction buildings you only have 17 windtraps in total, which it is a really low number for any standart, as it is a small map with low tech.

Even on a clean map with no .ini, no .mis file, all as default as it can get and still your editor refuse to launch the game.

I found the problem. Your editor it's counting sandworm units as "refs".

This is my playground map I use for testing purposes on how the AI behaves and so on. It will launch fine.

image.thumb.png.1b071b989f06da8a1d525541eeb9cf42.png


But as soon as I add 11 units into the game and try again, game trigger an error

image.thumb.png.43c6c951903829baf7191ed30d68a5c5.png

Edit: I found that this is better (and worse) than expected, the quads, all of them, are counted as refineries. It happens for any faction.

image.png.c0a07a846f1246b5533d1102e668b7eb.png <-- just for placing quads around.

I found that this problem was since version 1.4rc3, but not on rc2; probably when you added the trigger to warn about the amount of refs, blooms and so on, you set the quads into the same group.

probably you editor thinks that quads are refs and tell the modder that it has too many refs; I tried myself placing infantry, trooper, raider, missile tanks... all the units available and only happens with the quads (with refineries also happens).

Edited by Cm_blast
Posted
6 hours ago, Cm_blast said:

I found a big problem on your editor.

Thanks for reporting this error!

It's caused by a silly oversight in coding. I am checking the structure index, but not checking whether structure is building or unit. Because Quad has same index as refinery, it is also counted as a refinery. It was pretty easy to fix.

Posted

I was scared the first time I saw, I was "wait what? on this mission?" like, not a mission with 5 players and big bases no, the one with the most average set up ever.

Good thing I am getting a few clips here and there and found by mistake, because preplacing 12 quads it's not something a mission will present (but spawns).

Posted
On 7/18/2020 at 3:55 AM, Klofkac said:

Uh oh, it's definitely crashing due to attempting to load an invalid file. I'm actually pretty surprised you made a Colours.bin file with only 3 entries - is the game itself able to load this at all, or it is crashing?

The game happily reads whatever values that are in there so no crashes. It also happily reads beyond the size of the colours.bin file as padded 0x00 values. The memory space also initializes with 0x00 values. So extra colors were seen as black.

I have a customized colours.bin with 3 house color sets (3 x 16 colors) and another with 16 house color sets (16 x 16 colors) to experiment with an exe modification that moves the memory where game stores and subsequently reads colours.bin, to allow proper rendering of 16 colors. Basically, the limitation of 8 house color sets is caused by the fact that the game allocates only enough space for them, and fills the space right after with other data, and it does not protect against invalid house index and happily reads from data meant to be for something else.

 

 

Posted
On 7/22/2020 at 12:35 AM, lovalmidas said:

to allow proper rendering of 16 colors

Hmm, I was thinking about this. However, allocation index drives not only the player's building/units colors, but also the player house!

What I mean, when you use allocation index 0, the structures have not only blue color, but also all buildings and units use Atreides type, both graphical and functional (i.e. Atreides-style Heavy Factory can produce sonic tanks etc). For index 1 you get Harkonnen and for 2 Ordos, but for example when you use index 6 you get Mercenaries (Ordos style, but they have their own special Heavy Factory type).

For all allocation indexes 7 and above, you get just Atreides-style buildings (and from what I know, it's kinda buggy, as you cannot deploy a MCV, probably), so if you extend colours to 16 entries, all the additional indexes will be limited (you get only buggy Atreides). Furthermore, you cannot have more than 8 players on a map at once. So will it even be any significant benefit extending number of colour entries? Now you can have custom Colours.bin per individual mission anyway.

Posted
1 hour ago, Klofkac said:

Hmm, I was thinking about this. However, allocation index drives not only the player's building/units colors, but also the player house!

What I mean, when you use allocation index 0, the structures have not only blue color, but also all buildings and units use Atreides type, both graphical and functional (i.e. Atreides-style Heavy Factory can produce sonic tanks etc). For index 1 you get Harkonnen and for 2 Ordos, but for example when you use index 6 you get Mercenaries (Ordos style, but they have their own special Heavy Factory type).

For all allocation indexes 7 and above, you get just Atreides-style buildings (and from what I know, it's kinda buggy, as you cannot deploy a MCV, probably), so if you extend colours to 16 entries, all the additional indexes will be limited (you get only buggy Atreides). Furthermore, you cannot have more than 8 players on a map at once. So will it even be any significant benefit extending number of colour entries? Now you can have custom Colours.bin per individual mission anyway.

I want to point that the index higher than 7 that have "buggy Atreides" in reality you are getting the sandworm index, which it's the "faction" that cannot deploy a MCV as they don't have the ownership of any Construction Yard (as it is seen in Tibed, "other" doesn't own any of the 3 CY, reason why the game crash).

There are sill some Atreides index around there, but most of the black are "sandworm"; If at any point anyone require the index-list I can provide with a few index that we know they are full Atreides.


By the way Klofkack; As a suggestion, if there is a posibility of your editor to change this values quickly at the same time?
image.png.7dbe07668c87a3f11815eac1ea39dcad.png

If I want to change all to "0", or when importing an AI every building has certain values and I may want to alter them into "1,000", and you have to go 1 by 1, I wonder if there is any possibility of altering then all in once.

I guess you already know by now, but also making your editor to load the color directly, not just for events but for units/buildings.
image.png.dd7ef6090eff5a75f1a42b34fd5df7a8.png

The event recolor it's fine, but would be nice if the rest was this way too, as right now index 2 use that wine color and it is index 5 the one that use the Ordos green, which can be a bit confusing.

If I am not wrong you said something about applying the custom colours.bin into the editor, but I wonder if could be possible to make the editor to read the custom version directly withouth renaming the original or moving that custom color. Just for quick fixes that the mission needs in the future when it is released and I am no longer creating this campaign but another one.

Posted
1 hour ago, Cm_blast said:

I want to point that the index higher than 7 that have "buggy Atreides" in reality you are getting the sandworm index, which it's the "faction" that cannot deploy a MCV as they don't have the ownership of any Construction Yard (as it is seen in Tibed, "other" doesn't own any of the 3 CY, reason why the game crash).

Ok, yes, as you say, it's actually Sandworm, which happens to use Atreides-style buildings.

1 hour ago, Cm_blast said:

By the way Klofkack; As a suggestion, if there is a posibility of your editor to change this values quickly at the same time?

Currently the value list editor does not support change of multiple entries at once. I will need to have look at whether and how this could be achieved.

1 hour ago, Cm_blast said:

I guess you already know by now, but also making your editor to load the color directly, not just for events but for units/buildings.

The event recolor it's fine, but would be nice if the rest was this way too, as right now index 2 use that wine color and it is index 5 the one that use the Ordos green, which can be a bit confusing.

The main problem is, that editor loads a static image with unit/building graphics (graphics\structures.bmp). The graphics is prefabricated (created by taking screenshots from game) and recoloring it with colors from colours.bin would be not feasible. To make this happen, I would pretty much need to reimplement/mimic the game's drawing code, and load the graphics directly in the game's format (DATA.R16) which would be pretty huge additional feature and coding.

1 hour ago, Cm_blast said:

If I am not wrong you said something about applying the custom colours.bin into the editor, but I wonder if could be possible to make the editor to read the custom version directly withouth renaming the original or moving that custom color. Just for quick fixes that the mission needs in the future when it is released and I am no longer creating this campaign but another one.

Uh, I'm not sure if I understand what you mean here. But It works the way, that in the fields where you specify campaign folder and mods folder, there's a cield called "Colours.bin" file, where you specify name of file (located under CustomCampaignData\CampaignFolder\Colours\your_custom_colours.bin) and editor will load and use it for this individual mission.

Posted (edited)
1 hour ago, Klofkac said:

Currently the value list editor does not support change of multiple entries at once. I will need to have look at whether and how this could be achieved.

As a workaround could be a way to set a certain value applied to all, I mean, maybe not just turning 3 buildings as 20,000 priority, but turning all of there at once as 20,000, or 1,000, or 0,000, and if later I need to alter certain buildings then doing it manually.
Not really like a must have option, manually can be done with no trouble.

1 hour ago, Klofkac said:

The main problem is, that editor loads a static image with unit/building graphics (graphics\structures.bmp). The graphics is prefabricated (created by taking screenshots from game) and recoloring it with colors from colours.bin would be not feasible. To make this happen, I would pretty much need to reimplement/mimic the game's drawing code, and load the graphics directly in the game's format (DATA.R16) which would be pretty huge additional feature and coding.

Nevermind then. I can remove the use of the colors while editing for clarification and adding it when the mission it's done to launch with the custom colors.

1 hour ago, Klofkac said:

Uh, I'm not sure if I understand what you mean here. But It works the way, that in the fields where you specify campaign folder and mods folder, there's a cield called "Colours.bin" file, where you specify name of file (located under CustomCampaignData\CampaignFolder\Colours\your_custom_colours.bin) and editor will load and use it for this individual mission.

I mean that if I use my custom color bin and apply/ovewritte with the one included on the editor it will work, right? Not going to do it, just curious.

I only refer to see it into the editor itself.

Gameplay wise I already did an update on all my previous works, you can play the dune 2 retro or the jorney to the past mission that use the dune 2 retro tileset and the custom color for them, the custom crates and so on, and it works fine, although I did all this before you have the editor released, so I did it manually. But I played most of them and seems to work fine so far.

Right now on my new campaign I am using custom colors and tibed modded stuff, and using your editor instead editing the .ini manually just to try it as well. Even the player thing works really fine, it auto-loads the moment you add it or remove it.

The player.ini part has no purpose into the game itself , or it does? any line that I am no aware that from "Ordos" change into "Player" because I wrote it that way?

Edited by Cm_blast
Posted

 

On 7/24/2020 at 5:46 PM, Klofkac said:

Hmm, I was thinking about this. However, allocation index drives not only the player's building/units colors, but also the player house!

Yep. This is only a piece of the puzzle. I have not yet investigated how allocation indices drive the selection of the player house, but at some point I hope to make an edit to the executable so that the player house is effectively "alloc. index mod 8" instead of "Max( 7, alloc. index )", or a more flexible method, if possible. 

 

Loading custom colours.bin is probably the easier (and probably the preferred way in modded content), when you are willing to work with third-party launchers. The benefit of extended Colours.bin file with > 8 colors is mostly research points into finding out how the game handles allocation indices (Funkyfr3sh modded the game so that indices > 2 use Ordos unit voices & Announcer / EVA.) If this can be customized into a mapping (or extended to support more Announcers), that would be sweet (though this may require modifications to templates bin as well).

 

On 7/24/2020 at 9:07 PM, Klofkac said:

The main problem is, that editor loads a static image with unit/building graphics (graphics\structures.bmp). The graphics is prefabricated (created by taking screenshots from game) and recoloring it with colors from colours.bin would be not feasible. To make this happen, I would pretty much need to reimplement/mimic the game's drawing code, and load the graphics directly in the game's format (DATA.R16) which would be pretty huge additional feature and coding.

With the templates bin format known, loading from Data.R18 may be possible. But I am still working on a template bin editor (that integrates with an Data.R18 editor) and it is definitely not a trivial endeavour. xD

An easier alternative would be to extract only the images as a 8bpp image (I'm trying to get my Data.R18 editor to do that instead of exporting as true color RGB). Recoloring a 8bpp image is much easier as the palette is already embedded in the image. The current editors only export as a true color RGB so you may have to wait for me to finish my version, or try a hand in parsing the data.R18 file yourself. :D  

  • Like 1
Posted
On 7/24/2020 at 1:39 PM, Cm_blast said:

By the way Klofkack; As a suggestion, if there is a posibility of your editor to change this values quickly at the same time?

I took a look at this, and this is possible. However, it works only if you select one value, then hold shift, and press down or up arrow key to select a range. It does not work with holding shift and clicking. But it is pretty well usable - you make a range selecton, write a value, and same value goes to all properties within range.

On 7/24/2020 at 4:35 PM, Cm_blast said:

I can remove the use of the colors while editing for clarification and adding it when the mission it's done to launch with the custom colors.

You probably do not know about "LoadCustomColoursBin" setting in D2kEditor.ini. Change it to 0, and editor will use only the default colors.

56 minutes ago, lovalmidas said:

With the templates bin format known, loading from Data.R18 may be possible. But I am still working on a template bin editor (that integrates with an Data.R18 editor) and it is definitely not a trivial endeavour. xD

How much did you examine the templates.bin file and how much you know about the data in it (meaning of the bytes)? You already wrote something in your templates.bin research thread, but knowing the data structure declarations would help there.

Posted
On 7/26/2020 at 9:28 PM, lovalmidas said:

or try a hand in parsing the data.R18 file yourself

Okay, so... Here it goes:

Xk10cS7.png

kPavKeo.png

I'm now able to load buildings and units graphics from DATA.R16 directly, and easily dynamically recolor images with colors from COLOURS.BIN. Thanks to your Spice2k source code (https://github.com/nguoiyoujie/Spice2k/blob/master/src/Dune2000/Structs/R16/ResourceElement.cs) I was able to understand the DATA.R16 format and how to parse it.

How is your investigation of TEMPLATES.BIN formats? I could notice UnitTemplate struct format is ready, but BuildingTemplate not yet. That would help me too.

Reading graphics data directly from DATA.R16 directly is indeed advantageous, but also some issues. The most important issue is drawing of stealth units (stealth fremen and raider) - those units seem to use regular unit's graphics and the stealth effect is made by the in-game renderer. Also the side color cannot be seen on a unit in stealth mode. I'm thinking how to render stealth units - maybe whole unit shape with a solid color (the side color). The second issue is, that the Carryall and Frigate are too much spacious and they occupy much more space than size of a tile. I wonder how that would look in editor.

  • Upvote 2
Posted
44 minutes ago, Klofkac said:

I'm now able to load buildings and units graphics from DATA.R16 directly, and easily dynamically recolor images with colors from COLOURS.BIN.

lmao awesome

This is an awesome change. It would mean we wouldn't need to go modding the editor itself and could go modding the game, and then the editor would just read those changes. Klof, you are a freaking miracle worker. :D

Posted
7 hours ago, Klofkac said:

How is your investigation of TEMPLATES.BIN formats? I could notice UnitTemplate struct format is ready, but BuildingTemplate not yet. That would help me too.

I have not had time to read that yet, but the only thing that is really important in UnitTemplate / BuildingTemplate, in relation to data.R16 and rendering, is the UnitArt / BuildingArt / TurretArt entries (as seen in TibEd). If you want to render stealth, perhaps also the Special Logic entry.

The idea is that art entries are divided into

  • UnitArt (each entry with X frames * D directions), including turrets
  • BuildingArt (1 BuildingBase + D directions (healthy frames) + D directions (damaged frames)), including turrets
  • ProjectileArt (X frames * D directions)
  • Animations (used by explosions, building buildup animations, building active animations, smokes or some special animations (harvester docking)

The sections after those main sections (Unit, Building, Weapon, Explosion) are what is important for the game to inform itself how many of each frames each entry takes. 

template_bin_sections.txt

 

Data.R16 image order, as known thus far. This includes the context of other images (some to be confirmed). Generally, unit image data starts from the 206th entry, and then the game uses the information obtained from Templates.bin in order to determine how many entries are loaded for one art. 

sym_addenum.txt

 

7 hours ago, Klofkac said:

The most important issue is drawing of stealth units (stealth fremen and raider) - those units seem to use regular unit's graphics and the stealth effect is made by the in-game renderer. Also the side color cannot be seen on a unit in stealth mode. I'm thinking how to render stealth units - maybe whole unit shape with a solid color (the side color). The second issue is, that the Carryall and Frigate are too much spacious and they occupy much more space than size of a tile. I wonder how that would look in editor.

I think an editor can afford some leeway to not require exact rendering since an editor is not the game, although you can go ahead with an exact rendering if you want. Carryall and Frigates can be resized to 32x32 without much confusion since a single tile is the atomic unit in the map format (you can't preload 5 infantry in the same tile, unfortunately).

For stealth, the stealth 'static' animation seems to be entries 178 - 193. And then the stealth alpha mask seems to be entries 194 - 205. Knowing whether a unit is stealthed is also a bit tricky, since:

  • It involves reading the unit's definition for Special Logic.
  • There is a hardcode in the game that applies stealth for a unit named "STEALTH RAIDER" (probably a coding afterthought since the unit is added in a patch, and the special logic infrastructure is not as modular as I thought it would be)

 

 

 

 

  • Upvote 1
Posted
On 8/1/2020 at 8:50 AM, lovalmidas said:

...

Thank you for sharing the information! It definitely looks helpful. I'll try my best to understand that and make the editor render all buildings and units properly.

  • 2 weeks later...
Posted
On 8/1/2020 at 8:50 AM, lovalmidas said:

...

According to information provided by you, I am now able to parse TEMPLATES.BIN properly, and compute DATA.R16 image entry indexes for unit art, building art, projectile art, animation art etc. Here I made a helper program that parses all the values (DATA.R16 image entry indexes are usually those 4-digit numbers) :

wA0hM9v.png

Sedondly, I discovered the logic how the game determines the version of building or unit (for example Harkonnen get Harkonnen-style buildings, only Emperor gets Emperor-type Construction yard and Heavy Factory, only Smugglers get Smugglers-type Starport, Sandworm gets Atreides-style buildings etc). I can precalculate the unit/building versions, and here are the results (they should match the real game behavior): unit_side_versions.txt building_side_versions.txt

@lovalmidas thank you very much for providing all the information you discovered, which pushed me way forward!

  • Like 1
  • Upvote 1
Posted

More news from me: I'm in the middle of my way implementing D2kEditor loading all graphics and building and unit configuration from game's internal files (DATA.R16, Templates.bin).

Here's a little teaser:

FuPB9Ta.png

  • Upvote 1
Posted
5 minutes ago, Klofkac said:

More news from me

More amazing news from the miracle-maker himself. :D Awesome!

By the way, you're not gonna believe this, but I figured out what the problem was with the ConYard shit: Tech level. Seriously, that was it. Because the tech level of the SLasher megaturret was set to 9 so that Shock Raiders could be available without the SLasher, and ConYards were moved as a result, the SLasher became the ConYard while the ConYards themselves acted as simple prerequisite structures for the basic stuff like concrete and Wind Traps.

Weird. But, I thought you might want to know. :P

Posted

I am trying to understand this, does this mean that instead of using the graphics from the editor that the editor will now pull whatever graphics is used in the game for editor use? I see nothing different in the image posted but I know something is important. Sorry for my Newbie question.

 

 

Posted
2 hours ago, firefly101 said:

does this mean that instead of using the graphics from the editor that the editor will now pull whatever graphics is used in the game for editor use

Yep! The kicker is that rather than mod the editor itself to, say, have the sprite for your new machine gun Trooper in, the editor will read the modded game files. Pretty sweet, eh?

Posted
On 8/20/2020 at 11:16 PM, Klofkac said:

More news from me: I'm in the middle of my way implementing D2kEditor loading all graphics and building and unit configuration from game's internal files (DATA.R16, Templates.bin).

I guess this will load any new graphics as those Fey units; I don't know on combining visual units (but still using vanilla ones) or if you remove the grenadier from the "game"; let's say, I alter the grenadier to be a second devastator, so the Harkonnen use devastator number 1 and the others get devastator number 2 (which could be any unit); I wonder if in this hipotetic case your editor will fail to ever load the grenadier (as his behaviour was suppose to be devastator) and if will difference bewteen the two devastators (just like right now there are 2 type of sardaukar, but as they look the same I don't know if visually your editor is picking the one it correspon or just 1 of them for the visual).

Which, by the way, if you want to test if this new graphical stuff works, you can use my "EBFD - <HOUSE >ASSAULT"; turrets controled by sandworm don't have the top-turret, the thumper and the engineer have been altered to be other units, a raider with a combat tank canon and a the other it's a quad wearing a siege tank canon (bot preplaced on the mission). I don't have custom colors (just high index), but for the units itself it can give you an insight if you want something quick to load and see if it is loading well.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.