Saturday 10 March 2012

The making of the mod thus far...

Since I'm having absolutely no luck with resolving the issue of infinitely spawning objects, and it's even affecting boxes too now, I have no new section designs to show today. This problem is not one I can solve easily and will probably have to wait for my brother to return from his university so we can both knock our heads together to come up with a solution; that will occur approximately one week from now, so it's not too far away.

In the meantime, I've taken some screenshots of the program that I am currently writing to mod Crash 2, and this program is how I have built all my sections thus far. I recommend clicking on the images so you can actually see what all the text is about.


Crash 2's levels are broken down into 64KB chunks, and these are broken down further in a small file tree structure. Entries within have a type identifier. The one I mod are ones of type 7, which contain the objects among other things.

This interface is what you see upon selecting an object.

Every single object within Crash 2, and the same goes for Crash 3, has a standard, very readable, English name, left behind by the developers. They usually go along the lines of "obj_(type)_(variant)_(number)". You can tell which objects I have named, as they do not follow this convention. Each object can be uniquely identified by its name, however there is no need for the names to be different at all; the PlayStation doesn't use these names to reference objects, they're just for the developers, as far as I'm aware.

Position data speaks for itself; this is where the object sits in the level. X is left-right, Y is up-down, and Z is depth, though interestingly the higher Z is, the closer to the screen the object appears. Values in here are relative to the section in which the object resides. If an object has more than one position, it's usually a wandering enemy, and the positions indicate where it'll walk to.

Object ID is a unique identifier of the object, and is used for rendering purposes and for the game to have a reliable method of tracking whether an object has been collected/destroyed or not.

Object Type dictates what the object is, and if there are lots of types of said object (e.g. a box), variant determines which one.

The General Settings contain numbers for specific tasks; e.g. when it comes to boxes, setting the first number to be 97 makes the box always produce a life. Setting the second number to 4 with left bitshift turned off makes the box give you its fruit/contents automatically upon breaking so you don't have to pick it up. You can also use these to dictate if a box is wireframe or not, and which box solidifies next in the sequence when the ! box is hit, if it is. These settings are also used in enemies to dictate their movement speed, or other various properties.

The "Destroys x objects" list usually applies to the Nitro detonation crate. Any ID listed here will be destroyed when the detonator is hit. Yes, it can destroy almost anything, including things that aren't Nitros, or even boxes. TNTs also have this value set sometimes and it's used if you go off-screen before the TNT blows up to ensure it destroys the objects it is supposed to.

The other settings you see do random things, some of which I don't know yet. The configuration for the "obj_checkpoint_emergency" I have shown above is for a ? box that turns into a Checkpoint if you die too many times. The "5" in the 0x288 box identifies which previous Checkpoint it is linked to (the related Checkpoint will also have a 5 in this field). The 3072 seems to dictate what kind of box it is before it turns into a Checkpoint.


This interface is what you see upon selecting the files that
seem to handle the information that renders objects.

This following section is currently incomplete and contains the infamous draw lists that I like to complain about. Draw List 1 indicates when objects should stop drawing, and Draw List 2 indicates when they should start. If you examine the hex, they indicate at what camera position the object will be going off/coming back onto the screen, so they can be used to make rendering VERY efficient by rendering EXACTLY what needs to be rendered only at any given time. The "positions" field shown is actually the route that the camera follows through the level and is directly related to the draw lists.


If space becomes an issue in the tiny 64KB sections, the program can reorder things to generate more room with the "Move this..." button at the top. Adding totally new objects is done on the button right next to it, and the program does its best to seek out the draw lists and add the object to them, though it is not always totally successful; sometimes the object spawned is not totally off-screen before vanishing and whatnot, and at that point the hex editor needs to come out to fix the issue. I've even had one draw list freeze the game for reasons unknown.

All of Crash 2's NSF files have a checksum on them, and changing any data means the checksum needs recalculating. Chadderz, my younger brother, was the one who cracked the checksum; the program updates it upon saving. The "Rehash a file" button has the same functionality, only you don't have to load the file into the editor if you use that button. It's useful if you've been messing with things in a hex editor and want to quickly get things tested.


And that is how I am doing my work! If it becomes stable, I may release it at some point. Currently it's buggy and a little sluggish, but I'll keep on working on it.

It's nicknamed the "NSF Modifier - Ripoff Edition". Why? ...Because my brother made a program called the "SZS Modifier" for Mario Kart Wii. And this program in some ways looks verrrrry similar to his work :P

Well then, have a great evening everyone.

12 comments:

  1. That looks pretty tough to work with. Obviously, it's probably a bit easier for you to use because you understand how the checksums work, but is there any sort of visual representation to show where the objects are landing?

    Very nice work, by the way - you definitely are putting a lot of work into this and I appreciate all of the behind of the scenes work; it's exciting to see this past time being updated to be even more fun!

    ReplyDelete
    Replies
    1. Let's put it this way; it's a lot easier to work with than just raw hex. This program does an awful lot to the internal file structure automatically that would take hours to implement by hand. The checksums calculate themselves thanks to this thing, too. Anyways, I don't have visual representation yet, but I plan to implement that, as it would make organsing things so much easier. Currently I just compare to other objects in the area to get basic co-ordinates, then build to the best of my ability what I think is right via guesswork, make a disc image, go to the level, check it, alter as needbe, rinse and repeat. Naughty Dog seem to love putting things exactly 100 units apart. The size of a box is exactly 100 x 100 x 100. And enemies usually look fine if placed at least 100 apart from each other. So I can usually get a decent result on the first attempt, then I just fiddle things to make sure that the platforming feels nice and smooth, and correct errors.

      And thank you! I'll keep my efforts up. Maybe during this go-slow where developing parts of the level probably needs to wait until that infinite spawning glitch is fixed, I'll get on with visual representation of the objects.

      Delete
    2. Well I'm glad I actually visited that video again for updates lol.

      So, hey. This is turning out to look like a very successful project, and I'm really grateful to see that the editor is looking very user-friendly already.
      At this point, does extracting model entry data from NSF archives look possible for the future?

      I suppose the best-case scenario is that a model viewer is made within the editor, which allows you to place objects in a 3D space according to the level's model sections. But even at the phase this program is at now, it would be enough for dedicated Crash Bandicoot fans to work with.

      So thanks for all the work you and Chadderz have put into this. :D

      Delete
    3. I'd say model extraction will be a distinct possibility; it's just a matter of finding the data and interpreting how it is rendered. Of course, then I too have to learn how to do a 3D render in order to represent the data/modify it :P

      Delete
  2. Seeing your posts got me interested, so I started looking into the game's files. Have you noticed that the third warp room appears to have an extra slot for a gem?

    Also, I was wondering if you would be willing to give out more technical information, like about the checksum.

    ReplyDelete
  3. I will beta testing how can i this make must i skype have?

    ReplyDelete
  4. Very interesting reading, thanks for posting that!

    ReplyDelete
  5. If you would put this game on Kickstarter, I would be willing to pledge $60, and I bet other people would be as well.

    ReplyDelete
  6. I want the NSF Modifier - Ripoff Edition!
    where can download??
    Excuseme, my english is bad.. :S

    ReplyDelete
  7. Where I can download NSF Modifier?

    ReplyDelete
  8. Downloand so
    Im here

    ReplyDelete