Jump to content

Recommended Posts

Posted

Hey all.

I'm trying to understand the workings of D2 better, but I have not found any documentation regarding this, and a search on this forum did not help either. Maybe you could help me out though.

First let me ask this question: How does D2 calculate what tiles are sand hills? They do not appear in the seed-textfiles. Is it entirely random or does it need to be calculated? And if it needs to be calculated, what would be a good way to do that?

Now, on to understanding the scenario-textfiles better.

-- Basic section --

"timeout". As far as I can recall, I have never played a D2 level with a time out (as in: limited time to accomplish level). Does it indeed have such a meaning, or does it have a different meaning?

"cursor pos". That has to do with what area the user will get to see when the level is loaded for the first time, right?

"tactical-pos". What is this?

"Lose-flags". "Win-flags". Also no idea what these are.

-- Map section  --

"Field". No idea what this is.

-- CHOAM --

Does this specify how many units you can purchase from Starport? Or is this what units will be dropped for no costs by a caryall during play? And if so, how is it timed?

-- Teams  --

How is this information used in the game? Obviously, they represent what teams will be created by the enemy (AI), but how are they timed, and what do they exactly consist out of? Are the numbers in there used for the timing?

-- Units --

I understand what this is used for, but what do the numbers in these lines represent? Is the first health, the second position on th emap, and the third... err... ?

-- Structures --

With structures. Does GENx specify the location of concretes and walls with the 'x' in GENx?

And for the regular structures (IDx), is the first number health and the second location?

-- Reinforcements --

How is this used exactly? Please be specific if you can. (What the numbers mean, etc)

Thanks in advance.

  • 3 weeks later...
Posted

I think I understand like two more. It would be helpful if people could give some information to me on all this.

Cursor-pos was the position of the cursor when a level is loaded up.

Tactical-pos is where the radar is shown, I think... (so not necessarily with the cursor centered).

Both seem kind of redundant to me. First building listed (or first unit, if no buildings are listed) would be the best choice to center on.

Buildings I've got figured out.

Units on the other hand, I still don't know what the third number represents. There's health, position, and...?

Posted

You might want to drop Stefan an IM so he knows this thread is here. I think he's rather busy at the moment, but he might still have some old files or other information that might enlighten you.

  • 2 weeks later...
Posted

Ah yes, those where the days to figure that out. But it is not that hard at all.

Not all things in Dune 2 scenarios really have some influence. So i will stick to what i find important, and important for your game.

-- basic --

cursor pos -> afaik this is the location where to center the screen for th eplayer

tactical pos -> a location for the computer to focus on (AI)

-- map --

Field = cell,cell , etc. Fields are just that, fields of spice (areas) randomly generated created on those spots.

-- Choam --

You are correct.

-- Teams --

Afaik this is how the AI should create teams before attacking. I think mrFlible knows more about this.

-- units --

ID038=Ordos,Soldier,256,1246,64,Ambush

Basicly:

NUMBER=<house>,<unit type>, <health>, <cell>, <facing>, <action>

however:

<health> - I think it scales its health into units of 0 to 256 (full health). So 128 means 50% health

<facing> - like C&C, but i don't really think this is that important (just throw some random number in your game to make

it look fancy ;))

NUMBER - Don't bother , its for Dune 2's reference. If you mess up the numbers, dune 2 will crash. But obviously your game

will not.

-- Structures --

ID000=Atreides,Const Yard,256,1630

and...

GEN1589=Atreides,Concrete

NUMBER=<house>,<type>,<health>,<cell>

and...

GEN<cell>=<house>,<type>

for this , remove GEN and you get the cell. The House is used in Dune 2, though in my vision its stupid not to allow other players to build on other slabs. Type can be Concrete, Wall

-- Reinforcements --

6=Atreides,Launcher,Enemybase,21+

7=Fremen,Deviator,Homebase,13

Number=<team>, <type>, <location>, <time>

Where:

Number - is not important

Team - House

Type - Unit type to deliver

Location - Enemybase or Homebase -> THIS IS RELATIVE. Ie, for YOU the ENEMYBASE is delivering units at the AI. But for the AI its delivering to YOU.

Time - I meassure it in seconds, but this is not entirely correct. Perhaps you should do it X 1.3

I hope this helps you a bit further.

(and what a mess is my code now i have learned so much more in the 2 months i do developing as a job... ;))

Posted

I have not taken a look at D2 code yet (open source projects that is).

