Difference between revisions of "Talk:UNITREF.DAT"

From UFOpaedia
Jump to navigation Jump to search
Line 147: Line 147:
  
 
- Bomb Bloke
 
- Bomb Bloke
 +
 +
----
 +
First of all, it was ''my'' table :P<br>
 +
<br>
 +
And second, why would they have given civilians a Hover value? What purpose could that possibly serve?

Revision as of 08:45, 15 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?

- Danial


Hovertanks and floaters 'fly' too. Etherals might also fly. And I wouldn't put it past the developers to make other aliens 'fly' simply to make them harder targets.

It's just a theory at this stage.

- Bomb Bloke


If we have Height [49] AND "Float" [51], then their "real" height (in terms of profile you can hit) might be Height-Float. Combined with this potential Width ([48] and/or [52]) defines a cross-sectional target area a.k.a. percent of the space of a tile that they occupy, seen from the 'side'. If it does work this way, it's Area1 here:

               [49] [51] "Tall" [48]        | [49] [48]    
  Class         Ht.  Flt   H-F  Wide Area1  |  Ht. Wide Area2    Area1=(Ht.-Flt.)*Wide
  ---------     ---  ---  ----  ---- -----  |  --- ---- -----
  Sectoid       16    0    16    2    32    |   16   2    32     Area2=Ht.*Wide
  Celatid       12    6     6    3    18    |   12   3    36
  Hovertank*    12    6     6    4    24    |   12   4    48     Sorted on Area2
  Silacoid      10    0    10    5    50    |   10   5    50 
  Snakeman      18    0    18    3    54    |   18   3    54 
  Cyberdisc     15    2    13    4    52    |   15   4    60
  Ethereal      20    0    20    3    60    |   20   3    60    All Hover/Tanks in their
  Chryssalid    21    0    21    3    63    |   21   3    63    class assumed to be same
  Civilian      21    2    19    3    57    |   21   3    63    altho not tested yet
  Floater       21    2    19    3    57    |   21   3    63
  Muton         21    0    21    3    63    |   21   3    63
  Tank*         16    0    16    4    64    |   16   4    64
  Soldier       22    0    22    3    66    |   22   3    66
  Reaper        23    0    23    4    92    |   23   4    92
  Sectopod      23    0    23    4    92    |   23   4    92
  Zombie        18    0    18    3    54    |   18   3    54

With Area1, Hovertanks would be thin as a pancake!! So instead I tried simply Height x Width, shown in Area2. Much better. IOW, if a full tile is 24 "high", as Danial estimated, the Celatid starts at 6 and goes to 18 (6+12). Also note that with Area2, Civvies and Floaters add up to 23, the highest value seen for others. (And Dan - if counting starts at 0, you were right on the money with the 24!! Then again maybe they avoid 24 just to steer clear of ceiling collisions. Anyway.)

This whole concept could be roughly tested with some shooting... but it'd need a lot of repetitious work. I recommend very good accuracy (hacked soldier, best weapon; simply reduces # tests needed), fair distance so anything that's calc'd to miss really will, and then use ammo counts vs. experience counter to get percent hits entirely accurately. Choose some of the targets with extreme values (width, "float", area). Then kill them a TON of times, lol. Unfortunately, you can only use Exp. Ctr. for un-MC'd aliens, so no testing of tanks. I wonder what Cyberdisc's numbers are? But they can't be disarmed, wah. Actually anything Large shouldn't be used because you may hit other quarters, which would mess with comparing percents. Possibly even if you just compared large to large.

Another unanswered question is, if [48] and/or [52] is "width", HOW is it width? A scaler for "percent chance of hit", max 5, so Sectoid is 40%? Or they could've used cylindrical or square (actually cubic) percent-chance lookup tables or even actual "3D" models. (With such a simple geometry, it's conceivably do-able for them.) Hey - I wonder whether there are similar values for the scenery (trees etc.)... they get hit too... wth would these values look like for them, if so?

Hold the phone... great point, NKF ... hacking some or all of these four bytes to 0 (or something real high!) may tell us tons within a few shots. Or maybe even just by looking at'em! I personally am not interested in this ATM so if BB or somebody else wants to test, go for it. (Don't forget, [52] and [48] seem to be identical, so one might be unused.)

We could really use a (hacked/XCOMUTIL?) save game with ALL the different aliens, tanks, and soldiers vs. 4 armor types. Zombies too, wth. I count 22 types total. Multiples of each, to bring out "personal" vs. "class" bytes and bits. Disarmed if possible, so they don't kill all civs and soldiers by turn 2, laugh. Can't 80 units fit into a combat? if somebody makes this, pls. avoid the potential problem BB talked about re: Hobbes game (whatever it was!). Would this take forever or can anyone do this for us? Post as another Unitref Note, if you make one. I personally WOULD be interested in pulling data from this and posting it, like I did for Hobbes... I just got Unitref to where I can suck it in automatedly and query it; that's how I pulled his stuff so fast. And/or send me other savegames you'd like me to pull stats from! I like to play with data. (But don't necessarily like the endless repetition of in-game testing to get it!)

Anybody let me know if they want me to write a little applet where e.g. you press a button and it shows you the Experience Counters (or anything else) for a savegame. It wouldn't keep it locked. Thus you could move faster with e.g. shooting tests. I *think* I can do this in VBA and package it so you don't need MS Access... haven't tried before... so you may need Access. Anyway let me know if anyone's interested and I'll look into it.

Speaking of which, can somebody sooner or later post something re: the structure of the other XCOM savegame files? Currently I'm esp. interested in being able to hack weapons etc. into an existing game. But have no idea where/how that's stored.

Ethereals can fly... MC one and you'll see, although I can't recall seeing them fly of their own will. BUT they do have a 0 in [51].

- MikeTheRed

Ooooops! Accidentally pasted over all old notes - forgot this wasn't sectioned - just put old notes back - ignore the weirdness in History!


Interesting note for the day: the position of the yellow arrow denoting the selected unit is affected by the units' height. Thus far, using this stat alone has placed the arrow in the correct place (in my mapviewer) for most units, but not celatids and other flyers - the arrow ends up to low.

This, to me, means that the unit's height statistic is absolute, and to find where the top of a unit is relative to the ground, you use height + float (as opposed to just height).

Edit: Yup, using offset[51] as 'float' places the yellow arrow perfectly for all units! It's official, each unit has a 'distance from the ground' stat!

This means the Civilians float above the ground. I double checked. Clearly they are high on illegal substances or something.

By the way, I've taken the liberty of tweaking your table, Mike. I'm still not convinced offset[52] is width, even if it is specific to unit type... But certainly well worth recording all possible values.

- Bomb Bloke


First of all, it was my table :P

And second, why would they have given civilians a Hover value? What purpose could that possibly serve?