Jump to content

Recommended Posts

Posted (edited)

I am looking at one of the big .bin files. This is currently a very preliminary research, as at this stage all I can do is to recreate the past discoveries by TibEd and other people, before I can break new ground.

As such, this is a very preliminary research. I hope to share this here so in the future, other people can read and save on the discovery (I can also put my research on GitHub or something, but I have not put my mind into that)

 

Here is what I guess the game executable reads the Templates.bin file and splits it into different areas. These structural divisions is fundamental to how the game interprets the bin file. For instance, the game will reserve a block of memory for Unit data, and a different memory block for Building data.

UjoewkT.png

With the help of TibEd and running the game, these are my guesses on what each section belongs to.

gZsADr5.png

------------------------------------------------------

Text copy of above image

Spoiler

 

Templates.bin
    Units                    up to 0x3c (60) possible? 0x1e (30) used
    UnitBehaviours            
    Buildings                up to 0x64 (100) possible? 0x3e (62) used
    BuildingBehaviours        
    Weapons                    up to 0x40 (64) possible? 0x22 (34) used
    Explosions                up to 0x40 (64) possible? 0x3c (60) used


Allocations:
    
    Size(h)    Size(d)    Offset(h)        Section                                Comment
    0x3c00    15360    000000            Unit definitions                    0x3c instances x 0x100 bytes each            0x1E instances used
    0x68b0    26800    003c00            Building definitions                0x64 instances x 0x10c bytes each            0x3E instances used
    0x0700     1792    00a4b0            Weapon definitions                    0x40 instances x 0x1c bytes each            0x22 instances used
    0x0200      512    00abb0            Explosion definitions                0x40 instances x 0x08 bytes each            0x3C instances used
    0x0168      360    00adb0            ???                                    
    0x0168      360    00af18            ???                                    
    0x0004        4    00b080            ???                                    Value = 1D (unit count related?)
    0x0001        1    00b084            Unit count                            Value = 1E
    0x0004        4    00b085            ???                                    Value = 3C -> qty of next section (explosion count related?)
    0x0100      256    00b089            ???                                    0x3C int values
    0x0001        1    00b189            ???                                    Value = 3C (explosion count related?)
    0x0004        4    00b18a            ???                                    Value = 22 -> qty of next section (weapon count related?)
    0x0100      256    00b18e            ???                                    0x22 int values
    0x0001        1    00b28e            ???                                    Value = 22 (weapon count related?)
    0x0004        4    00b28f            ???                                    Value = 41 -> qty of next section (building count related?)
    0x01e0      480    00b293            ???                                    0x41 int values
    0x0001        1    00b473            Building count                        Value = 3E 
    0xAFC8    45000    00b484            Building name strings                0x64 instances x 0x1c2 bytes each
    0x0c80     3200    01643c            Weapon strings                        0x40 instances x 0x32 bytes each
    0x0c80     3200    0170bc            Explosion strings                    0x40 instances x 0x32 bytes each
    0x6978    27000    017d3c            Unit name strings                    0x3c instances x 0x1c2 bytes each
    0x0BB8     3000    01e6b4            Unit behaviour strings                0x3c instances x 0x32 bytes each
    0x1388     5000    01f26c            Building behaviour strings            0x64 instances x 0x32 bytes each
    0x0056       86    0205f4            ???                                    
    0x0100      256    02064a            ???                                    
    0x0064      100    02074a            ???                                    
    0x0064      100    0207ae            ???                                    
    0x0001        1    020812            ???                                    18
    0x0001        1    020813            ???                                    1A
    END                020814
   

------------------------------------------------------

At a glance, the game appears to support up to 60 unit types, 100 building types, 64 weapon types and 64 explosion types.

I attempted to change what I suspect to be the Unit and Building Count, and I have some varied responses:

  • Decreasing the values and loading a mission where such a value is needed leads to crash on mission load.
    • Setting Unit Count to 0x00 up to 0x19, and loading A1V1 leads to crash at mission load with error "MyVersionOfUnit didn't find a unit".
      ndQT9bj.png
       
    • Setting Unit Count to 0x1A just below the Sandworm ID (25), leads to crash to desktop (no error message)
       
    • Setting Unit Count to 0x1B just equal to the Sandworm ID (25), and loading A1V1 leads to working game, with graphically maimed animations and offset build icons
      DyYMK2G.png2i3iIFK.png 
      Haha, Construction Wind Trap
       
    • Setting Building Count to 0x3B (59), and loading O9V1 leads to crash with error related to the Imperial Palace (ID 59, or the 50thbuilding in the list).
      I2IjhCz.png
       
    • Setting Building Count to 0x3C (60), and loading H5V1 leads to crash with error related to the Harkonnen Special Outpost (ID 60, or the 61st building in the list).
      17nQx0A.png
       
    • Setting Building Count to 0x3D (61), and loading O4V1 doesn't lead to crash, but the player loses instantly (since the Ordos Special Outpost (ID 61, or the 62nd building in the list)... does not exist??). This happens on both the -spawn and normal launches of the game. I am not sure why this behavior is different from the Harkonnen version.

       
  • Changing other values in the surrounding region may lead to lead to very damaging graphical glitches.
    • Clicking on the building queue (to construct a building) may lead to crash due to 'BlitErrors'

 

Hypothesis: Unit Count and Building Count works like what I think they do, but their DATA.r8/.r16 folders may be arranged specifically to the exact number of items. Either this could be controlled by the .bin file, or it is hardcoded and any modder working on adjusting the counts need to also pad their DATA files so that the image sequences are aligned correctly.

This is the extent of my current research. More to come. 

 

 

Edited by lovalmidas
  • Upvote 2
Posted

Looking great so far, loval. I look forward to when you check out unit sounds, because I need to be able to mod those unit reporting sounds! :P

Posted
On 6/30/2020 at 10:30 AM, lovalmidas said:

I am looking at one of the big .bin files. This is currently a very preliminary research, as at this stage all I can do is to recreate the past discoveries by TibEd and other people, before I can break new ground.

As such, this is a very preliminary research. I hope to share this here so in the future, other people can read and save on the discovery (I can also put my research on GitHub or something, but I have not put my mind into that)

 

Here is what I guess the game executable reads the Templates.bin file and splits it into different areas. These structural divisions is fundamental to how the game interprets the bin file. For instance, the game will reserve a block of memory for Unit data, and a different memory block for Building data.

Good to see someone is taking a deep look into this.

I personally wanted to do some research of templates.bin file on my own, but I am quite busy with editor development, so did not really get into this much more than taking a quick look into it in a hex editor. I was thinking of loading this file in editor directly and reading some data from it, like the building and unit names, so editor would display them in UI without need to have building and unit names stored in separate editor's configuration files. But the names in templates.bin are not very appropriate, like Sietch is called as Fremen Barracks and other things like that, so I scrapped that idea.