They are in C++, and I am only somewhat knowledged in C. Plus it is said that C is faster on the Nintendo DS.

I'll probably snatch some snippets eventually though. Like path searching (how to move unit from point A to B).

Anyway, thank you for your reply. This helps a bunch. :)

Making some good progress on the engine now.

  • 2 weeks later...
Posted

FYI: D2TM is now open source, so you're welcome to download the source. It is a bit messy (and its more getting into C++ , then C, but then again, you can easily transform the code), but you will understand how it works.

Posted

So I've noticed. Should prove to be very helpful. Might even use (a lot of :P) snippets. Thank you for mentioning it.

If I update/improve/adjust some pieces of code for my own project, do you wish a copy of those snippets?

Also, you said once that path finding was acting extremely weird (unnecessary detours). Is that problem still present in the current code, or has that been resolved?

I find it also somewhat weird how you marked tiles as "unpassable". Shouldn't mountains be considered as passable for foot-units, and unpassable for tracked-units?

I think I'll just check if something is unpassable on the go, so to speak.

edit:

I've been thinking on how to make Deviator work... adding a "converted" counter to units, possibly. I now see you've solved that problem by just making them converted, period. No time limit. Gameplay wise, does this not disturb the balance greatly? Let me know.

2nd edit:

I forgot to ask. How much data are you transfering for network gameplay per frame? I can only submit 4 kb of data per frame. :

And with networking, do you synchronize by halfing frame rate and giving the odd half to player1 actions and even half to player2 actions? Or are all taken actions by everyone sent to everyone each and every frame?

Posted

-- Teams --

Afaik this is how the AI should create teams before attacking. I think mrFlible knows more about this.

Yes, teams specify what units and in what quantities the AI should use in attack parties. The original code was screwed up though.

The teams syntax is as follows:

<team number>=<House>,<team type>,<unit type>,<min units>,<max units>

Team number is just its place on the list,

House is what CPU-controlled House produces units into a team,

Team type defines the team's behavior. Can be Normal, Kamikaze, Staging and Flee. Only the first two are used in the original game. Normal means a team can retreat and regroup (I guess), Kamikaze means all units will attack until destroyed. I haven't tested the other two, so I don't know for sure what these are.

Unit type means what units that are used in the team. It can be Foot, Wheeled, Tracked, Winged or Slither. Only the three first are actually used in the original scenarios, but Wheeled and Tracked were unfortunately misspelt as Wheel and Track, causing the AI not to build any attack teams of vehicles at all, thus lowering the difficulty level dramatically. I've created a fix for this, downloadable here. Winged is for 'thopters, and Slither for sandworms (both not used).

Min and max units are probably used for randomization purposes, to keep team size variable within limits.

Posted

About networking, D2TM does not do networking yet.

If you have additions to the code, that could be helpful for D2TM, you can ask to become a project member (mail me your gmail username) and you can submit code then.

For pathfinding; i have recieved work from someone who also has interest in the project, with a new pathfinder that will be efficient and a lot better then the current one. Which will replace the current one , one day. Keep your eyes at the SVN as you will notice minor updates , almost daily if i find the chance to code a bit. I try to keep it 'compilable and working' as much as i can.

Posted

First of all, thank you Mr Fibble for your clear explenation.

The improved scenario files should come in handy, although I'll have to adjust all of them to be suitable for my engine. (I want it to be really customizable, allowing people to alter graphics, add structures, add units, create totally different settings, etc.)

And Stefan, I'll certainly keep watching the SVN then. I do not know, however, how to submit (pieces of) new code as I've never worked with SVN or something similiar before. Maybe you could give me quick how-to.

Also, with SVN the _changes_ to the code and the author of those changes are stored, right? So there's no way I could really mess things up on which you're working on at the same time? ;)

I'll PM you my google email address.

About the networking. I just assumed you used some library, seeing as how you had a network.h and what-not. It's not high on my own priority list, so it doesn't really matter (but with a handheld like the DS it _would_ be extremely sweet).

Posted

A quick update. I actually checked how Staging and Flee teams work in the game, and here's what I came up with:

Staging:

This is the only defensive team type. The AI will amass units inside the base and position them so that the buildings and approaches to the base are guarded. The units in a Staging team will remain where they are for most of the time, and only attack hostile units in range.

Flee:

The Flee team type is designed as a quick strike force. Once produced, units immediately leave for the enemy base, and the entire team is being assembled on the move. Teams of this type can easily overwhelm the player because they generate an almost constant flow of units (killed units get replaced immediately).

