Author Topic: What have I gotten into?  (Read 2844 times)

Felis Astrum

  • Newbie
  • *
  • Posts: 4
    • View Profile
What have I gotten into?
« on: February 07, 2010, 04:34:09 PM »
Hello all! I found this board a few days ago and having dreamed (literally even) of Stunts modding since I was a kid, I just had to have a go. I'm so impressed by the work that's been done on figuring out the inner workings of Stunts... I don't even. Stressed is amazing and I've obviously started work on a car- a Mercedes 300E, now I'm already trying to bite off more than I can chew with a new mega project. It's top secret right now, but all shall be revealed when completed.

However, I've done about as much of this project as I can at the moment as I have to accept that I'm out of my depth. So I was hoping perhaps somebody could help me. Apologies if my questions are daft or posted in the wrong place, but I would be infinitely grateful if somebody could steer me in the right direction so I don't keep hitting a wall. Erm sorry, that was quite poor.

The first bit I can't manage is, I believe, within the SD?SEL files. I want to both add more cars, and remove some opponents. The latter sounds odd, but I have my reasons. Top secret. I've seen in Zakstunts that it is possible to extend the selection of cars, but I have no idea how.
The other thing is editing the opponent profile text and dialogues- I assume Stressed doesn't interpret all the data in the .RES files, or maybe I'm just doing it wrong, as when I save the modified file, the game crashes when I try to race the opponent.

Anyway, since this is my first post, a little intro. I started playing Stunts in about 1992 and never really stopped. It's been on every computer I've had. In the old days I competed against my brother, these days against my husband, who is as into the game as I am. I also live in Australia and have cats.  :)


Duplode

  • Considering trying out spam
  • *******
  • Posts: 3409
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: What have I gotten into?
« Reply #1 on: February 07, 2010, 06:11:14 PM »
You know, synchronicity is such a wonderful thing. Yesterday evening I had an unexplainable surge of motivation and decided to start working on some user-level documentation for stressed. After writing on the first few topics, I was left thinking "good, now it would be great to have active modders again to use and discuss this stuff...". And here you are. Welcome aboard Lady Astrum  :)

I started playing Stunts in about 1992 and never really stopped. It's been on every computer I've had. In the old days I competed against my brother, these days against my husband, who is as into the game as I am. I also live in Australia and have cats.  :)

Ah Australia, such a wonderful corner of the world! I hope to be able to visit it some day eventually. We didn't have many people from Australia in the community before, but one of the members our hacking "team", Cas, is not very far spending a season in NZ.

(...) with a new mega project. It's top secret right now, but all shall be revealed when completed.

 :) 8) ;)

The first bit I can't manage is, I believe, within the SD?SEL files. I want to both add more cars, and remove some opponents.

We have two separate issues here, so let's begin with the cars. Adding a new car to the game just requires you to provide the four car files with the correct names. For your Mercedes (nice 3D model, BTW  :)) these might be CAR300E.RES (performance and text data), ST300E.3SH (3D shape), STDA300E.VSH (dashboard bitmaps) and STDB300E.VSH (auxiliary dashboard bitmaps). If your car is not finished yet and you need to do some testing, copy any missing files from an existing car and change the file name. Just be careful with one thing: file extensions. The .PVS and .P3S files that come with the game are compressed versions ("P" stands for packed). Stressed unpacks the files on loading, and always saves unpacked files. In order to have edited files loading correctly, you need to change the extensions on saving from .PVS to .VSH and .P3S to .3SH and delete (or move to somewhere else as backups) any pre-existing .PVS and .P3S with the same name (that holds for cars as well as for all the other things). If you just copy-paste an original (packed) file to test your car there is no need to change extensions, just the file name. The only other problem that you might have is that there is an upper limit to the number of cars in a Stunts install, 24 if I remember correctly.

