Possible discovery in scripted material types

Started by seraglio, November 17, 2014, 04:14:03 AM

Previous topic - Next topic

seraglio

 :ff:
Apologies if someone already discovered and tested this, I did a quick search and dint see anything relevant.

On my Freedom Force to do list for many moons now was to test the "ectoplasm" and "darkmatter" material types that are in FFVTR in FF. My hunch was there was more than 13 material types, things on computers tend to be base 16, so I was guessing that these same material types plus 2 more would be in FF.
For those who dont know (since im not posting in the scripting forum where I normally lurk), material types have the following values:

0=flesh
1=metal
2=stone
3=rubber
4=fire
5=energy
6=air
7=wood
8=stone
9=frozen
10-=cloth
11 = seems to be same as energy
12 = Ectoplasm
13 = darkmatter

I used this super simple attribute to do my testing '

Code: [Select]

def initdarkmatter(char,update=0):
    Object_SetAttr(char,'material',12)


I was guessing there was a 14 and 15.

Yup there was....and a whole lot of others! In fact , I don't understand the format, but it appears you can put almost any value to material you want and get a new material type. I used values up to 1024 as well as negative values. Here are a few I wrote down:

materials new FF
12   vulnerable(not defenseless) against all 8 materials,but crashes. More stable if target not knocked back
14   weak against cold acid fire and energy
15   weak against acid electricity energy piercing
16   weak against electricity radiation fire energy piercing crushing
17   weak against cold radiation fire piercing crushing
18   weak against cold acid fire energy(same as 14)
19   weak against acid electricity energy piercing crushing
20   weak against electricity radiation piercing crushing
21   weak against cold acid electricity radiation fire crushing

-1   weak against cold acid radiation crushing
-2    weak against cold electricity piercing crushing
-3   weak against acid energy piercing crushing
-16   weak against cold fire acid
-12   weak against cold fire energy piercing  strong against crushing...Not Playable

I still dont understand the actual function of these other hidden types in FF. Almost all were vulnerabilities, the 50 or so I tried only revealed one (-12) with a resistance. Almost all crashed in the game (windows type exception errors) in FF eventually under combat testing.
So while this isn't a very big deal for FF, it could be huge for FFVTR players if it too has additional material types beyond 13 and the game doesn't crash. I suspect it wont, since 12 and 13 crashed my game but apparently work in FFVTR, I suspect they all will. And since you can reverse resistances with gene damage.....basically this could mean fully scripted material types! No need to use up your precious 5 attribute slots getting the perfect resistances.
I dont have FFVTR, so I need somone to test and catalog this. If it works, I might even start playing FFVTR!

stumpy

Unfortunately, I very strongly suspect that using materials beyond 10 (or maybe 12) or so will be unpredictable in FFvT3R, just as it is in FF, likely leading to instability and crashes.

The material resistances (and other related material properties, like cost and weight multiplier) are tabular in nature, not formula-based. To wit, when I set a hero's material to metal, the resistances and so on are determined by a table somewhere. It seems like most of those tables are hard-coded into the engine*. What's likely going on when you use a material beyond the built-in ones is that the game is looking outside the table and interpreting that data (which is likely some other table or code) as if it were still part of the material table. Since the material specified in a hero file or object template is a float, you can reach far past the normal material table. But, there is no guarantee that whatever is there will make much sense, or even that it is constant and won't change as the game is played.

I would suspect that what crashes the game is that the string lookup for material names beyond the usual ones eventually returns some data that the engine doesn't know how to render as a string. When it tries... blork! It's also possible that, when looking up a material past the normal table bounds, the game attempts to access memory that's beyond that owned by the game and the OS shuts it down. Aside from those issues, FFX would have to be changed to allow for the new materials as well, since it uses them in a couple places as well.

It's possible that the data past the normal material table entries is constant enough that we could find some chunk of it that would be useful for character building and where setting materials to values in that region doesn't crash the game for some reason other than string lookup. String lookup would likely still destabilize the game when a player tries to look at that character's material data in the in-game character editor. In the game interface, that's also where the player chooses a voice pack (as I recall), so it might be sort of troublesome to make sure players never click on that tab. But, that may be an acceptable price to pay, assuming other utilities could be used to set the voice pack and the material itself (which would be pretty easy to do, even a small change to the datfiles module would allow it). However, it would still be something of a task to determine and document the material properties in those new ranges, so that they could be usable. And, there are other likely side effects to deal with, such as a character having what is effectively a random (possibly negative) weight and the impact that might have on game physics.

* As an aside, the Number Balancing document suggests that there are ways to override some of the tables, but it doesn't say which ones, what they do, or even what their names are. There are few examples to work with and I have not seen any indication that the materials list can be extended. The document notes that the lengths of overridden tables must remain unchanged, suggesting that (even if we could figure out what it was) overriding the materials table would not allow us to add more materials, though we might be able to change the default properties of the existing ones.
Courage is knowing it might hurt, and doing it anyway. Stupidity is the same. And that's why life is hard. - Jeremy Goldberg

seraglio

Thanks for the reply Stumpy! Good to have someone with real programming skills explain what is happening. By the way, what is this "Numbers Balancing Document"?

stumpy

It's one of the Irrational Games documents released with FFEdit and the other modding tools, like the FF Scripting document and the FFVT3R Commands and Variables document. It's mostly about how the various powers in the game are priced, which is mostly useful to modders who want to change the costs of powers for some reason. But, there are a couple tidbits that refer to other things (albeit somewhat vaguely). You should be able to find it at ..\Freedom Force vs The 3rd Reich\Help\FFEdit\Number Balancing in Freedom Force.doc.
Courage is knowing it might hurt, and doing it anyway. Stupidity is the same. And that's why life is hard. - Jeremy Goldberg