And a final note on the Kamikaze type: units in this team will not only attack until destroyed, but also ignore enemy fire and focus on taking out priority targets (i.e. structures). All other team types return fire and switch their targets to those units (but, as it seems, not turrets) that attacked them.

Posted

You can now check these screenshots for comparison, taken from one Harkonnen mission.

This is how the AI base looks with the original team code:

[TEAMS]

1=Ordos,Normal,Foot,2,4

2=Ordos,Normal,Foot,3,5

3=Ordos,Normal,Wheel,3,5

4=Ordos,Normal,Foot,2,4

5=Ordos,Normal,Wheel,3,5

6=Ordos,Normal,Wheel,5,7

d2originaled2.png

And this is what happens if the code is a bit modified:

[TEAMS]

1=Ordos,Normal,Foot,2,4

2=Ordos,Normal,Foot,3,5

3=Ordos,Normal,Wheeled,3,5

4=Ordos,Normal,Foot,2,4

5=Ordos,Normal,Wheeled,3,5

6=Ordos,Normal,Wheeled,5,7

7=Ordos,Staging,Foot,3,4

8=Ordos,Staging,Wheeled,2,4

d2enhancedvi3.png

As you see, staging units stick closely to the buildings, making it more difficult to attack the base. Normal units can be also used in defense, but the AI dynamically switches them between attack and defend missions. I guess Staging and Flee teams were not used (or removed) because lots of units under AI control would make too high a pressure for those systems back in 1992. Now it's not an issue anymore, so I might probably add the "new" teamtypes to the original missions to increase difficulty ::)

Posted

Interesting. They have 1 tile at most between the structures and themselves.

At least, I'm assuming that the other units are part of the already existing teams (1 through 6).

Also, how is a team timed? Any idea?

And are they built in the order of scenario? First group 1, then 2, then 3, etc?

And is "Wheeled" just a random pick out of all the (for build) available wheeled units?

Posted

What I find funny is that, in the orinigal code, the word used is "Wheel," while in the modified code, "Wheeled" is used. Is there any difference?

Posted

Yes. Thats what mrFibble shows us with the pictures. It looks like in the original code, the ini files had wronly named team names, therefor was the AI 'more stupid'. If this was done intentionaly is not known, but atleast if you 'fix' the names, it seems to become a lot harder.

Posted

Unfortunately even the "fixed" AI will dumbly ignore the player's turrets, which spell doom to any attempts at attacking a base if placed correctly, but it can give quite a heavy beating to an unprepared player or even succeed at repelling attacks directed at its base.

I still don't know how the teams are timed or whether they repeat themselves. AFAIK, in C&C there were one-time and cycling teams, but in Dune 2 it seems that the teams will repeat in the order they are presented in the list (i.e. when all units in a team are destroyed, it will be rebuilt). I have seen units from a Normal teamtype retreat when most of the team was wiped out, possibly to be included into another team or into the recreation of the original team they were in.

At least, I'm assuming that the other units are part of the already existing teams (1 through 6).

Yes, Normal teams do some guarding too, as well as there are preplaced units with Area Guard mode that will remain around their original location and probably are not included into teams of any types.

And is "Wheeled" just a random pick out of all the (for build) available wheeled units?

Yes again, the AI picks any units from the unit-type category, probably it will add more of those that are more powerful (like more quads than trikes, etc.). I guess this is done to make things more random.

Posted

True. In the meantime, I'm doing more testing on the team behavior. It's worth mentioning that if you have only one team on the team list, and it is of Staging type, the AI will build an attack party, which behaves not unlike a Normal team, alongside the units that are 'staging', and send this attack party against the player. I think this confirms my theory that Staging was designed for defenses. However, a lone Staging team doesn't stick closely to buildings, but loiters somewhere near the base. Probably the second one goes to guard the structures, while the very first occupies possible approaching routes ??? More testing will be done.

I'm certain that the AI cycles through teams, and rebuilds them whenever it has money. I have seen it sending teams (Normal) non-stop: while the first one (with only one tam on the list) was only approaching my base, another was already being prepared.

BTW, do any of you guys know if there are any concept art, renders or other media for Dune 2 obtainable on the net? That would be quite interesting ::) (This question was inspired by the C&C (TD) artwork sketches that I saw recently at the CnC Source Image Gallery, with many interesting ideas that never came to life, while others were later implemented in Tiberian Sun).