Now, the opponents. If I got it right, with "remove some opponents" you mean reducing the number of choices in the menu from 6 to 5 or something else, as opposed to just modifying the opponent attributes. I'm afraid that may not be possible, through I'm not sure as I did very few tests with opponent modding so far. As you already noticed, the SDOSEL file contains only the graphics of the menu, the actual performance (and text) data for the opponents being in the OPP?.PRE files. A crude solution could be merely removing the OPP?.PRE for a certain opponent, which will make it inaccessible - but then the game will crash ("Please Check Disk" error) every time when someone switches to the position of that opponent in the menu. And any attempts of removing the opp? bitmaps on SDOSEL cause a crash as well. Editing the existing opponents' data should be possible, though. Which leads us to...

The other thing is editing the opponent profile text and dialogues- I assume Stressed doesn't interpret all the data in the .RES files, or maybe I'm just doing it wrong, as when I save the modified file, the game crashes when I try to race the opponent.

Your assumption is correct. stressed can't parse the parts of OPP?.PRE (or OPP?.RES if unpacked - BTW, which version of the game are you using, 1.0 or 1.1?) which contain performance data. That means that no matter what you do you won't be able to modify these files with stressed (I can see a temporary solution to this issue which might be easy to implement, though, and will pass the idea to dstien). Currently the only way to modify that data is using Opponent Blaster to adjust performance and manually changing the text on an hex-editor. All of that assumes you're working either with 1.0 files (which are already unpacked - .RES extension) or with 1.1 files manually unpacked via stunpack. Bit of an annoying task, but possible.

Hope I could help with these first few initial questions. Please tell us what you intend to do, or learn to do, next - and feel free to post as many questions as you wish. I and others will do our best to help! ;)

(note to Zak: maybe it would be better to move this topic to the "Car Creation" subforum. Or maybe not, as it will also touch other modding issues...)
« Last Edit: February 07, 2010, 06:16:05 PM by Duplode »

Felis Astrum

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: What have I gotten into?
« Reply #2 on: February 08, 2010, 03:59:01 AM »
Hi Duplode, thanks for the welcome and for your helpful reply. Well, I've added the car now, I don't know what I was doing wrong before because I did try putting in those files as copies of existing cars and it didn't work. I dunno, late, sleepy, etc. I figured there must have been a reference to them elsewhere, so I probably would have still been searching for that now, lol. The fact that additional car files can just be added like that makes me wonder if the game was built to allow for car expansion packs.

I'll have another go at editing the opponent files with a hex editor. I did try that already but even if I saved the file without making any modifications it didn't work (annoyingly enough I just tried it again while writing this and it appears to work now. As does editing the text in the car .RES file. How bloody tired was I?!).

I'm using both 1.0 and 1.1 at the moment- switching from one to the other depending on what I want to try. I've already done the opponent image files (plus the animated ones) and a landscape, which were straightforward enough. As for what else I intend to learn, I don't really know. I tend to just throw myself at things that look challenging and go on for as long as I can. The super secret project will be a themed version of Stunts, and I'll make whatever modifications I can to fit the theme. This is why I want to change the number of opponents, because they will be a particular set of characters.
Anyway, whenever I get stuck, I'll just busy myself with building cars. The kid-me from the early nineties would be so proud!  ;D

Felis Astrum

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: What have I gotten into?
« Reply #3 on: February 08, 2010, 07:31:30 AM »
Right, while I am able to use the OPP?.RES files now, I don't.. exactly.. know how to correctly edit a hex file. Time to do some reading, I suppose!

Duplode

  • Considering trying out spam
  • *******
  • Posts: 3409
  • Through the astral door - to soar
    • View Profile
    • The Southern Cross Stunts Trophy
Re: What have I gotten into?
« Reply #4 on: February 08, 2010, 12:59:35 PM »
The fact that additional car files can just be added like that makes me wonder if the game was built to allow for car expansion packs.

Yes, that's likely! At least Test Drive, the (commercially) more successful sister project of Stunts, used to have expansion packs. In fact, some of the file extensions for Test Drive II are very familiar, but the contents are a bit different so that stressed can't open them properly.

I'm using both 1.0 and 1.1 at the moment- switching from one to the other depending on what I want to try.

That's fine, I just asked because 99% of the documentation currently written takes 1.1 as basis. There shouldn't be too many differences though, at least from a modder point of view... BTW, do you know if the OPP?.RES from 1.0 work correctly when replacing the OPP?.PRE from 1.1?

