Jump to content

Mission File Discussion


mvi

Recommended Posts

  • 2 weeks later...

I'm hopefully going to finish off my mission file editor and write up my research formally as a PDF and release that. Got a big new project at the company I work at starting in a few weeks which will be high intensity so I doubt I'll have time to carry on with this

Link to comment
Share on other sites

I would love to devote more time to Dune 2000 but it's a question of finding the time (and quite often the motivation, when you're working at a computer all day long quite often the last thing you want to do when you clock off is more work on a computer as I'm sure a lot of you have felt.)

Just some brief mentions on the mission file format.

It is very important to regard what I formerly called "triggers" as conditions. They are most definately not triggers. As far as I can see there are various event types, such as a reinforcement, mission success, enemy unit spawn, message on screen etc. Each event then has some data specified about it, in the case of a reinforcement this will be where, what units, what house etc.. and in the case of a message this will be what message index to use. Now, each event also has two tables, one is a table of condition indexes which apply to it, the second is a table which flips the condition's necessary value when the second table index is true. Meaning you could link say a reinforcement event to a built Ix condition, or a fail mission event to a condition for the existence of a construction yard with the relevant second table byte representing a flip - so that the fail mission event would activate when the condition of the existence is not true.

As previously mentioned, there is the capability for 64 events (each 72 bytes long) and 48 conditions (each 28 bytes long.)

As also previously mentioned, the mission file contains a big AI section, which is split into 8 sections. Besides the first byte of each section, I have no idea how this AI data works, though it looks like it might be executable code which is loaded directly into memory.

The 14th byte of each event is the event code.

The 26th byte (that's two from the end) of each condition is the condition code.

There are various condition codes, such as whether a building exists, and even some basic logic I believe (equivalent of an IF and an AND)

It is also worth noting that the condition code and event code sets are different between campaign missions and multiplayer missions. The research I am doing does not touch the multiplayer mission files at all, and I don't intend to even glance at those files until the campaign missions are nailed 100%. That's assuming I'm still doing this stuff by that point of course.

The mission file structure I'm currently using in my tools looks like the following C# code:


        public byte[] houseTechLevel = new byte[8];
        public Int32[] startingMoney = new Int32[8];
        public byte[] unknownRegion1 = new byte[40];
        public byte[] houseIndexAllocation = new byte[8];
        public byte[,] ai = new byte[8,7608];
        public byte[,] diplomacy = new byte[8,8];
        public byte[,] events = new byte[64,72];
        public byte[,] conditions = new byte[48,28];
        public byte[] tilesetImageName = new byte[200];
        public byte[] tilesetDataName = new byte[200];
        public byte unknownRegion2;
        public byte unknownRegion3;
        public Int32 timeLimit;
        public byte[] unknownRegion4 = new byte[692];

Any questions on mission files please just ask.

Link to comment
Share on other sites

Made some progress with event and condition types. Also made a quick tool to convert a mission's event and condition tables to Microsoft Excel so that I could see what's going on and mess about with the format. Actually starting to get a picture of how a mission's logic works now. For example, in the O1V1 mission, I can plainly see in Excel that the second message event is dependent on two conditions. A timer, then a building exists check with the return value flipped. Meaning that the event gets carried out when the timer is true and the building does not exist.

I can then look two lines below at the fourth message in that mission, and see it is dependent on four conditions. The first again being the same timer, then three building exists checks, with the third of these being a flipped condition. This means that the event gets carried out when the timer is the right value, the first two buildings exist and the third building does not exist. This is as it should be, as in game this message is shown when you have a wind trap, refinery but not a silo.

Still got some event and condition types I'm unsure about, but now have all but two condition codes understood and half the events.

Link to comment
Share on other sites

Figured out a lot more now, also looking at the special indexes for maps, it might be there's some features still supported in code that didn't make it into the game that we can use.

Also, there seems to be something to do with flags in the maps.

Looks like the original level dev's may have been limited to 48 events and 36 conditions, before it was decided to up these limits to 64 and 48 respectively. So the levels like O9V1 have only 48 events and 36 conditions. This hopefully should mean modders can create more detailed levels than the original devs.

Link to comment
Share on other sites

question is. maps.  we should have bigger. is there possiblity to override map size limit from 128x128 to higher?? in Reed Alert 2 there is override  so u can have  225x225 instead of 164x164.  and minimal is 50x50 for  dune 32x32.

and one more thing buldings/units limitings. i have made an map with plenty of structures but cannot use it because limit for example atreides  units/structures  is  already used and i cannt start the game with  huge fortess map..

houses again..  there is no sandworm house.  the  color between smuggler and mercenary is choam.

Link to comment
Share on other sites

question is. maps.  we should have bigger. is there possiblity to override map size limit from 128x128 to higher?? in Reed Alert 2 there is override  so u can have   225x225 instead of 164x164.  and minimal is 50x50 for  dune 32x32.

and one more thing buldings/units limitings. i have made an map with plenty of structures but cannot use it because limit for example atreides  units/structures  is  already used and i cannt start the game with  huge fortess map..

houses again..  there is no sandworm house.  the  color between smuggler and mercenary is choam.

What's that got to do with mission files? Those limitations are built in to the dat file.

Link to comment
Share on other sites

Ah, hello there. Thought I'd drop an example of the events and condition table from Ordos Mission 1 Version 1 (O1V1.mis)

The events have their conditional dependencies next to them.

C style programming logical notation is used where && represents the AND logical operation, and the ! represents flipped the true-false value.

So for example, taking the first event:

If condition 3 is true and condition 17 is not true and condition 18 is not true, then this logical expression evaluates to true and the event is carried out. Whereby condition 3 is you having 2500 cash, unsure what the other two conditions are.

Note, I've cut out a lot of the data to show what it does rather than all the specifics. And I may have made some mistakes either in my interpretation or writing it up from my paper notes. But you should be able to see how the mission events, conditions and logic works.

Events

0 - Mission Win - 3 && !17 && !18

1 - Unknown - 3 && !17 && !18

2 - Mission Loss - !9 && !10 && !17 && !18

3 - Unknown - !9 && !10 && !17 && !18

4 - Reinforcement - Ordos Harvester Replacement - !16 && !13 && 14 && 15

5 - Unknown - !16 && !13 && 14 && 15

6 - Unknown - 13 && !15

7 - Message - Build Concrete Slab - 6

8 - Message - Build Windtrap - 7 && !8

9 - Message - Build Refinery - 7 && 8 && !9

10 - Message - Build Silo - 7 && 8 && 9 && !11

11 - Reinforcement - Ordos - 0

12 - Reinforcement - Harkonnen - 1

13 - Reinforcement - Harkonnen - 2

Conditions

0 - Interval

1 - Interval

2 - Interval

3 - Cash Equals 2500

4 - Ordos Base Destroyed (Unused)

5 - Ordos Units Destroyed (Unused)

6 - Timer (Unused)

7 - Timer

8 - Ordos Windtrap Exists

9 - Ordos Refinery Exists

10 - Ordos Construction Yard Exists

11 - Ordos Silo Exists

12 - Ordos Windtrap Exists (Identical to 8 and Unused)

13 - Ordos Harvester Exists

14 - Timer

15 - Unknown

16 - Ordos Base Destroyed (Identical to Condition 4 but Used)

17 - Unknown

18 - Unknown

Link to comment
Share on other sites

  • 3 weeks later...

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...