Posted

Wow. It seems they've gone out of their way to really make scenario editing a breeze, so to speak. They could've just made seperate Staging types to accomodate for this stuff, yet they just smacked some more AI into the formula. :)

  • 2 years later...
Posted

Staging:

This is the only defensive team type. The AI will amass units inside the base and position them so that the buildings and approaches to the base are guarded. The units in a Staging team will remain where they are for most of the time, and only attack hostile units in range

More testing showed that the units in a Staging type team, at least when other team types are also present in the mission script, tend to ignore the player's units, even if they come within attack range. These Staging units are not completely idle, as they return fire if attacked, but they are useless as defensive forces because of this.

As I stated above, units from the Normal type teams perform what can be considered "defending" the base, as they often stick around somewhere halfway to the AI's buildings. However, it could be that they simply wait for more units to be produced and added to the team before it's been sent to attack the player.

It is quite plausible that the unused team types serve some technical purpose and were never intended to be used in the actual game, or they are relics of some feature that was never completed.

  • 2 months later...
Posted

I still don't know how the teams are timed or whether they repeat themselves. AFAIK, in C&C there were one-time and cycling teams, but in Dune 2 it seems that the teams will repeat in the order they are presented in the list (i.e. when all units in a team are destroyed, it will be rebuilt). I have seen units from a Normal teamtype retreat when most of the team was wiped out, possibly to be included into another team or into the recreation of the original team they were in.

Old topic, but new info concerning this is always welcome I think... :P

Actually, there's a third type of team creation in C&C1 that might be the same as in Dune II, namely "Autocreate". All teams in C&C1 have a boolean in their settings that tells the game if they should be autocreated or not, and once the Autocreate trigger is activated, the AI randomly builds and sends out these teams. I guess in Dune II, this Autocreate is simply activated automatically, either from the beginning or after a set time.

Posted

Actually I have a feeling that autocreate is activated once the player comes in contact with that enemy house (either by sending troops at their base or getting attacked by "enemy reinforcements"). If the enemy does not intersect with any of your units, it is not aware by your existence and will therefore never attack.

A problem I noticed in SD2 was the fact that if the player came into contact with a Worm in a map where a Fremen base was present, this would actually trigger the Fremen to start building waves and attack you. :) This kinda sucks, huh?

-Daelin

Posted

Actually I have a feeling that autocreate is activated once the player comes in contact with that enemy house (either by sending troops at their base or getting attacked by "enemy reinforcements"). If the enemy does not intersect with any of your units, it is not aware by your existence and will therefore never attack.

That is correct. This is why there are enemy air-dropped reinforcements in the first place - they serve as a timed trigger to activate the AI - otherwise the player would have been able to build up a huge army before engaging the enemy.

A problem I noticed in SD2 was the fact that if the player came into contact with a Worm in a map where a Fremen base was present, this would actually trigger the Fremen to start building waves and attack you.

So it happens in regular SD2 too? I guess I'll need to fix that :)

More on the team types: I think it's safe to say that using more Kamikaze type teams in the AI setup will make it more aggressive, since Normal teams are also used in defense, and Kamikaze teams only attack the player. However, I've observed very odd behavior in the last SD2 mission where the AI players (which has only Kamikaze type teams - I removed all Normal teams, because there were too many teams, and I don't know what's the limit for them) would stack their units in the top left corner of the map, where those units just sit around, doing nothing. This might be because no Normal type teams were specified, or maybe because the buildings of different AI players were all placed next to each other, or perhaps the cause is completely different. Anyhow, the AI was pretty aggressive on that mission. Have you ever seen enemy Troopers enter your R-Turrets and blow themselves up? ;D

Another thing I noticed recently is that if the AI has an IX and can build 'Thopters, it will probably waste most of its money on those (and also on Normal teams that do defensive stuff), and the effect will be that it won't have enough money to build up a ground attack force. This probably explains why the AI doesn't have any IX buildings on missions 8 and 9. The situation seems a bit better if the AI has lots of credits (25k and over) and more Kamikaze type teams (like in SD2). Another solution would be to remove the Hi-Tech Factories for the AI players (unless it's Harkonnens), but I think the AI builds carryalls that ferry harvesters and occasionally try to pick damaged vehicles. However, the necessity of carryalls for harvesting operations may not be an issue if the AI is given lots of credits at the beginning of the mission.

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.