Right, while I am able to use the OPP?.RES files now, I don't.. exactly.. know how to correctly edit a hex file. Time to do some reading, I suppose!

Seems like editing the text in those .RES only works part of the time for you. I guess that when you just replace characters it goes fine, while when you try to change the length of the text string by adding or removing characters it doesn't. That problem comes because of the need to adjust the file header. The header contains a list of 4-char IDs for each resource (in this case, text snippets) followed by a matching list of byte offsets which tell where on the file each resource starts. If you take off four characters of a text resource, you will have to subtract four from that resource's offset (and also from all of the ones that come after it on the file). There is a formal definition of that process in this Wiki page, but I think you will find more helpful for visualizing the changes the post dstien made to explain the same thing to me a while ago  :) http://forum.stunts.hu/index.php?topic=1137.msg34782#msg34782

Felis Astrum

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: What have I gotten into?
« Reply #5 on: February 09, 2010, 11:47:27 AM »
OH! I see. :)

Quote
I guess that when you just replace characters it goes fine, while when you try to change the length of the text string by adding or removing characters it doesn't.

You're right, and I could see what was going wrong, but I had absolutely no idea how the offset list related to the rest of it. I just tried after referring to Dstien's post, and it works perfectly now.
I've read through that thread a couple of times and it's been very enlightening, but I can't again until the 14th as our isp is punishing us for exceeding the download limit (Australia and its capped internets, WTF).

Quote
BTW, do you know if the OPP?.RES from 1.0 work correctly when replacing the OPP?.PRE from 1.1?

I just tried copying it over but it didn't appear to work, which makes me all the more undecided on which version to stick with. Because it's not possible to take cars from 1.1 to 1.0, is it?

Well, at least I now have a nice bit to busy myself with while I'm roughing it without the internet for the next week.  :-\

zaqrack

  • Administrator
  • Addicted to spam
  • *****
  • Posts: 4527
    • View Profile
    • ZakStunts
Re: What have I gotten into?
« Reply #6 on: February 09, 2010, 12:53:24 PM »
and here goes an official welcome from me as well :)
nice to see Stunts devotees from down under... and lets also not forget that you improved the forum`s male-to-female ratio to a whopping 29.5:1! :D

Quote
I guess that when you just replace characters it goes fine, while when you try to change the length of the text string by adding or removing characters it doesn't.

You're right, and I could see what was going wrong, but I had absolutely no idea how the offset list related to the rest of it. I just tried after referring to Dstien's post, and it works perfectly now.
I've read through that thread a couple of times and it's been very enlightening, but I can't again until the 14th as our isp is punishing us for exceeding the download limit (Australia and its capped internets, WTF)

Quote
I just tried copying it over but it didn't appear to work, which makes me all the more undecided on which version to stick with. Because it's not possible to take cars from 1.1 to 1.0, is it?
No, unfortunately its not possible. But I suggest you should go with 1.1. It`s the "community standard" or whatever. :) It is probably easy to uncompress opponent data in 1.1.
And anyway, tunnel roof are nonexistent and cars are too fragile in 1.0 - means less fun ;)

Anyway I remember I translated Stunts 1.0 to Hungarian - and took some time to replace what the opponents say to some funny stuff. But this was... too long time ago, lol. :D

Quote
Well, at least I now have a nice bit to busy myself with while I'm roughing it without the internet for the next week.  :-\
That`s evil... wish you endurance! Do not forget to download the current ZakStunts competition track while you still can, and give it a go!
« Last Edit: February 09, 2010, 12:55:05 PM by zaqrack »

dstien

  • Stunts Master
  • *
  • Posts: 161
    • View Profile
    • Stunts Tools
Re: What have I gotten into?
« Reply #7 on: February 15, 2010, 10:33:58 PM »
Welcome aboard, Felis. Nice work!

Because it's not possible to take cars from 1.1 to 1.0, is it?

I think the compression format differs slightly between the two versions, but I never bothered to investigate it. You can use the stunpack command line tool to make uncompressed resource files. I'll add full opponent editing support to stressed unless I get distracted again. ;D