Jump to content
Sign in to follow this  
Sonarpulse

Trippy savegame hacking & scripting

Recommended Posts

The only time I've seen something like that happen was when I hex edited a savegame to make me control the AI side. This did give me control over all stuff, but it DIDN'T deactivate the AI, meaning you saw it build stuff even while I did nothing :P

trippy, can you say how to do that. I would love to try that.

Share this post


Link to post

Mehh, it's a long time ago... the bytes just before the storage of the videos to play have one value that is the side the player controls. I just changed that byte with a hex editor.

 

---

 

Right, I looked it up. If you open a savegame, and go to the end, you'll see the following things when scrolling up:

 

-the action video (512 bytes)

-the briefing text (512 bytes)

-12 bytes of settings I don't really know

-the briefing video + a bunch of my own 1.06 custom mission settings like the custom capturability and colour schemes arrays (512 bytes all together)

-the buildlevel (4 bytes)

-8 bytes of settings I don't really know

-the end letter value of the mission filename suffix (sc?##e[A]) (1 byte)

-the start letter value of the mission filename suffix (sc?##[E]a) (1 byte)

-The waypoints list, each waypoints being 2 bytes (56 bytes);

-A number of bytes of settings I don't really know (read with some loop, not too sure how it works or how much data it reads)

-the lose video (512 bytes)

-the win video (512 bytes)

-4 bytes of settings I don't really know

-scenario number (4 bytes)

-player ID (4 bytes)

 

So basically, find the Win video, and 12 bytes before it is the player side. 0=GDI, 1=Nod, 2=civ, etc.

 

[edit]

 

Hm, I just realized how easy it is to add additional settings space in my savegames without breaking compatibility... I just store a "isNewSavegame" boolean right behind the Win video name (got tons of extra space there), and make that trigger the system into reading an extra part after the Action video at the end. I could even expand the waypoints beyond 28 with this :)

 

As you may have noticed, these video names use up TONS too much space; they only need 9 bytes for the 8 characters name (DOS 8.3 type filename, without extension) plus the single 00 byte to determine the string's end, but instead they got an entire half kilobyte each. As you can see in my description above, I already recycled some of that wasted space for new 1.06-related mission settings ;)

Share this post


Link to post

Cool, I'd like to rig a human plus 2 ai game, sell/kill all the humans stuff but a rifle soldier, use this trick to play as one of the ai players, kill the one rifle soldier, and watch the carnage between the AIs unfold.

 

Also, Glad my question (apparently) led to your discovery. It seems you know enough about the save game format to convert a savegame back to an *.ini. Is this possible?

Share this post


Link to post

Oh heck no. This is just side information, and even there a lot is unknown. This doesn't even touch the map and unit storage, and even besides that there's the triggers and teamtypes, all saved as raw data.

 

As for your idea, I don't really get it. The triggers stay the same; if the MISSION is set to lose when your original human player side dies, then the mission WILL give "mission failed" if you kill the last of the originally-player units. The triggers don't care what player you are playing. It doesn't let houses lose, it lets the mission fail.

 

It will also not change any previous alliances between the AIs.

 

It seems to me the easier way to do this is just to program 2 AIs battling on a map, ally the player's house to both of these so you are neutral, and put a few commandos on the map to scout it all.

 

 

Anyway, this thread is about the AI behaviour. You already forced me to split from the translation thread... please stay on topic here.

Share this post


Link to post
Oh heck no. This is just side information, and even there a lot is unknown. This doesn't even touch the map and unit storage, and even besides that there's the triggers and teamtypes, all saved as raw data.

Oh well, just checking. Just be clear I meant more extract the *.ini that was originally played than build an *ini from the current state of the game.

 

As for your idea, I don't really get it. The triggers stay the same; if the MISSION is set to lose when your original human player side dies, then the mission WILL give "mission failed" if you kill the last of the originally-player units. The triggers don't care what player you are playing. It doesn't let houses lose, it lets the mission fail.

 

It will also not change any previous alliances between the AIs.

 

It seems to me the easier way to do this is just to program 2 AIs battling on a map, ally the player's house to both of these so you are neutral, and put a few commandos on the map to scout it all.

Ok, yeah I probably get an senario, edit it to create a third neutral faction with a a rifle soldier, switch the player-ai info to make the old player ai and new team human, not touch the win/lose conditions, and then play the mission and do the save+hex edit trick.

 

Anyway, this thread is about the AI behaviour. You already forced me to split from the translation thread... please stay on topic here.

Figured it would go better here.

Share this post


Link to post
Oh well, just checking. Just be clear I meant more extract the *.ini that was originally played than build an *ini from the current state of the game.

That's not even possible. The original state isn't saved, only the current state. When you restart a mission it just rereads the .ini and .bin.

 

Ok, yeah I probably get an senario, edit it to create a third neutral faction with a a rifle soldier, switch the player-ai info to make the old player ai and new team human, not touch the win/lose conditions, and then play the mission and do the save+hex edit trick.

Umm, I'm just saying there's no need to do any save+hex tricks if you set your side to the Observer from the start... unless you just want to see the weird "AI doing stuff on your side" behaviour.

 

Figured it would go better here.

Not really the point :P

Share this post


Link to post
That's not even possible. The original state isn't saved, only the current state. When you restart a mission it just rereads the .ini and .bin.

 

Wait, from reading the custom missions thread, I thought many old maps were distributed as saves and you just restart the save to play the mission.

 

Umm, I'm just saying there's no need to do any save+hex tricks if you set your side to the Observer from the start... unless you just want to see the weird "AI doing stuff on your side" behaviour.

 

Oh, never heard of the observer mode before. Seeing the weird "AI doing stuff on your side" behavior would be cool, though.

 

Not really the point :P

 

well, it involves multiple players and mission *.ini design so... :)

Share this post


Link to post
Wait, from reading the custom missions thread, I thought many old maps were distributed as saves and you just restart the save to play the mission.

Quite the contrary. The people who made them just saved them at the start of the mission, and since the savegame is 100% independent from the source ini&bin, you can simply load that savegame and play through the entire mission. (though most of em are from DOS C&C, making them utterly useless in C&C95)

 

If you'd restart, however, the game just looks for the original ini and bin file associated with the mission number information saved in the savegame, meaning you'd just get the original scenario (if it replaced a campaign one) or "unable to read scenario" if it was some mission added to the New Missions menu.

 

Oh, never heard of the observer mode before. Seeing the weird "AI doing stuff on your side" behavior would be cool, though.

Well it's not hard to pit 2 AIs against each other and let both of them ignore you. That's just tweaking the alliance settings of the sides. Nothing special or new about that.

Share this post


Link to post

Oh OK. Wow that's really crude with the DOS save games. And good point, I could just forget the whole selling off thing cause if I'm already neutral my stuff won't make a difference anyways.

Share this post


Link to post

Since the previous thread splits I did had somehow moved the 2 parts of this conversation into entirely different threads, I decided to split it all and merge it together correctly ;)

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×