More Awesome Than You!

The Bowels of Trogdor => The Small Intestines of Trogdor => Topic started by: Inge on 2006 October 21, 07:58:03



Title: New "54" format TTABs
Post by: Inge on 2006 October 21, 07:58:03
Peter is going to start updating PJSE today to accept format 54 TTABs.   To save some time though, has anyone here already deciphered their format and would share with us?


Title: Re: New "54" format TTABs
Post by: J. M. Pescado on 2006 October 21, 10:10:50
I haven't found anything. Not even sure what benefit they have over the oldstyle format, since I was able to retrofit a terlet to be pet-enabled just fine...
I would surmise they pointlessly scrambled things around just to be nuisances, like when they made the 8009s that they now use ubiquitously, despite the fact that there's no benefit to them except a field that is basically never used. Waste of space.


Title: Re: New "54" format TTABs
Post by: Inge on 2006 October 21, 10:23:23
Well it is already looking a bit stupid even before we've worked it out.  There are only 5 agegroup settings in it, and I think they stuck the animal stuff into a separate matrix.  But this theory could change...


Title: Re: New "54" format TTABs
Post by: Inge on 2006 October 21, 11:21:39
Oh, no it's not that bad after all.  What you do get with this format is a per-menu item count of agegroups for the motives matrix.  Those that were not intended to be autonomous now have zero agegroup count - ie no motive matrix at all.  That means for those formats, PJSE needs to offer another field for agegroup count, to enable you to populate the matrix if you want to make some options autonomous that Maxis had non-autonomous.

Later:  Pets interactions don't appear on the TTABs of the objects they use.  Dogs and Cats columns of the TTAB motives are not used - we think so far.

Later still:  Yes they do!!  Lol whoever made this menu format was having a very jolly time on something :D


Title: Re: New "54" format TTABs
Post by: Inge on 2006 October 21, 19:41:09
Where's my avatar gone?

Anyway this is the TTAB 54 info:

The 0x07 or 0x08 (at 0x4c) refers to number of entries in the menu in both formats

Each line has VARIES bytes starting from Action BHAV.  It used to be strictly 0x2EA in 4E format

Non-matrix data per line
------------------------
Format54 has has lost the 28 bytes that used to be the count of motive rows but has gained 8 bytes, comrised as follows: Just before the matrix data for each line is a 4-byte count of how many agegroups there are for the humans.  We have seen up to 5.  After the human matrix date there is a  group of 4 bytes saying how many animal agegroups or equivalent there are.  We have seen up to 8

Matrix data per line
--------------------

Human matrix
------------
Broken down by agegroup.  The first 4 bytes of the motiveperagegroup says how many motive lines are in the matrix - which is equivalent to the highest numbered motive dealt with.  The in between ones are padded with zeroes if not required.

Each field (min,typ,delt) is still 2 bytes.


Animal Matrix
-------------
Works pretty much like the human grid except there are an unknown 4 bytes after the motive count in each grouping.  Any ideas?



I was gonna write this up in the Wiki but it's all full of dword and float rubbish and I can't wtrite it like that.


Title: Re: New "54" format TTABs
Post by: dizzy on 2006 October 21, 20:01:40
8 animal age groups? I thought animals only had 3 max.


Title: Re: New "54" format TTABs
Post by: Inge on 2006 October 21, 20:06:02
As far as I am aware, as the game is played, there is kitten/puppy, adult, elder.   However, there are definitely at least 8 groupings similar to the column groups for human sim ages, which are populated with motives tests for "sit" on sofas.   We are not totally sure there won't be an example with more, although we're assuming it's highly unlikely.

Maybe cats and dogs have a separate set each, and perhaps one or two for wolves? or Werewolves?


Title: Re: New "54" format TTABs
Post by: dizzy on 2006 October 21, 20:10:03
Oh I see. That makes sense. The way it goes is most likely this:

Adult Dog, Elder Dog, Adult Small Dog, Elder Small Dog, Adult Cat, Elder Cat, Puppy, Kitten (not necessarily in that order)


Title: Re: New "54" format TTABs
Post by: Inge on 2006 October 21, 20:19:38
Ah yes, that fits


Title: Re: New "54" format TTABs
Post by: Inge on 2006 October 23, 10:04:57
Dizzy - you managed to work out this TTAB format yet?  We're stuck!


Title: Re: New "54" format TTABs
Post by: dizzy on 2006 October 23, 19:50:32
What are you stuck on?


