Difference between revisions of "Talk:UNITREF.DAT"

From UFOpaedia
Jump to navigation Jump to search
Line 76: Line 76:
  
 
- Bomb Bloke
 
- Bomb Bloke
 +
 +
----
 +
Perhaps the first value is width and the second value is depth or something? They might have been planning to have non-square units at some point.
 +
 +
BB, if there is a 'float' height value, then wouldn't the Celatid be the only one with a value other than 0?

Revision as of 11:12, 13 October 2005

Some of the notes got me wondering. Each tile in the game is made up of multiple layers, defined in the scang.dat file. Put these layers together, and you get a primitive 3D object, which the game uses to calculate line of sight, as well as whether a bullet hit or not.

I wonder if units have their own 3D models.

You see, a unit which has a low height stat, bullets will go over its' head. But, the Celatid has a very low height stat. So, perhaps there is a 3D model at work defining whether the bullet hits or not?

Another possibilty is that each unit has more stats for dimensions then simply height. For example, a stat which says how far above the ground it is.

Mike, concerning the bitflags you added from the 'many aliens' save file... Um, those aliens would have been all the same type before Hobbes edited the file... So I'm not sure the stats fully apply to the aliens as they are now...

- Bomb Bloke


BB, I'm pretty new to Unitref, and haven't used XCOMUTIL either. In fact, doing this is part of me learning about Unitref. If you think Hobbes info doesn't apply, go ahead and pull it. (Or if unsure, stick in a note to that effect?)

I have to rely on you pros' opinions here. I've made a backup copy of the Editing version of the page, so they can be retrieved if necessary. In any case, I'll point out where I got info from, in case it might apply to other things, too.

Edit: Ok, now that I've gotten farther through Hobbes' data relative to Unitref, it seems clear that there is garbage in some fields, like the Kill, Mission, and Experience ones. Which makes the other ones at least somewhat suspect. If not a lot suspect. But it's getting real late here... I'm hitting the sack. Will work on it more, comparing against homegrown combats and/or pulling some of what I put in from his savegame. Anyone else feel free to do the same.

Good to see you! That's a helluva lotta work you and NKF did. I wrote some VBA that pulls Unitref into a db. Makes it real easy to look at values, including across different Unitrefs. I may or may not be taking a much longer look at Unitref... not totally sure what I'll work on next with XCOM, atm. Besides finishing some more Unitref notes. Hope we don't collide when editing that page!!

Talking of 3D, did you see User_talk:Danial's stuff? Not 3D per se, but anyway...

- Mike


I've realised that I spoke too soon. There's a good chance that Hobbes would have correctly implemented the extra aliens in the save file (in fact, the correct way is just about the easiest), so I reckon those stats would be ok. Only he'd know, of course.

Concerning the 'rubbish' data you found, that's naturally occuring in all save files. Any byte which is 'unused' (for example, the extra bytes in the name string) is subject to random bits of data. Aliens don't use those counters, you see. You might have noticed the post NKF made on the Xenocide boards about how chunks of his Windows registry got embedded in his save files.

- Bomb Bloke


If the Mission and Kill Counts are both two bytes long in SOLDIER.DAT, shouldn't it stand to reason that they both are in unitref? --Danial 19:19, 12 Oct 2005 (PDT)


Is it possible that unitref[48] is width? It is grouped with height and kneeling height, so it would make sense. --Danial 19:19, 12 Oct 2005 (PDT)


I've checked all of my Snakeman missions and they definately have both [49] and [50] values of 18. Hobbes uses XCOMUTIL, right? Perhaps this changes some values? --Danial 19:19, 12 Oct 2005 (PDT)


Right, I just checked Missions and Kills by hacking value in geoscape SOLDIER to > 255, then went on a mission ... the hacked values were reflected as a two-byte value in Unitref in expected places, and then made it back to geoscape after mission end, with increased values due to mission. They ARE signed FWIW, because you actually get a negative mission or kill count in soldier stat display screen, if highest (16th) bit is set. (Is there any way to see them in the game, in combat?) I doubt the programmers 'meant' anything by them being signed; they just grabbed a two-byte data type... who's ever gonna get anywhere near that high? I'll edit the wiki DATs... hey, my .HSL isn't signed for those integers, hehe!

That works for me, U[48] being width... makes a lot of sense, looking at the data. Good call! Maybe it makes the "bullet trajectory" more certain to hit wide things? (If it's down low enough??) XCOM doesn't actually do any 3D surface modelling or whatever to check that bullets hit, does it? If not, "width" isn't a bad approximation for "can't miss that big fat thing". If true, it could be yet another 'hidden' stat for the wiki, like you did with Height. Notice how [52] seems to be exactly the same as [48]... that's a head scratcher. Maybe they were in Weight Watchers and really concerned about their waist size?? j/k

Okeydoke on the Snakeman height. Let me (or somebody else) check it in a "natural" game before we worry about it. May take me a little while. FWIW I've dropped Hobbes an email asking if he can comment re: what BB said, but I don't know if he'll answer, shrug. I mentioned the garbage in some of the fields to BB because I hope none of the other stuff I saw and posted into the wiki is garbage... really hard to tell with bitfields whose purpose is unknown. I will rely on whatever you pros here think, in regard to whether the bit values from his game should be pulled from the wiki. We could always "archive" (i.e. paste) the whole current wiki page (with Hobbes stuff) to an "archive page" that we just reference under a "See Also" link and pull it from the main page. So that it's still around if we ever realize we want it back. Whatever you pros think; I'm a newbie to Unitref for now.

How do the folks working on Unitref like the format I put the bitfields in? Makes it easier to read, don't you think?

--MikeTheRed 20:57, 12 Oct 2005 (PDT)


I wonder, will height values of 0 have any effect on your bullets?

I'm also wondering if it's just an offset to tell the game where the unit's bullet should appear from. Probably not, but I thought I'd mention it anyway.

- NKF


Danial, it just occurred to me that Soldier Value is based on a two-byte field, and it's two bytes in SOLDIER... but it's only one byte in Unitref. Go figure.

Sounds interesting, NKF. For that matter, Danial's possible "width" field could be tried, too. Maybe "width" is just modeled as e.g. a cylinder (square?) out from center of tile... so it's easy to miss sectoids if you only clip the edge of a tile, but not a tank. But then... does the game use [48] or [52] or both for "width"?

--MikeTheRed 23:22, 12 Oct 2005 (PDT)


I already knew there was a two byte kill count variable (thanks to NKF), but the mission count was news to me. w00t! Two more bytes accounted for! Only 31 to go! :D

I'll mess around with the height stats when I get a chance, do some tests. If there really is a 'float' stat (how far a unit is above the ground), then we've found something really new! Let alone width! Oooh, so tempting!... But I have to go back to work now. :(

- Bomb Bloke


Perhaps the first value is width and the second value is depth or something? They might have been planning to have non-square units at some point.

BB, if there is a 'float' height value, then wouldn't the Celatid be the only one with a value other than 0?