I can see you are using some good tool for decompiling the code, which looks really nice and useful. I tried to use OllyDebugger and tried to read the assembly instructions directly, when I was examining the possibility to push the limits of events and conditions number. Ended up figuring out the game does not load .MIS file as a whole into continuous segment of memory, but it reads individual sections of file into randomly arranged segments of memory. Some editing of game exe would be definitely needed to increase limit of events and conditions number, and the hardest part is keeping the compatibility.

Adding the amount of building and unit types (without replacing existing) is one thing I wanted to see being possible. There are 100 building and 60 unit entries in templates.bin, so the game designers left really huge reserved space for much more stuff to be potentially added in future. Hopefully we can find a way how to take advantage of it. Thumbs up for your further research.

Posted (edited)

Alright, I managed to look into how the game loads the Data.r8 / Data.r16 file, since previous tests determine that playing with unit counts messes with animations, and animations are images, and images come from the data resource files.

 

Here are the results, thus far:

unknown.png

* I suspect UnitTypes and BuildingTypes are simply indices, since they don't appear to carry more data than a name reference. I suspect those two to be relevant to how the sidebar icons are arranged. (e.g. why Wall appears before Refinery)

 

I am not very good at reading assembly, so having Ghidra IDA (it's open source) to decompile to a C-like flow helps a lot. This research has also been made much faster by MVI's old repository where the functions for processing images / BMP / TAR had been discovered, making it much easier to analyze the function loading the data resource file. 

 

Some major findings:

  • In analyzing the Data.R16 file, I discovered an issue with the existing Resource Editor. The editor consumes null bytes so the user does not see them. 
    On the contrary, the game does read the null byte as an empty entry (i.e. nothing is rendered). This is critical, as the game performs precise counting of the number of image frames an object has and read the same number of images in the data resource file to assign to that object. The empty entries act as 'padding', and are very important if we want not to replace entries, but to add to them and modify their ordering.

    For example, Templates.bin specifics 34 image frames for each of the 8 directions for Light Infantry, making a total of 272 images. There are 20 empty entries (situated around the death animations), so the existing editor sees only 252 entries.
     
  • Unit art is different from Unit. TibEd seems to be already aware of this.
     
  • The sections in the middle are all numbers instructing the game how many images are to be loaded for each unit art, building art, projectile art, animation (including explosions) etc. All these are used when the game loads the data resource file.

 

I attach a set of my findings below, in three files (within one zip):

 - A dataR16 folder, which contains the extracted images from the Data.R16 resource file. Each entry is named "test_xxxx_yyyyyy", where xxxx is the image entry ID, and yyyyy is the hexadecimal address of its starting location. Empty entries are represented by 1x1 transparent pixel (actually 0x0 to the game).

 - sym_addenum.txt, which carries my findings for the game loading Data.R16 file, including memory addresses of where each image is sent to. I consider the Data.R16 loading mechanism to be almost fully discovered.

 - Template_bin_sections.txt, which carriers my findings for the templates.bin file (seen in above image). 

dataR16.rar

 

I have also added some code that is able to parse the resource file and include the empty entries: https://github.com/nguoiyoujie/Spice2k/commit/1f3f8ace4f88eaa60ff42473b642da2f0ac9c63d . Credits to mvi, funkyfr3sh and co. for the original resource editor which allowed me to speed up other discoveries. This code was used to generate of the dataR16 folder as attached. (I should make some kind of test suite with the v1.06 files so I don't test on Program.Main()) :D

 

Edited by lovalmidas
  • Upvote 1
Posted
On 7/1/2020 at 5:43 AM, Fey said:

Looking great so far, loval. I look forward to when you check out unit sounds, because I need to be able to mod those unit reporting sounds! :P

On the unit sounds, if you are using TibEd to edit them, there is a bug:

unknown.png

The true sounds are:

  • AtreidesReporting1 = Reporting1
  • AtreidesReporting2 = Reporting2
  • AtreidesReporting3 = Reporting3
  • HarkonnenReporting1 = Reporting4
  • HarkonnenReporting2, (absent in TibEd)
  • HarkonnenReporting3, (absent in TibEd)
  • OrdosReporting1, (absent in TibEd)
  • OrdosReporting2, (absent in TibEd)
  • OrdosReporting3 = Reporting5

Each values takes an integer represent the sound ID.

 

The highlighted region to the right (hex 0x6C to 0x7B) are not seen in TibEd.

That could be the reason why you were unable to edit some reporting sounds.

At this time, while there is no template editor yet, you can use a hex editor to fix those values: 

  • HarkonnenReporting2 location = N * 0x100 + 0x6C, 
  • HarkonnenReporting3 location = N * 0x100 + 0x70, 
  • OrdosReporting1 location = N * 0x100 + 0x74, 
  • OrdosReporting2 location = N * 0x100 + 0x78, 

where N is the UnitID

 

Posted
2 hours ago, lovalmidas said:

The highlighted region to the right (hex 0x6C to 0x7B) are not seen in TibEd.

That could be the reason why you were unable to edit some reporting sounds.

At this time, while there is no template editor yet, you can use a hex editor to fix those values: 

  • HarkonnenReporting2 location = N * 0x100 + 0x6C, 
  • HarkonnenReporting3 location = N * 0x100 + 0x70, 
  • OrdosReporting1 location = N * 0x100 + 0x74, 
  • OrdosReporting2 location = N * 0x100 + 0x78, 

where N is the UnitID

Awesome!! I'm so glad to know this is possible. I'm gonna have to contact my VAs and ask for more lines. Man, they're gonna hate me. 😅 But this is gonna be so worth it!!

  • 1 month later...
Posted

So I was doing some research of Building Template data, the meaning of all the byte values. Some values are already covered by TibEd, all the others are available on the Unknown tab in TibEd. I concentrated on meaning of those unknown values.

Here is my research do far. Letter B means a single-byte value, D means "Doubleword", a 4-byte value (marked as Long in TibEd).

Spoiler

D   0 Strength (hit points)
B   4 ?? (side bitfield)
B   5 ?? (various values 1 - 8)
B   6 ?? (only zeros)
B   7 Range of fire (by TibEd)
B   8 Crewed (by TibEd)
B   9 ?? (only zeros)
B  10 ?? (only zeros)
B  11 ?? (only zeros)
B  12 Primary weapon (weapon type)
B  13 Secondary weapon?? (by TibEd) (weapon type, 255 on everything)
B  14 Armor type (by TibEd)
B  15 ?? (1 on turrets, 0 on everything else)
B  16 Tech level required for build
B  17 Tech level required for upgrade
B  18 ?? (255 on everything)
B  19 ?? (5 on heavy factories except mercenary, 255 on everything else)
D  20 Building art index
D  24 Barrell art Index
D  28 Build cost
D  32 Upgrade cost
D  36 ?? (only zeros)
D  40 ?? (200 on heavy factories except mercenary, 0 on everything else)
D  44 Build speed (by TibEd)
D  48 Upgrade speed
D  52 ?? (50 on heavy factories except mercenary, 0 on everything else)
D  56 ?? (50 on heavy factories except mercenary, 0 on everything else)
D  60 Power consumption/production
D  64 Prerequesite building 1 (building type index)
B  68 ?? (side bitfield)
B  69 Prerequesite building 1 upgrade needed (1 = yes, 0 = no)
B  70 ?? (only zeros)
B  71 ?? (only zeros)
D  72 Prerequesite building 2 (building type index)
B  76 ?? (side bitfield?)
B  77 ?? (only zeros)
B  78 ?? (1 only on LARGE GUN TURRET, 0 all other)
B  79 Destruction explosion (explosion index)
D  80 Tiles occupied by building - all tiles (tile bitfield)
D  84 Tiles occupied by building - solid tiles (tile bitfield)
B  88 Animation flags (64 = has animation, 16 = continuous animation)
B  89 Flags? (1 = ??, 2 = building is selectable, repairable, will be set on fire when damaged and will release infantry when destroyed , 4 = ??)
B  90 Flags (32 = draw building bottom, 64 = do not decay without concrete + do not create concrete (used on Sietch), 128 = ?? (used on light, heavy and hi-tech factory))
B  91 ?? (only zeros)
B  92 ?? (various values)
B  93 ?? (various values)
B  94 ?? (only zeros)
B  95 Sight (by TibEd)
B  96 Building exit point 1 X coordinate (MEDIUM GUN TURRET, LARGE GUN TURRET has strange value 248)
B  97 Building exit point 1 Y coordinate
B  98 Building exit point 2 X coordinate (HARKONNEN PALACE has strange value 60)
B  99 Building exit point 2 Y coordinate (HARKONNEN PALACE has strange value 247)
A 100-131 Direction frame mapping
B 132 ?? (only zeros)
B 133 ?? (various values)
B 134 Width (pixels)
B 135 Height (pixels)
B 136 Building type index
B 137 ?? (flags?)
B 138 Buildup animation index
B 139 Animation index
B 140 ?? (explosion index? - 46 = MUZ_GTUR on MEDIUM GUN TURRET, 255 on everything else)

 

I was playing around with these values:
D  80 Tiles occupied by building - all tiles (tile bitfield)
D  84 Tiles occupied by building - solid tiles (tile bitfield)
and there are very interesting and funny results:

Any crazy shape concrete:

s5OOQa7.png

Yay, a 4x4 concrete, very useful:

kg8RNEw.png

A compact 2x2 windtrap. More Retro-Dune2 style, isn't it?

j0LoHDT.png

Then I took advantage of this:
B  90 Flags (32 = draw building bottom, 64 = do not decay without concrete + do not create concrete (used on Sietch), 128 = ?? (used on light, heavy and hi-tech factory))

Using value 64, I was able to made a building that won't decay without concrete. So we can finally screw concrete on other planets where it does not make sense, a la Red Alert!

8nwgVv5.png

Probably someone of you ( @lovalmidas? @Fey? @Cm_blast? @Feda? ) already know meaning of some of the unknown values. For example I noticed you were able to make wall selectible with health bar and shift the selection frame. If you have such knowledge, I would appreciate if you share it here.

I also made a complete table of buildings and all the values, which helped me a lot to discover meaning of those values. Here it is, it might be helpful for you too:

buildings.txt

One thing that I cannot still figure out is, how the game determines specific house's version of building, meaning, if you play as Harkonnen, you can build Harkonnen-style buildings. It looks it has something to do with the "Owner" bitfield, but there's some logic behind this I still don't understand.

  • Upvote 1
Posted (edited)

The "+" or 4x4 concrete shape it's interesting indeed.

I did the windtrap being a 2x2 once, really long long time ago when I was trying to replicate dune 2; In Tibed there is a "Width-Heigh" values so the 2x2 windtrap was not something hard to do.

About the building without concrete and no decay + 100% health that's something that I figure it out when I made my Dune Emperor: final assault; the enemy Construction Yard you are to destroy have these conditions, the same as with the "tleilaxu turret", although if today you ask me how I did I forgot already (I know that are part of some bytes, but since that was an edition from like years ago hard to remember all the details on Tibed).

1 hour ago, Klofkac said:

One thing that I cannot still figure out is, how the game determines specific house's version of building, meaning, if you play as Harkonnen, you can build Harkonnen-style buildings. It looks it has something to do with the "Owner" bitfield, but there's some logic behind this I still don't understand.

Something that I see happening (if I remember well); if you have the harkonnen light factory not owned by anybody and you place into the editor, I think the game will give you the Ordos instead (or Atreides, just one of the other two).

In tibed you can see the ownership of all the buildings in the program, but even it's a bit mess up.
The Imperial Construction Yard, separated for the Harkonnen version, it's owned by the Emperor only, but the Harkonnen construction yard it's also owned by the Emperor.

If using an editor, if you place an Imperial CY, it will deploy all the buildings except the High Tech (as it ask for his specific CY, which it's the Harkonnen one, not being the same) and the Harkonnen Palace, same deal.

However, if you deploy a MCV, the game pick the Harkonnen CY version instead, meaning that you can deploy those buildings.

At least on Tibed, there are two requirements, the first ask for the generic building (it needs "whatever" Construction Yard), and the second an specific building (it needs "Certain" Construction Yard).
windraps have the CY as first requirement; doesn't matter which CY you captured, you only need the building "generic" to produce it, but you will deploy the one you are owned with.
but the Atreides High Tech Fact have it as secondary requirement, so it means it requires the Atreides Construction Yard, not any construction yard.

But it happens something similar with the sardaukar and his multiplayer version, because it is a bit messy, any side but Harkonnen will produce the campaign Sardaukar one (120 credits), while the Harkonnen will train the 200 credits one, even if this is a campaign mission; and it is all because the MP sardaukar it's owned by Harkonnen only.


Overall, all the ATreides kind of buildings are owned by both Atreides and Fremen
all the Harkonnen buildings are owned by Harkonnen/emperor (except the heavy fact)
and the Ordos kind of building are owned by the other three factions, even the heavy fact, but the game picks the "mercenary" version, but tecnically both are owned by the mercs, it's just that the game picks the other first, I guess because the order that the buildings are indexed? <-- same with the starport and smugglers, Smugglers have the Ordos one owner too, but the game still picks the smuggler version first.

The sandworm it's the deal that I first wrote; they don't own a single building in the game (although it is called "other"), yet they can still build everything as the Atreides with the exception of deploying a MCV, as the game try to search for that building and crash since he don't own that building.

But if the CY it's on the spot... well, he will deploy the windtraps and everything else just fine, probably programmed to be "Atreides" and as Atreides are the owner of that tree of buildings he will build them all, it's just with the CY that the game totally try to search the CY owner by "Other" and fail to do.

But if you actually give ownership you can mix tech; nothing crazy, just adding the "other" into whatever building, just as I did here:
275049909_IxMixedtech.png.18671ef8c88a057e8d4e4d90b5c15d46.png

It is not a heavy edition or a mission based, I just tried to do that, and simply picking "onwer by other" all those buildings all worked fine. Except the HTF maybe, either I forgot or I have problems to know how to make it work since this "faction" cannot build carryalls from the Atreides HTF; it gets stuck trying to build (grey queue), no idea what it happens (but only on the Atreides version), so who knows.

To summarize, the buildings have those 2 requirements, first it's the "generic" building, and the second it's the "specific version of the building".
the HTF and the palaces are the ones that changes based on which version of the Construction yard you have.
Ix and Rocket turrets tecnically depends on the kind of outpost, but since the three versions all look the same in the game it doesn't matter.

I hope anything of this help you.

The other parts with the walls being selectable, I leave that to Fey; at some point he told me, but I cannot remember exactly all that he did.

Edited by Cm_blast
Posted

Well I would like to know how to make the Windtraps like Dune2. I tried in Tibed to adjust the height and that didn't work, I also tried the unknown settings same thing it didn't work. I can't find the exact change needed to make a 2x2 square without some sort of issue. The setting to 64x64 pushes the windtrap up and removing the 3 from unknown 81 makes a 2x2 square but the when placing the windtrap it still shows the third row as used on the ground but you can place another building in that spot. I would prefer to have a clean 2x2 placement just like the normal 2x3 placement.

Posted
6 hours ago, Cm_blast said:

Something that I see happening (if I remember well); if you have the harkonnen light factory not owned by anybody and you place into the editor, I think the game will give you the Ordos instead (or Atreides, just one of the other two).

In tibed you can see the ownership of all the buildings in the program, but even it's a bit mess up.
The Imperial Construction Yard, separated for the Harkonnen version, it's owned by the Emperor only, but the Harkonnen construction yard it's also owned by the Emperor.

........

Yeah, I'm confused from this as well. But I did not do yet any experimenting changing the owner values and testing in-game, I was just looking at the values. Thanks for sharing your experience, these are indeed useful information for me, which make the ideas more clear to me. For example the information about first prerequisite being whatever type but second prerequisite being specific type, is really interesting. I hope I will manage to decipher the game's logic behind selecting the proper "version" of building when placed in editor, primarily I need this for editor to be able to draw buildings correctly without telling it explixitly "for this side use this version for building". But knowing how that exactly works, will move us ahead in the modding possibilities as well.

1 hour ago, firefly101 said:

Well I would like to know how to make the Windtraps like Dune2. I tried in Tibed to adjust the height and that didn't work, I also tried the unknown settings same thing it didn't work. I can't find the exact change needed to make a 2x2 square without some sort of issue. The setting to 64x64 pushes the windtrap up and removing the 3 from unknown 81 makes a 2x2 square but the when placing the windtrap it still shows the third row as used on the ground but you can place another building in that spot. I would prefer to have a clean 2x2 placement just like the normal 2x3 placement.

Well, you need to do one more change in addition what you did: change Unknown 90 from 32 to 0 and you should get done.

Posted (edited)

@Klofkac My power will be out for a while due to major storm damage in my area, so I may be a bit inactive, but I got the ping and I'll post some junk I know about the unknown bytes in TibEd here. All IIRC:
 - Bytes 10 and 11 have something to do with buildup animation.

 - 138 and 139 have something to do with animations, like the glow of a Wind Trap or the spinning of an Outpost dish. There's another byte that controls if it's always there or only there if the building is performing an action, like how Research Centres always glow and Heavy Factories only glow if they're building a unit. I think that byte is 90 - byte 32 is passive animation, +128 (160) makes the animation play only when the structure is doing something.

 - Byte88 is a bitmask of some sort. For those unfamiliar, it means the bytes form some kind of formation of 1s and 0s and the 1s determine what settings are switched on in the bitmask. For instance, 80 in binary is 10100000, so 64 says there's an animation and 16 says the animation always plays. 80 is 16 and 64 combined. There might also be some other animation-related behavior in Byte90...

 - Byte5 is armor. It refers to the index of armor under armor types. For instance, if Byte5 is 2, 2=BUILDING in the armor index, so it would give the structure "BUILDING" armor.

 - Long48 is upgrade speed. To get the time in in-game seconds, take 922 divided by the value in Long48. For example, if the Barracks has a Long48 of 54, that would be just over 17 seconds in in-game time to fully upgrade the Barracks, or ~427 tics.

 - Bytes 80 and 81 have to do with the space a structure needs, while 84 and 85 have to do with the actual space the structure takes up. I'll give an example involving the Heavy Factory:
114
119
114
7

Are the values for Heavy Factories. In binary, the game reads them like this:
0 1 0 0
1 1 1 0
1 1 1 0
1 1 1 0

0 1 0 0
1 1 1 0
1 1 1 0
0 0 0 0

The first formation is how much space the structure requires. The second formation is how much it obstructs, and also where the concrete beneath the structure will apply protection from the environment. So if you want to make the tile just in front of the factory walkable and remove its concrete requirement, you would change byte 85 to 6 and get this:

0 1 0 0
1 1 1 0
0 1 1 0
0 0 0 0

See how that works? :P

 - Bytes 96, 97, 98, and 99 are related to where the unit spawns in a structure and where it goes after it's spawned. If they bytes for a Barracks are 1,1 and 1,2, the infantry will spawn here:

0 0 0 0
0 1 0 0
0 0 0 0
0 0 0 0

And will walk here:
0 0 0 0
0 0 0 0
0 1 0 0
0 0 0 0

 - Byte92 is a value that has something to do with the kind of structure it is. A Barracks doesn't just train infantry because its behavior is a Barracks. Its Byte92 is related somehow.

 - Byte89 is another bitmask controlling some other behavior. 1 controls if the structure takes environmental damage, 2 controls a bunch of other stuff like selection, sabotage capability, and repairs, 4 controls if the structure can be captured, and presumably some other stuff too.

That's all I remember off the top of my head. Hopefully correctly! This was all through experimentation, no digging through the files, so I hope my own findings are, uhh... I hope they sync up with your findings too, or whatever. :)

Edit: Oh, you asked about the walls specifically. Yeah, that involved turning walls' Byte89's bit 2 on. It also took a bit of graphical work to get the selection boxes perfectly aligned on every frame.

Edited by Fey
Posted
10 hours ago, Klofkac said:

Well, you need to do one more change in addition what you did: change Unknown 90 from 32 to 0 and you should get done.

Thank you, I tried that and it worked. I knew it was possible as I seen a video somewhere where it was done. But I wasn't sure on the work around. I know editing the 64x96 to 64x64 does nothing but raise the image up out of its footprint. But the Unknown bytes were the key I just looked at the Fremen Barracks and noticed 51x51 but 81 had 0 instead of 3 like the windmill. I changed to 0 and then seen the 2x2 footprint, but the graphic for the 3rd row was still popping up. Changing byte 90 to 8 or 0 worked. Thanks a bunch.

I'm still trying to work out how to move the menu box in the UI so I can make a 1024x768 image for the main screen.

Posted (edited)

I'm continuing my investigation of building template data, and I discovered the meaning of almost all the bytes there!

On 8/6/2020 at 5:22 PM, Fey said:

I'll post some junk I know about the unknown bytes in TibEd here. All IIRC:

Thanks, althrough most of things you posted there I already discovered on my own, I did not know some of these and that indeed helped me.

So here goes the meaning of building template bytes:

D   0 Strength (hit points)
B   4 Owner side (side bitfield)
B   5 Armor type
B   6 Turret turning speed (0 = fastest, the higher value the slower)
B   7 Turret rate of fire (the higher value the slower frequency of shooting)
B   8 ?? (Crewed field in TibEd, but does not affect whether infantry leaves building after destroying/selling)
B   9 ?? (only zeros)
B  10 ?? (only zeros)
B  11 ?? (only zeros)
B  12 Primary weapon (weapon type)
B  13 Secondary weapon (weapon type)
B  14 Sight radius (Armor field in TibEd, which is wrong!)
B  15 Act like a turret? When set to 0, turrent won't shoot (1 on turrets, 0 on everything else)
B  16 Tech level required for build
B  17 Tech level required for 1st upgrade
B  18 Tech level required for 2nd upgrade
B  19 Tech level required for 3rd upgrade
D  20 Building art index
D  24 Barrel art Index
D  28 Build cost
D  32 1st Upgrade cost
D  36 2nd Upgrade cost
D  40 3rd Upgrade cost
D  44 Build speed
D  48 1st Upgrade speed
D  52 2nd Upgrade speed
D  56 3rd Upgrade speed
D  60 Power consumption/production
D  64 Prerequesite building 1 (building type index)
B  68 Prerequesite building 1 owner side needed (side bitfield)
B  69 Prerequesite building 1 number of upgrades needed (0 to 3)
B  70 ?? (only zeros, probably byte padding)
B  71 ?? (only zeros, probably byte padding)
D  72 Prerequesite building 2 (building type index)
B  76 Prerequesite building 2 owner side needed (side bitfield)
B  77 Prerequesite building 2 number of upgrades needed (0 to 3)
B  78 Turret requires enough power to work (0 = no, 1 = yes)
B  79 Destruction explosion (explosion index)
D  80 Tiles occupied by building - all tiles (tile bitfield)
D  84 Tiles occupied by building - solid tiles (tile bitfield)
B  88 Flags (1 = auto repair just when built, 2 = play buildup animation upon starting map, 4 = sell upon starting map, 8 = disappear upon starting map or after build, 16 = play animation always, 32 = play animation once, 64 = has animation, 128 = show "1" sign (like primary building))
B  89 Flags (1 = ??, 2 = building is selectable, repairable, can be sabotaged, will be set on fire when damaged and will release infantry when destroyed , 4 = can be captured, 128 = decays even on concrete)
B  90 Flags (1 = building will still occupy space even after destroyed/sold, 16 = invisible, 32 = draw building skirt, 64 = do not decay without concrete + do not create concrete (used on Sietch), 128 = transparent animation graphics (used on light, heavy and hi-tech factory))
B  91 Flags (1 = cannot be sold)
B  92 Special behavior (1 = Radar, 2 = Construction yard, 4 = Refinery, 5 = Silo, 6 = Repair Pad, 7-12 = production, 13 = Starport, 14 = Wall (links, no select cursor), 15 = Concrete, 16 = Turret (links), 17-19 = production)
B  93 ?? (various values, probably some order? editing did not have any visible effect)
B  94 ?? (only zeros)
B  95 Health bar and selection size (0=16px, 1=24px, 2=32px, 3=64px, 4=96px, 5=32px). Sight field in TibEd, which is wrong!
B  96 Building exit point 1 X coordinate (MEDIUM GUN TURRET, LARGE GUN TURRET has strange value 248)
B  97 Building exit point 1 Y coordinate
B  98 Building exit point 2 X coordinate (HARKONNEN PALACE has strange value 60)
B  99 Building exit point 2 Y coordinate (HARKONNEN PALACE has strange value 247)
B 100-131 Direction frame mapping
B 132 ?? (only zeros)
B 133 Animation speed (1 = fastest, the higher value the slower animation, 0 = crash)
B 134 Art width (pixels)
B 135 Art height (pixels)
B 136 Building type index
B 137 Number of buildup animation frames after which the final building is drawn (the number is about in the middle of animation)
B 138 Buildup animation index
B 139 Animation index
B 140 Firing flash graphics (explosion index)

There are some new great discoveries that make some new modding possibilities:

- A building can actually be upgraded 3 times (a la Dune 2 heavy factory). This was never used in Dune 2000, but could be useful for mods.

- Some new potentially useful building properties found under the Flags bytes (88, 89, 90, 91): Building cannot be sold, Building decays even on concrete (similar to Dune 2 behavior), Auto-repair when building is built without concrete. Those all Flags look to be similar to Tile Attributes in the manner that there are some properties that the game uses internally during gameplay and are not meant to be initially set in Templates.bin. For example when you click on a building to sell it, the game sets flag Byte88 = 4, and the building plays buildup animation in reverse and then disappears.

There still remains one big mystery: How the game determines how many infantry are released from a building when building is sold? For example Construction Yard releases 4 infantry, Wind Trap releases 1 infantry, Silo releases no infantry, most other buildings release randomly 2 to 4 infantry etc. This did not change when I edited every possible value in Templates.bin, so this information must be stored elsewhere, or hardcoded in game executable. Also, editing Crewed filed dod not even affect whether infantry was released or not.

I also did a research of BUILEXP.BIN file and found what is its purpose: When you shoot building and its health gets under half (and its graphics changes to damaged look), the building will be set on fire, and fire and smoke animations will play over the building (and fade out after some time). And BUILEXP.BIN defines the number of fire/smoke animations and their position on the building. For example modified outposts do not have any animations defined, I never noticed that until today! Here is the file structure, it contains 100 entries, 33 bytes each (total file size is 3300 bytes):

B    00 Number of animations (0 to 8)
B 01-08 Animation X-offset
B 09-16 Animation Y-offset
B 17-24 Animation graphics (explosion index, 11 = smoke, 39 = fire)
B 25-32 Maximum number of animation frames that can play until animation loops

Then I took a look at TECHPOS.BIN. This file is a big mystery: I tried to edit it (rewrite with all zeros), but nothing visibly changed in game! But after renaming this file, the game ended with error, so it definitely reads it. The file has 500 bytes, presumably 100 entries, 5 bytes each.

And lastly, the two unknown sections in Templates.bin, one with 86 bytes and second with 256 bytes. The latter one (256 bytes long) is 64 entries per 4 bytes, and it has something to do with Explosions/Animation art. This looks to be Flags, which determine whether animation is transparent or not, etc. The 86 bytes one seem to consist of two sections, in the second half there are explosion indexes, which have something to do with unit behaviors (i.e. there are listed indexes of EX_HARVDUST0 to EX_HARVDUST7 in a row). Editing those values will change animations units are doing (i.e. Harvester harvesting spice and loading into refinery). Zeroing the first half caused various game crashes.

@lovalmidas how is your research of Templates.bin and development of Spice2k going? I can see there has not been any new activity recently, so are you taking a (hopefully) temporary break? Like you are busy with other stuff but are still going to continue? You are probably going to develop a new graphics editor and Templates.bin editor (replacement of TibEd), which would be great. I hope my discoveries can help you go further.

Edited by Klofkac
  • Upvote 1
Posted (edited)
43 minutes ago, Klofkac said:

- A building can actually be upgraded 3 times (a la Dune 2 heavy factory). This was never used in Dune 2000, but could be useful for mods.

I keep seeing remainings from Dune 2; even on the "WOR" entrance it can be read on the text.uib, and now the multiple upgrades?

I guess they meant to be that way but later the used the Ixian Centre as a second upgrade (as you need to upgrade the fact + a non-factory just to have access to the missile tanks).

43 minutes ago, Klofkac said:

- Some new potentially useful building properties found under the Flags bytes (88, 89, 90, 91): Building cannot be sold, Building decays even on concrete (similar to Dune 2 behavior)

Wow, now you find a value that makes buildings to produce slower if low on health and you suddenly have "killed" all those guys that rush buildings without a single concrete XD.

43 minutes ago, Klofkac said:

There still remains one big mystery: How the game determines how many infantry are released from a building when building is sold? For example Construction Yard releases 4 infantry, Wind Trap releases 1 infantry, Silo releases no infantry, most other buildings release randomly 2 to 4 infantry etc. This did not change when I edited every possible value in Templates.bin, so this information must be stored elsewhere, or hardcoded in game executable. Also, editing Crewed filed dod not even affect whether infantry was released or not.

I think this is tied with the health of the units; once I placed the Fremen unit into the building slot and they were spawning less amount of fremens that usually spawn from infantry.
Maybe health building / health unit = number of units?

It could be other value, but at least I know for sure that fremen spawned less amount that light infantry. <-- which it could be also tied to the size of the building (turrets spawning 1 max).

Edited by Cm_blast
Posted
6 hours ago, Cm_blast said:

I think this is tied with the health of the units; once I placed the Fremen unit into the building slot and they were spawning less amount of fremens that usually spawn from infantry.

It's got something to do with the cost. A Sietch spawned infantry when I made it selectable and sold it, but reducing the cost of the Sietch made infantry never spawn.

Not sure how it works with the turrets sometimes spawning one and sometimes not, but, I know the cost being reduced stopped it on the Sietch. So.

Posted
6 hours ago, Cm_blast said:

once I placed the Fremen unit into the building slot

So you mean buildings were releasing Fremen instead of Light infantry? How you achieved that?

6 hours ago, Cm_blast said:

I think this is tied with the health of the units

 

47 minutes ago, Fey said:

It's got something to do with the cost.

Thanks for your tips, I did not think this way. This can be confirmed.

Posted (edited)
7 hours ago, Fey said:

It's got something to do with the cost. A Sietch spawned infantry when I made it selectable and sold it, but reducing the cost of the Sietch made infantry never spawn.

Could be. when I did the stuff I probably made the Fremen to cost 100 or 120 credits at the time I did the test.

7 hours ago, Fey said:

Not sure how it works with the turrets sometimes spawning one and sometimes not, but, I know the cost being reduced stopped it on the Sietch. So.

Probably with a random value, same with the time attack, group attack and other stuff that randomized things that happen in game.

6 hours ago, Klofkac said:

So you mean buildings were releasing Fremen instead of Light infantry? How you achieved that?

With Tibed I simply copy-paste the Fremen values into the light infantry spot (and viceversa). I was trying to make Atreides and Fremen to use a different "basic" unit, making light infantry to spawn from the Atreides buildings while Fremen for Fremen buildings. 

I should have try with other sides because maybe the game picks the unit in index = 1 to be used from buildings and didn't matter being the owner or not of certain units. 

There is something on the Ai behaviour; if you remove the 2x2 concrete from the queue, we will start using the 3x3 version in the same matter; I mean that if he is to build a 3x3 buildings, he will build 4 3x3 pieces before deploying the refinery. And if you remove the concrete completely from the queue the AI will start deploying 4 windtraps (or getting stuck trying to fit as many windtraps in a small piece).


What about infantry spawning from vehicles? I would like to have that random infantry from a tank after being destroyed, just like dune 2.

Ps: by the way klof; if you don't mind to find exactly how the AI calculate the Guard Group Size value.
We know it has to do with the size of the base: an AI with 500 GGS having a base that it is 4 windtraps taking a 10x10 area it's going to have few units wandering around, while the same AI with the same GGS but with 4 windtraps scatered in opposite corners will have an insane amount of units wandering around.

I know that defense areas work with the health (one of the values control that) so it's easy to know exactly the amount of units required to fill the defense-area before-hand (that's it, withouth even testing it), but with the GGS it's always a try and error; Is still has to do with the health as usually Harkonnen can fill the defense early due the combat tanks difference.

When I did the dune 2 to be sure that the initial unit spawn filled the GGS value I remember placing the units (2 of each units: 2 infantry, 2 trooper...); and then writting a GGS of 500; pressing testing and building a light infantry for the Ai, if the AI infantry starting moving to "defend" the base, I had to reduce the GGS, if the unit were standing still (prepare to attack), I increase the GGS and see if keeps happening

That interval between "X" and "X+50" were "X" the unit won't wander around and on "X+50" the unit will wander, then "X" was the value desired, but as you see, this required to me at least executing the game a certain amount of times; so finding a formula that they used to apply the GGS would be something really good. At least it don't has randomness.

Edited by Cm_blast
Posted
1 hour ago, Cm_blast said:

Ps: by the way klof; if you don't mind to find exactly how the AI calculate the Guard Group Size value.

Sorry, but currently I'm 100% busy with Templates.bin investigation, for the purpose of being able to read this file in D2kEditor and draw all buildings and units in exactly same way as how they would appear in game. Practically I want to mimic the internal game logic. Examination of units template is next step I'm going for, but I hope it will be a bit simpler due to unit template being partially already discovered by @lovalmidas. I am also thinking about implementing Templates.bin editor (built-in into D2kEditor, just like tile attribute editor), but I'm still waiting for lovalmidas for his answer if he is still planning to continue on his project and make such editor himself.

That said, I don't currently feel like investigating AI-related things, so I'd like to leave this to someone else.

Posted
On 8/10/2020 at 2:37 PM, Klofkac said:

I also did a research of BUILEXP.BIN file

oh lol I really should read more thoroughly, I knew what this did already 😅 I had to mess with this for the Storm Lasher's on-fire graphics.
index.png.f051586f9de57de790ebf279e2959a57.png

sry Klof XD

btw @firefly101 in case you haven't seen it yet, auto-repairs can be enabled by adding 1 to byte 88's bitmask. I know you were wondering about this, and I just tested it on fortifications and power structures. they begin repairs immediately when placed, but must be manually repaired again once they hit max HP, as they'll decay over time and repairs are disabled when they can't happen. still pretty useful when Wind Traps, ConYards, and walls/turrets auto-repair as soon as they're placed, if possible.

anyway, @Klofkac you said something about byte 91. evidently I gotta look for this in the hex, but where is the related section of the hex? sorry lol I don't read hex v well but if ya tell me where exactly the building data is I can have a look. the sound stuff was easy enough to figure out after loval pointed me in the right direction.

also, the "turret" special behavior not only links walls to the structure, but makes units automatically attack the structure when nearby!

side note, if certain units can't attack structures normally, like if you give Engineers a pistol, they try to capture structures anyway so they can't attack them with their weapon. this causes a weird behavior where you get the attack cursor over a turret, but the Engineer won't respond because turrets can't be captured, even though they're holding a weapon. but if you run the Engineer next to the turret, sure, the Engineer will die a horrible death, but he can at least automatically fire upon the structure because of the structure's special behavior.
https://i.imgur.com/H8gm8Ie.mp4

I gave pistols to the Engineers btw lmao

Posted

My research of unit template data seems to be done. This time I did not need to discover that much new things, because TibEd already covered almost all the values, and the meaning of bytes was already present in @lovalmidas's Spice2k source code.

Nevertheles, I still made a few extra discoveries. Here is the complete meaning of bytes.

(Small note: in my previous post about buildings data I hid the list under a Spoiler, which needs to be clicked to be visible. Maybe someone of you could miss that as it was easy to overlook. This time I won't hide it in Spoiler so it's easily visible.)

B   0 Owner side (side bitfield)
B   1 Unit type index
B   2 Armor type
B   3 Unit rotation speed (0 = fastest, the higher value the slower, ROT field in TibEd)
D   4 Strength
B   8 ?? (only zeros)
W   9 Speed
B  11 ?? (only zeros, changing to nonzero value makes unit unable to move and game will crash)
B  12 Primary weapon (weapon type)
B  13 Secondary weapon (weapon type)
B  14 Rate of fire (the higher value the slower frequency of shooting)
B  15 Barrel rotation speed (0 = fastest, the higher value the slower)
B  16 Sight radius
B  17 Is infantry (0 = no, 1 = yes, MoveInfantryZide in TibEd)
B  18 ?? (only zeros, probably byte padding)
B  19 ?? (only zeros, probably byte padding)
D  20 Building art index
D  24 Barrel art Index
D  28 Cost
D  32 Build speed
B  36 Tech level
B  37 Available in Starport (0 = no, 1 = yes)
B  38 Has barrel (0 = no, 1 = yes, if 0 barrel is still drawn but cannot turn and ignores shooting direction)
B  39 Prerequesite building 1 number of upgrades needed (0 to 3)
D  40 Prerequesite building 1 (building type index)
B  44 Prerequesite building 1 owner side needed (side bitfield)
B  45 Special behavior (1 = harvester, 2 = carryall, 3 = engineer, 4 = saboteur, 5 = sandworm, 6 = MCV, 7 = devastator (self-destruct), 8 = frigate, 9 = ornithopter, 10 = DH missile, 11 = sardaukar (damages when killed), 12 = fremen, 13 = unused?, 14 = thumper, 15 = ?? (crash))
B  46 ?? (1 on infantry, 0 on others, editing did not have any visible effect)
B  47 Death animation (explosion index)
D  48 Prerequesite building 2 (building type index)
B  52 ?? (various values 0 or 1, editing did not have any visible effect)
B  53 Can crush infantry (0 = no, 1 = yes)
B  54 Health bar and selection size (0=16px, 1=24px, 2=32px, 3=64px, 4=96px, 5=32px).
B  55 ?? (various values, editing did not have any visible effect)
B  56 Flags (16 = stealth unit, 64 = unit is not selectable and not hittable, 128 = attack mode if side has AI (all other units from same group will go attack as well))
B  57 Flags (1 = unit is not selectable and not hittable, 8 = AI does not assign any group (even 1), unit is not even in guarding mode, 16 = unit is deviated?, 128 = barrel has fixed direction with unit direction (used on Siege Tank))
B  58 Flags (2 = behave like DH missile, 4 = AI always assigns group 1 to this unit (only guarding, not moving around), 32 = unit is invisible (only visually), 64 = unit is selectable only with multiselect, not movable (like sandworm?), 128 = self healing)
B  59 Flags (8 = unit is invulnerable, 16 = crash when destroyed)
B  60-91 Direction frame mapping (32 values)
D  92-163 Unit reporting/confirmed sounds (18 values)
D 164 ?? (InfFiringAnim in TibEd, but editing does not seem to have any effect)
B 168 Firing flash graphics (explosion index)
B 169 Speed type
B 170 Multiplayer only (0 = no, 1 = yes)

Some notes about the discoveries:

- Bytes 56, 57, 58, 59 are flags (similar to flags in building template or tile attributes). Again, also here the game uses the flags also for some internal in-game logic, and setting some values can have strange effects or even crash the game. It looks like some of these flags are related to AI.

- The most interesting and useful value seems to be Byte 56 = 16 (Stealth unit). This way you could make any unit stealth. I wonder why Westwood did not use this on Stealth Raider.

- I was a bit disappointed that there seems to be no way to require 2nd prerequisite building to be upgraded. At least 1st prerequisite building can require 1, 2 or 3 upgrades.

On 8/12/2020 at 6:41 PM, Fey said:

anyway, @Klofkac you said something about byte 91. evidently I gotta look for this in the hex, but where is the related section of the hex? sorry lol I don't read hex v well but if ya tell me where exactly the building data is I can have a look. the sound stuff was easy enough to figure out after loval pointed me in the right direction.

You need to be able to compute byte positions in hex. For units it is very easy, because unit templates are located in the very beginning of file. Let's say you want to edit byte 91 of unit with number 11 (ORDOS COMBAT TANK). And unit template has size of 256 bytes. Then the position is (11 * 256) + 91, meaning (entry number * entry size in bytes) + byte number. As (11 * 256) + 91 = 2907, so you need to edit 2907th byte.

However, hex editors usually display position in hex instead of decimal, so it is better to do the math in hex. 11 = B, 256 = 100, 91 = 5B. So your math is: (B * 100) + 5B = B00 + 5B = B5B (which us 2907 in decimal).

And as previously, I will also attach all extracted byte values of unit definitions.units.txt

Posted (edited)

I tied to manually edit Tibeds template.ini in the game and added Byte56=16 to fremen and they were not stealth. I guess the ini file can't be used to modify the template.bin? I checked and the Byte56=16 was

[FREMEN]
ULong=1
ULong2=2
Byte0=1
Byte15=0
Byte46=1
Byte52=0
Byte54=0
Byte55=2
Byte56=16
UnitBehaviour=FREMEN

But fremen still came out normal instead of stealth? I don't use the fremen attribute as I prefer to have the Fremen Queued like the regular units for my mod. Tibed doesn't have an option to enter data for Byte56 so I added it manually using Tibed.

Edited by firefly101
Posted (edited)
5 hours ago, Klofkac said:

compute byte positions

Ah, I got it now. Thanks, Klof! It works perfectly.

Now I can make the Engineer available after a second Rax upgrade. Sucks having the unit on the sidebar when I want the Rax for combat units mostly. Among other things...

Edit: It seems a structure that can't be sold can't be captured or sabotaged either. Weird. Maybe this byte is set when a structure is being infiltrated? That must be it.

2 hours ago, firefly101 said:

I added it manually using Tibed.

Yeah, you'll need to go into templates.bin with a hex editor. To make a long explanation short, install this:
https://mh-nexus.de/en/hxd/

Load Templates.bin, then change THIS byte:
https://prnt.sc/tzvykr

To... uhh... 10, I guess, since it's in Hex.

Edit: Yeah, 10. That works, just tested it. By the way, my numbers will be a bit different since I've already fucked with the hex, but take note of the row / column numbers and you'll find the right spot.

Edited by Fey
Posted (edited)

Hello Fey,  Sorry for the Tardy reply.

 

On this hex change, will just give stealth to the unit in question or will it give the Fremen stealth which has the Timer junk? I figure the Stealth works on the AI so they cannot see my units till they attack? I hate the stealth look and wished it could be removed but still keep the stealth feature.

BTW Tibed wont override a changed Bin will it? I mean the hex changes stay even when we still use Tibed after it?

Also what other Hex changes have you made?

I get a SetImagetoResource error when I EDITED that value to 10.

Edited by firefly101
Posted

No prob.

8 hours ago, firefly101 said:

On this hex change, will just give stealth to the unit in question or will it give the Fremen stealth which has the Timer junk? I figure the Stealth works on the AI so they cannot see my units till they attack? I hate the stealth look and wished it could be removed but still keep the stealth feature.

Yep, it'll give all of a certain unit type stealth. I imagine this flag exists in case a crate is picked up with stealth in it.

8 hours ago, firefly101 said:

BTW Tibed wont override a changed Bin will it? I mean the hex changes stay even when we still use Tibed after it?

No, but don't use both at the same time. If you have TibEd open and the hex as well, saving the hex won't magically transfer your changes to TibEd. I like to restart, then re-import changes to be totally safe. You can keep TibEd open for reference about things you want to change though!

8 hours ago, firefly101 said:

Also what other Hex changes have you made?

I gave Barracks, Heavy Factories, and High Tech Factories two upgrades. The Engineer needs a second Barracks upgrade to be trained. Sonic Tanks, Devastators, Deviators, and Autogun Tanks require a second Heavy Factory upgrade to be built. And, the Palace requires a second HTF upgrade to be unlocked. I also assigned new sounds to all units (more details here: https://forum.dune2k.com/topic/28668-regarding-unit-dialogue-modding/?do=findComment&comment=399758). There's some other junk, but I don't really remember. :P

8 hours ago, firefly101 said:

I get a SetImagetoResource error when I EDITED that value to 10.

Sounds like you added bytes accidentally. The zeroes there NEED to be changed, you can't add anything! Since you say EDITED I'll assume that's what you did, but I have to say that just in case. Uhh... the reason I say that is it sounds like the game is missing data images, and as we know the images seem to be hard-stuck exactly where they are. If anything is budged instead of replaced, it seems to cause issues. Other than that, I'm not sure what could have caused the issue. I absolutely tested exactly that byte, where the Sardaukar are in my mod, and it gave stealth to the Sardaukar.

The only other thing I could guess would be, are you sure you changed the right byte? :P

Posted (edited)

Ok, I gave another shot and I didn;t get a changed error but now when I recruit Fremen, they look the same, no stealth on them. Row1630 column 9 which is 08, is what I edited. changed 00 to 10 and got no stealth. Last time I must have hit something that added like you said. I also reloaded the templates.bin in the hex editor and it showed the changed byte to 10 but no change to the unit, unless the stealth look isn't visible on them?

I also noticed something interesting with the map editor, when I use the INI feature to set fremen to 4 I still only get 2 the ini doesnt seem to work for campaign maps at least for me they don't I must be missing a step on it?

Here is my Bin file so you can see what I edited.

Templates.bin

Edited by firefly101

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.