Jump to content
Nyerguds

1.06c development topic

Recommended Posts

I've decided to try some user-made singleplayer maps for the first time ever (despite the fact that I've been playing this game for 17 years). I figured out how to get the one's containing a .bin file and .ini file to appear in the missions list by reading the FAQ. However, I noticed there are some that have only a savegame. I'm guessing these were older user-made maps? Is there any way to get these to work in the new mission list, or even at all? Sorry if this question has been answered somewhere. I looked through the whole FAQ and didn't see this mentioned.

Edited by Lightning_Hunter

Share this post


Link to post

I've decided to try some user-made singleplayer maps for the first time ever (despite the fact that I've been playing this game for 17 years). I figured out how to get the one's containing a .bin file and .ini file to appear in the missions list by reading the FAQ. However, I noticed there are some that have only a savegame. I'm guessing these were older user-made maps? Is there any way to get these to work in the new mission list, or even at all? Sorry if this question has been answered somewhere. I looked through the whole FAQ and didn't see this mentioned.

 

Hi again Lightning!

All the Savegames SP missions without BINs+INIs files I have found, I've put in here .

They are all for CnC-DOS. We tried to retrieve their BINs and INIs, but the project failed.

 

Have fun!

Share this post


Link to post

You can always boot up dosbox and have fun with them that way, but savegame missions have the additional annoyance that they're "compiled" versions without "source code", meaning that if the missions contain errors, you can't fix them anymore.

 

[edit]

 

I just realized what I said must sound rather odd coming from the guy who's fixing C&C's compiled form without needing source code, lol.

Share this post


Link to post

I just realized what I said must sound rather odd coming from the guy who's fixing C&C's compiled form without needing source code, lol.

 

Haha, nice one. I understand what you mean. It was stupid of the original authors to include only a savegame file, and nothing else. This is kind of reminiscent of the Quake series. Authors would often times only release a .BSP file (the map info), and not the .MAP file (the source). This meant nobody could ever modify the map in the future (good for copyright, but bad for future compatibility).

Edited by Lightning_Hunter

Share this post


Link to post

Yeah, and with the switch to C&C95, they all became useless -_-

Share this post


Link to post

I just realized what I said must sound rather odd coming from the guy who's fixing C&C's compiled form without needing source code, lol.

Westwood or EA never released the source code ? I thought they did.

 

I just realised something completely stupid. The AI in Dune 2 is able to rebuild every building you destroy (except for the constuction yard), yet C&C AI is not. How could the devs miss something so obvious ?! It's not like it they didn't do it before... The more I see all the bugs and broken things in this game, the more I get the feeling it was unfinished when released lol

Share this post


Link to post

Westwood or EA never released the source code ? I thought they did.

lol! I do hope you're joking. WW never released the code of any of their games, ever.

 

I just realised something completely stupid. The AI in Dune 2 is able to rebuild every building you destroy (except for the constuction yard), yet C&C AI is not. How could the devs miss something so obvious ?! It's not like it they didn't do it before... The more I see all the bugs and broken things in this game, the more I get the feeling it was unfinished when released lol

Eh, actually that makes the C&C1 AI more advanced, since it allows the mission maker to choose which buildings should be rebuilt, where Dune II blindly rebuilds them all.

 

If C&C simply rebuilt everything, that would mean that some forward outpost, or a defense wall with some turrets, which you need to destroy at the start of the mission to establish a foothold, would keep getting rebuilt by the AI. Not really handy.

Share this post


Link to post

lol! I do hope you're joking. WW never released the code of any of their games, ever.

Now that you mention it... I just assumed they did, since a lot of games from that time had their source code released (doom, quake, duke3D etc... )

 

Eh, actually that makes the C&C1 AI more advanced, since it allows the mission maker to choose which buildings should be rebuilt, where Dune II blindly rebuilds them all.

 

If C&C simply rebuilt everything, that would mean that some forward outpost, or a defense wall with some turrets, which you need to destroy at the start of the mission to establish a foothold, would keep getting rebuilt by the AI. Not really handy.

Yeah, I hadn't thought of that. On the other hand, there are some missions where the IA never rebuilds its own refinery. If every mission has its own build list, they could have easily predicted what building needed to be rebuild or not depending on the mission. Unless the purpose was to make missions easier...

Edited by Kamikave

Share this post


Link to post

Yeah, I hadn't thought of that. On the other hand, there are some missions where the IA never rebuilds its own refinery.

I just checked that claim, and it's wrong. In all campaign missions where the player has a base (except the very early ones), at least one of the AI's refineries always gets rebuilt. I remember there being one mission where incorrect placement of a few buildings didn't allow the refinery to get built, but I fixed that.

 

That's another point making the C&C rebuilding system more advanced: you can add buildings that aren't originally on the map, effectively allowing the mission maker to plan the AI's base construction.

 

[edit]

 

