Check Tree (in)efficiency

<< < (2/3) > >>

tunaisafish:
Quote from: rufio on 2009 April 26, 02:03:56

Ah, thanks, I forgot about Temps.  Why is there a limit on four arguments, though?  Four arguments is only 8 operands, but in the editor you get 16.


The 16 Operands (bytes) are used by the 'node'.  They vary depending whether you ar calling a primitive or calling a function.  Some bytes will be used as flags, and some will be data.
When calling another bhav.  If the flags are set to pass 4 args, then 4*3bytes are needed as data.  Each arg is described with one byte showing the 'owner' (local, temp, param, literal, const, etc.), and 2 bytes for the offset (or value).

The '4 arg' and 'use temps' methods are the most common ones used in the game.  There is a way to pass 8 constants though in one node using only the operands - though it's not that useful.  There's an old thread on MTS2 you can use if you ever need that ability.  If you set the operands manually SimPE will tell you what you are actuallly passing.

Most of those 16 Operands have been worked out over the years by dozens of people, and there are still some unknowns.

Quote from: J. M. Pescado on 2009 April 26, 02:17:51

Interesting, there is a horrible bug which occurs if a function seems to use more than 8 arguments. This is what causes the Apartment Door Bug, that more than 8 arguments will not pass successfully...and it seems this bug is shared, either by intent or accident, with SimPE. Weird.


The only BHAV I've seen that use more than 8 args are called from Entry Points, (using the FFFF... Ops (aka pass temps)).
The args above param7 are consistent, but I couldn't figure out where they come from.

@Rufio, yeah I took a quick look at that lua, and wondered what the hell it had to do with relationships too.

ETA: Link to the 'more than 8 args' discussion at MTS2. http://www.modthesims2.com/showthread.php?t=306923

J. M. Pescado:
I haven't seen it. If you want to look at one that is broken, look at 208A in DoorGlobals. You know of one that passes more than 8 and actually works?

rufio:
Quote from: tunaisafish on 2009 April 26, 02:50:24

If the flags are set to pass 4 args, then 4*3bytes are needed as data.  Each arg is described with one byte showing the 'owner' (local, temp, param, literal, const, etc.), and 2 bytes for the offset (or value).

Oh right... duh.

Quote

@Rufio, yeah I took a quick look at that lua, and wondered what the hell it had to do with relationships too.

I had thought before that they might be something to do with the NIDs being misinterpreted as Object IDs, like the SOs that don't have anything to do with anything, but yeah.  :-\

tunaisafish:
@Pes, I don't know of any offhand.

The one you fixed is passing more than 8.  If it was passing zero's instead of the args then SimPE is doing a better job than Edith :)
If not, then something has changed since NL ~ it was about then that the flags causing "all zeros" to be passed was found.

That might be the Numenor was talking about.  Param 8 is labelled as 'moving foot' somewhere, then gets labelled in another (and used) as a boolean '[FBA/FFO?]'.
I think that param 8 is something to do with "Find Best Action/Find Functional O???", and it's only used to decide whether to display a thought bubble.  So if param 8 is still broke then it's not a biggie.

J. M. Pescado:
Quote from: tunaisafish on 2009 April 26, 04:17:52

The one you fixed is passing more than 8.  If it was passing zero's instead of the args then SimPE is doing a better job than Edith :)
If not, then something has changed since NL ~ it was about then that the flags causing "all zeros" to be passed was found.
It was passing zeroes. SimPE 68, the one I'm still using, also claims that this particular call is "passing zeroes". In fact, it will pass zeroes even if called using explicit 4-arg format, and 68 will still interpret this as "passing zeroes", which actually happens in the game, too, meaning the bug is shared between them. Since only the first arguments are even USED for anything, I changed the pass-format so that the relevant arguments would be properly passed.

Navigation

[0] Message Index

[#] Next page

[*] Previous page