Title: Re: New "54" format TTABs
Post by: Inge on 2006 October 23, 22:04:00
Well the human motive table for each line is fine, there are 4 bytes saying how many agegroups and then per agegroup 4 byte saying how many motives (which is always just up to the motive affected, and then it cuts off).  There are 6 bytes per motive for humans.   That all adds up right, then the animal motive table starts.   It has 4 bytes which usually has "8" in it - which ties in nicely with the number of age/species column groupings.  Then each agegroup has a 4-byte field which matches nicely with the motive we'd expect to be adderssed by that object.   After that it goes horribly wrong because there seem to be senseless and inconsistent numbers of bytes  per agegroup.   For example, relax on the condo does not have the same number of bytes per age/species group as relax on the pet bed.   We can't find a way to predict how many bytes there are to a menu line any longer.


Title: Re: New "54" format TTABs
Post by: dizzy on 2006 October 24, 00:51:15
/me makes a note to look into this more deeply

EDIT: FWIW here's a sorted dump file.


Title: Re: New "54" format TTABs
Post by: Inge on 2006 October 24, 08:56:42
Thanks I am taking a look at that now, though so far I haven't had a eureka moment...

A few hours later:  I've got the "eur" of eureka...   Thanks to this dump file and being able to move bits about to line them up and compare, something is emerging as a pattern.  :)


Title: Re: New "54" format TTABs
Post by: Inge on 2006 October 24, 12:03:48
This *could* be the "eka".   These start from after what would appear on the "settings" tab, which was too long to clutter this post with.   I have iterated once into each nest and another iteration would start from the next animal agegroup (at first tab depth)

0000 0000  no human agegroups
0800 0000  8 animal agegroups
   0F00 0000  animal motive count for first agegroup
      0000 0000
      0000 0000
      0000 0000
      0400 0000  four elements of 6 bytes in this motive
         0000 0000 0000 0000 0000 0000 0000 0000 0000 3200 0A00 1E00
      0000 0000
      0000 0000
      0000 0000
      0000 0000
      0000 0000
      0000 0000
      0000 0000
      0000 0000
      0000 0000
      0000 0000
      0400 0000  four elements of 6 bytes in this motive
         0000 0000 0000 0000 0000 0000 0000 0000 0000 2800 0500 1400


and

0000 0000  human agegroups
0800 0000  animal agegroups
   0200 0000  motive count for first animal agegroup
      0000 0000
      0500 0000  five elements of 6 bytes in this motive
         2D00 2300 2800 0000 0000 0000 0000 0000 0000 0000 0000 0000 FBFF 0500 0000


Assuming the above is accurate, we just need to know what the counted elements of the advert represent.   I suppose there must be training stuff in there as well as needs.


Title: Re: New "54" format TTABs
Post by: dizzy on 2006 October 24, 18:03:45
Could be some decay values cross-referenced or something like that.  :P

I'll just toss this bit of Lua code out and see what everybody thinks:

Code:
PetTraits = {}
PetTraits.Gifted = 1
PetTraits.Doofus = 2
PetTraits.Hyper = 3
PetTraits.Lazy = 4
PetTraits.Independant = 5
PetTraits.Friendly = 6
PetTraits.Aggressive = 7
PetTraits.Cowardly = 8
PetTraits.Pigpen = 9
PetTraits.Finicky = 10
PetDecayIndices = {PersonData["Decay Hunger per Day"], PersonData["Decay Comfort per Day"], PersonData["Decay Bladder per Day"], PersonData["Decay Energy per Day"], PersonData["Decay Hygiene per Day"], PersonData["Decay Social per Day"], PersonData["Decay Fun per Day"], PersonData["Decay Scratch-Chew per Day"]}


Title: Re: New "54" format TTABs
Post by: Inge on 2006 October 24, 18:10:40
We picked those up for the C7 flag fields ok.  But as far as the menu adverts are concerned those shouldn't need to take up any more data space than the personality types for the human ads - delta and type.  Anyway once we get those displaying ok in simpe, it will be easier for everyone to come up with ideas for what they mean.


Title: Re: New "54" format TTABs
Post by: dizzy on 2006 October 24, 18:11:45
Which will be soon, hopefully.  ;)


Title: Re: New "54" format TTABs
Post by: Inge on 2006 October 24, 18:27:39
The plugin is having to be completely rewritten to cope with flexible length data unfortunately.  We got spoilt by the many preceding formats all in fixed byte chunks.   In a little while I can release a version with the extra persondata etc in and a non-crashing TTAB 54 display - that only shows the header!   In a day or two there should be a working format 54 with editable human and readonly animal data.  Hopefully by the end of the weekend it will be read-write.  I said to Peter in future we'll book his holidays for when an EP is due out, but for now unfortunately he'll be short of time till the weekend.


Title: Re: New "54" format TTABs
Post by: Inge on 2006 October 24, 20:57:52
Well he got the debug version out a bit quicker than I thought.   You can't actually edit the animal motives on this version, but you can find out what they say at least without having to do a hexdump.   This version is only recommended for tech-heads or adventurous souls:  http://www.simlogical.com/externally_accessible/pjse.coder.plugin-Debug-20061024-2142.zip