SO tell me how did I manage to break the game to this extent using CRPL?

Started by pawel345, December 11, 2013, 02:27:06 PM

Previous topic - Next topic

pawel345

OK so here is the problem, I can start the map just fine, no lag, my CN lands, I place collectors to be build, time folows....and nothing happens, no packets are send, the dust form CN drop doesn't disappear, the game just doesn't work, But I can still place collectors or other structures, change between tabs and so on, the game behaves as paused but the time flows.

Here is the map and some of the scripts. The CommandNode script seems like the only one in use at that time.

It's not a pressing issue, more like a curiosity I wanted to report.

eduran

The only way I managed to produce a behavior like that is by accessing loop variables (i, j, k) outside of loops. You might want to check for that.

knucracker

Looking at the map in my debugger, I see that you are calling RemoveListElement for an invalid index on some list.  Now, I should protect against a run time exception when this happens (just fixed it) so you should not see any oddball problems with the game as a result of this.  The next build will have this fixed.  However, it is also most likely indicative of a problem somewhere in the CRPL you have if you are trying to remove a nonexistent element from a list.

Grayzzur

Yup. pawel345 is trying to remove an element from an empty list, but it creates an infinite loop internal to the game.

Virgil's so good, he fixed the issue as soon as I merely decided a bug report needed to be filed!

If anyone else wants to see what's happening without digging through pawel345's code, this reproduces the bug nicely.

once
ShowTraceLog
ClearTraceLog

CreateList ->testList
endonce

"GetUpdateCount: " GetUpdateCount Trace2

<-testList 0 RemoveListElement

Note you get "GetUpdateCount: 1" followed by and endless stream of warning messages from the REMOVELISTELEMENT call. The odd thing is that the time counter keeps flowing even though we don't ever seem to get into the next frame.
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

pawel345

Yes I knew that the problem was in CPRL although I didn't know where, so thanks for telling me that. I wanted to report it as it had an unexpected impact on the gameplay.