The only mission where the AI does not rebuild its refineries is the Covert Ops mission 'Infiltrated', but since you're forced to mess up the AI's rebuilding system from the start there (by blocking the location where the AI keeps building a turret in the middle of your base) it's a moot point anyway.

Share this post


Link to post

That's another point making the C&C rebuilding system more advanced: you can add buildings that aren't originally on the map, effectively allowing the mission maker to plan the AI's base construction.

Yes, I have to agree on that. I never saw the map without fog of war at the very start, but in the covert ops mission Blackout, the Nod base seems to be almost empty at first (except for the turrets). The IA is builduing everything along with the player. Which, ironically, backfires if you use the first air strike to destroy the construction yard lol

 

The only mission where the AI does not rebuild its refineries is the Covert Ops mission 'Infiltrated', but since you're forced to mess up the AI's rebuilding system from the start there (by blocking the location where the AI keeps building a turret in the middle of your base) it's a moot point anyway.

Yes, I was thinking of that mission when I mentionned this (I admit, I never checked them all ^^'). But you're right, the IA is totally messed up in this mission.

Edited by Kamikave

Share this post


Link to post

There are a few maps like Blackout in that aspect.

 

GDI's Hell's Fury mission is built completely around the fact you need to get to the landing zone before Nod builds its base in the middle:

http://nyerguds.arsaneus-design.com/cncstuff/mappics/covert-gdi/scg23ea_Hell's_Fury.png

(teal = unbuilt at the start)

 

The base in Nod's Deceit mission also has no weapons factory and internal defenses at the start. With a lot of micromanaging it's possible to perform a commando strike against it from the start (though you always lose the Chinook to the enemy Orcas then).

http://nyerguds.arsaneus-design.com/cncstuff/mappics/covert-nod/scb21ea_Deceit.png

 

And in some, the AI doesn't have a refinery from the start, to make sure you don't get attacked before accomplishing the primary objective (like, finding your base, or capturing an enemy forward outpost). This technique is used in about half of all Covert Ops missions where you need time to establish a base.

Share this post


Link to post

After a really interesting question from Mr_Killt on the cnc-comm forum, about the Nod mission where you have to assassinate Dr. Chan, I used my answers to him to write a small article on ModDB, detailing some of the special code used in C&C's campaign missions.

 

You can read the it here.

Share this post


Link to post

Hey Nyerguds. I got some suggestions:

 

1°- (I've said before in somewhere as far I can remember) Can you make the crates drop something else than money in Single Player?

 

2°- Can you make any building turn stealth in a scripting way? (editing the mission INI, for example)

Share this post


Link to post

Hi Nyerguds and NathanCNC ^_^

Long time no see ;^_^;

 

its great to see you guys still keeping this old Dream still alive good games good stories... ^_^

 

 

ps: I even got to keep my Same Avatar I use I didn't even to config it when I signed up here lol

Share this post


Link to post

Ah, that's probably through the magic of Gravatar. It works on email address :)

  • Upvote 1

Share this post


Link to post

Ah, that's probably through the magic of Gravatar. It works on email address :)

Sweet ^_^ I do remember something about gravatar some time in the past ^_^

 

and some EPIC YT Vid to go with my Enthusiam ^_^

AkatsukiLuver88

Share this post


Link to post

You gave me a summary of what you did to fix sidebar positioning for loading save games before. Could you give me a more detailed explanation? Sadly this seems to be necessary too RA1 so I'd like to take a shot.

Edited by Iran

Share this post


Link to post

Oh and maybe an explanation of how the colour remap system works and how you expanded it, sounds like something fun to do for RA1, the extra colours you added look pretty awesome.

Share this post


Link to post

As for the sidebar... well, at the moment a game is loaded, I call a sidebarclass_reset function. This function is a copy of the SidebarClass::One_Time(void) function.

 

Somewhere at the start of this function, it calls PowerClass::One_Time(void). Since this also contains sidebar positioning, I also made a copy of that, called powerclass_reset.

 

At the start of that, the RadarClass::One_Time(void) function is called. Since this contains the correct positioning of the radar graphics, I also copied that, to radarclass_reset.

 

Now, this one also calls DisplayClass::One_Time(void). At this point, though, the cloning stops. The Displayclass init no longer contains sidebar position formatting, so I simply removed it from my copy of the radarclass init.

Looking further in RadarClass::One_Time(void), you also see it loading the sidebar graphics (in C&C95 anyway). All of that code is removed as well, since it's already loaded. Only the positioning code is kept; the rest is all stripped away.

 

Similarly, the end of SidebarClass::One_Time(void) (again, just talking about C&C95) contains the SidebarClass::StripClass::One_Time(int) function calls, and the loading of the actual sidebar graphics. Unless you got code for expanding the sidebars to full height, this init function should also not be cloned. The graphics loading should be skipped anyway, since the original game init undoubtedly already loaded that.

 

That's about it, really. Hyper identified these functions for me, making it easy to see what to clone and what to leave. Anything related to graphics loading should be kicked out of your copy, though. No need to reload already-loaded graphics.

 

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

 

As for remap... well, as you may know, SHP files contain no colours. The game contains entire remap tables of 255 bytes, that simply, well, re-order the palette. For example, if C&C would be 16-colour, and the remap table would be

 

5,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

 

and then a SHP file is loaded, the game goes over all indexes in that SHP information, and corresponds them with the value in the remap table. Any 0 that's found is replaced by the value in index 0 in the remap table, namely, 5, any 1 is replaced by the value on index 1 (which is still 1), and so on. This specific remap table only remaps colour #0 to colour #5.

 

Since C&C is 256-colour, these tables are 256 bytes long, but the principle remains the same. In reality, though, you'll see these remap tables normally just go from 0 to 255, with only a small range inside that whole block actually changed.

 

Here are these tables in C&C95:

http://nyerguds.arsa...cnc95_remap.png

As you see, the B0 to BF range is the only thing actually touched. The rest is kept as it is.

 

That's the basic system. Now, in RA, all of that information is saved in the upper left corner of the palette.cps file. The first line is not only some side's actual remap colour, but also the remap source; which range in that 256-byte block to replace. The next lines are the other sides' colours, telling the game what indexes to replace that range with for each new colour. Once you debug, you may see them appear as these blocks of 256 bytes too, but I can't really be sure, since the whole 'read from cps' thing is kinda weird imo.

 

As for the dual colour for Nod, honestly, I have no idea. I just found the code that checked if the side was Nod, and if so, switched the palette with the red one. I changed the check so it isn't just hardcoded for 'nod', but checks a custom "secondary palette" property of the house instead of just its house ID, and if said property isn't "-1", it uses it as index on a list of palettes (well, colour schemes actually) to find which remap table to use.

 

This function only did the side check and palette switch, though. I never bothered to check where it was called from. Most likely, the place it is called from is the actual system for loading graphics for buildings and units, and, in the units' case, with an extra check to only call the secondary scheme function for the MCV (since it needs to transform to a secondary-colour CY without sudden colour switch) and the Harvester (since, in C&C, it docks into the refinery building graphics). I'm afraid you'll have to debug C&C95 to figure that stuff out, though.

Share this post


Link to post

btw, if you don't have the one_time functions... a general outline:

 

game_init, the function that, in C&C95, does stuff like loading mix files, unit art, initializing the game surfaces, etc, contains a call to MouseClass::One_Time.

 

MouseClass::One_Time should be the function loading mouse.shp. Before that, though, it calls TabClass::One_Time.

 

TabClass::One_Time loads (h)tabs.shp (in C&C95), which seem to be the menu button graphics. Before it does anything, it first calls SidebarClass::One_Time.

 

SidebarClass::One_Time sets the sidebar element positions, as calculated from the game width. This includes the positions of the sidebar scrollable strips. It starts by calling PowerClass::One_Time, and, near the end of the function, it calls SidebarClass::StripClass::One_Time, twice; once for initializing each sidebar icons strip. After that, it loads the actual sidebar graphics.

 

PowerClass::One_Time sets the positions of the power bar. If I remember correctly, when cloning this, I had to reset some house power status somewhere too, to make the UI know it should recalculate the actual power height on that bar, since that stuff is NOT inside this init function. After calculating its positions, it loads the power bar graphics.

 

SidebarClass::StripClass::One_Time sets the basic width and height to be used for a single icon, and seems to not only load the actual empty-strip graphics, but also the clock shp and the superweapon icons. The function in C&C95 actually gets a strip ID as argument (once for 0, once for 1), but this value seems to be completely ignored by the actual code.

I think the superweapon icon loading that's performed here is ignored by the game though, since it seems to load them as ".shp" files rather than the theater-relative version C&C95 actually uses.

Share this post


Link to post

So with your help and some soul crushing work trying to figure out why some sidebar elements still had their elements loaded incorrectly I manged to do both I asked you about.

 

I was wondering if you could tell me how the game adds custom missions to the ingame display list. I've been working on something similar for RA1 where if you load the game with a command-line argument it converts the Counterstrike menu into a "New missions" menu (should probably rename it to "Custom missions" but i disgress. Now the problem is that I'm using an INI file with the mission files configured in them, what I want to do instead is make the game display custom missions it finds in the game folder matching a specific wildcard name. If I remember correctly C&C95 does things like this.

Share this post


Link to post

Um, it just does a loop setting the scenario number from 20 to 99 (999 with my patch) using ScenarioClass::Set_Scenario_Name, then uses CCFileClass::Is_Available() to see if it exists, and if so, reads the mission name from its [basic]->Name tag.

 

It then adds the GDI: or NOD: prefix to that string, and saves it in an object containing the mission number (and, in my patch, the side id).

 

This code is executed twice; once for each side. The result is stored in a vector.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×