Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Quick Reply
Search this Thread
Field Researcher
Original Poster
#1 Old 12th Apr 2006 at 5:01 AM Last edited by syberspunk : 18th Aug 2006 at 6:25 PM.
Default Help Needed with 'Too many iterations' errors
As I understand it, 'too many iterations' usually occur due to lengthy loops such as searching through a neighborhood with a large number of sims, or through a sim's inventory with a large number of tokens or memories.

However... in a mod that I am testing, I am getting a 'tmi' error when there doesn't appear to be a loop that is being run through, at least not within the BHAV itself that I've modified. There is a loop within the BHAV, but it seems to be failing before it even gets to that loop. :confused:

I will quote the code and attach an error log if anyone would care to take a look at this. I have been playtesting with this for awhile now, and it had seemed to work on dorms, but when I was in Pleasantview in the Pleasant residence, a visitor (Dustin Broke) got stuck on this error until I deleted him.

The purpose of the mod is to enable autonomous interaction with computers for certain situations. I had discovered an unfinished interaction 'Watch Play-in' and I have enabled it. The interaction itself sort of works. The error here is on the Test BHAV.

The only thing I can think of is possibly that the processor keeps forcing Dustin to run this Test BHAV because of advertisement (which admittedly, I know nothing about)? Any thoughts or suggestions on how I can debug/fix this would be greatly appreciated. Thanks

Here is the Test BHAV:

Quote:
###
# Group = 0x7F441294, Instance = 0x2027
# Title = Interaction - Watch Play-in - TEST
#
# Format = 8007, Params = 1, Locals = 2
# Tree type = 0, Header flag = 0, Tree version = FFFF8008 (-32760)

0: semiglobal.0x200F; true: 1, false: false
1: Alter Budget: test if Const 0x2001:0x0 may be subtracted as misc expense; true: 2, false: false
2: Param 0 == 0; true: true, false: 3
3: my person data Person Type (0x20) == Const 0x104(Person Types):0x0; true: 4, false: 6
4: my person data Personality Playful (0x5) >= 800 (0x320); true: 12, false: 5
5: my person data Aspiration (0x2E) Flag Set? Const 0x13E(Aspirations):0x1; true: 12, false: false
6: my person data Person Type (0x20) == Const 0x104(Person Types):0x1; true: 7, false: D
7: Lot - Is Dorm? - EP1; true: 8, false: A
8: My Attribute 0x0 == Const 0x10F(Visitor Types and Status):0x3; true: 9, false: false
9: College - Have Key?(my person data neighbor id (0x1F), Global(Current House), -1 (0xFFFF)); true: 4, false: false
A: Lot - Is College Lot? - EP1; true: B, false: D
B: My Attribute 0x0 == Const 0x10F(Visitor Types and Status):0x1; true: 4, false: C
C: My Attribute 0x0 == Const 0x10F(Visitor Types and Status):0x3; true: 4, false: D
D: Lot - Is Location?; true: E, false: 10
E: Lua: Global - "[STR# 0x130:0x23]", defined in objLua file, Passing in params where param 0 = Global(Current House), param 1 = 0, param 2 = 0; true: F, false: 4
F: Business - Shop is Open?(Global(Current House)); true: 4, false: false
10: Lot - Is Liveable?; true: 11, false: 4
11: Lua: Global - "[STR# 0x130:0x23]", defined in objLua file, Passing in params where param 0 = Global(Current House), param 1 = 0, param 2 = 0; true: F, false: C
12: my person data Personality Outgoing (0x6) < 300 (0x12C); true: 14, false: 13
13: my person data Personality Outgoing (0x6) >= 800 (0x320); true: true, false: false
14: Local 0 := Stack Object; true: 15, false: error
15: Local 1 := My room (0x1D); true: 16, false: error
16: Stack Object := 0; true: 17, false: error
17: Set to Next: person; true: 18, false: true
18: Stack Object's room (0x1D) == Local 1; true: 19, false: 17
19: Stack Object == Me; true: 17, false: false


The changes I made was to enable the interaction, and yet limit it somewhat based on personality, location, and sim type.

Here is the beginning of the error log:

Quote:
Object id: 193
name: N001_User00009 - Dustin
Stack size: 7
Error: Too many iterations.
Iterations: 100000
Frame 6:
Stack Object id: 891
Stack Object name: Computer - Cheap
Node: 0
Tree: id 477 name 'Lot - Is Location?' version -32760
from global
Prim state: 0
Params: Locals:
Frame 5:
Stack Object id: 891
Stack Object name: Computer - Cheap
Node: 13
Tree: id 8231 name 'Interaction - Watch Play-in - TEST' version -32760
from ComputerGlobals
Prim state: 0
Params: 1 Locals: 0 0
Frame 4:
Stack Object id: 0
Node: 0
Tree: id -1 name 'No behavior' version 0
from
Prim state: 1
Params: Locals:
Frame 3:
Stack Object id: 116
Stack Object name: N001_User00004 - Daniel
Node: 17
Tree: id 8233 name 'Function - Main - Process Autonomy' version 56
from PersonGlobals
Prim state: 0
Params: Locals: 0 0
Frame 2:
Stack Object id: 193
Stack Object name: N001_User00009 - Dustin
Node: 6
Tree: id 8283 name 'Function - Main - Loop' version 96
from PersonGlobals
Prim state: 0
Params: 0 20 1 Locals: 0
Frame 1:
Stack Object id: 193
Stack Object name: N001_User00009 - Dustin
Node: 6
Tree: id 8193 name 'Function - Main' version 102
from PersonGlobals
Prim state: 0
Params: Locals: 1 20 0
Frame 0:
Stack Object id: 193
Stack Object name: N001_User00009 - Dustin
Node: 1
Tree: id 4096 name 'Function - Main' version 2
from TemplatePerson
Prim state: 0
Params: Locals:


The error log will also be attached in case anyone needs/wants to look at the persondata or other variables.

Ste
Attached files:
File Type: zip  ObjectError_N001_t59823.zip (15.6 KB, 22 downloads)
Advertisement
Retired Duck
retired moderator
#2 Old 12th Apr 2006 at 9:45 AM
Just as a wild stab in the dark, have you tried adding an "idle(1)" command in directly before "A: Lot - Is College Lot? - EP1". I'd try it out myself, but I don't want to type in all that code. I can't give you a real reason why it would fix your problem, except that I've had problems like it in the past and this often fixes it.

I'm not certain, but it could be that the TMI error is a poor-man's iteration check - that is, it just counts the number of primitives run without a sleep/idle being called. If that's the case, then having a very long or intertwined piece of code, even if it doesn't have an infinite loop in it, could result in a TMI.

I'm afraid that's about the best I can come up with. Shrug. Best of luck with it!
Field Researcher
Original Poster
#3 Old 12th Apr 2006 at 6:45 PM
Thanks for the suggestiong Echo. I'll try that. I actually considered this, and wasn't sure if and why it might work. I was under the impression that an Idle() call might work because, as I understand/interpret it, an idle call would cause the processor to idle for x ticks (my guess is x being the parameter). But I wasn't sure if the Idle itself is considered an iteration as well?

However, I have seen BHAVs that are 128 lines or longer, without Idle() in them, and haven't had a problem with those... :confused: Well, it might be that other BHAVs called from within them have Idle() calls themselves.

And the thing about this particular BHAV is that it is a test BHAV, which is reasonably short (26 lines). And it seems odd that a Test would need an Idle() in it. I would think that normally the interaction itself would have an Idle(). :shrug: But I guess I'll try it and see what happens.

Ste
Back to top