View Issue Details

IDProjectCategoryView StatusLast Update
0000484FSSCPFREDpublic2006-03-02 02:45
Reporterkarajorma Assigned ToGoober5000  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Summary0000484: Non-random behavoiour in the random-of SEXP
DescriptionWhen using the random-of SEXP with a list of 5 items the 5th appears to get choosen less often than the other 4. In addition when used with a repeating when-argument SEXP the randomly choosen ship changes between repeats.
Additional InformationMore infomation and sample missions are available in this thread on HLP

http://dynamic.gamespy.com/~freespace/forums/showthread.php?s=&threadid=33786

updated link:
http://www.hard-light.net/forums/index.php/topic,33786.0.html
TagsNo tags attached.

Activities

taylor

2005-11-18 04:26

administrator   ~0003883

Since search isn't working you on the new site can you track down the original thread and post a link here?

Goober5000

2005-11-18 04:46

administrator   ~0003884

You're really on a roll, aren't you. ;)

http://www.hard-light.net/forums/index.php/topic,33786.0.html

As a general rule, to convert from an old thread to a new thread, just replace the number in the above link with the number in the threadID from the vB link. :)

P.S. Have you committed the repeat-count fixes yet? :p

taylor

2005-11-18 09:09

administrator   ~0003885

Ah cool, thanks. I think I fixed this while HLP was down but I wanted be sure what I was seeing was actually what it was supposed to be doing, and from your comment in that thread it is. I was under the impression there was a test mission in that thread but I don't see one. Looks like there should be one in the last post but the link is missing. I'll just have to make something to test with myself and if it did get fixed I'll commit.


"P.S. Have you committed the repeat-count fixes yet?"

Nope, found a bug. A couple actually. Nothing big but from the bugs that keep getting reported to me, it's minor in comparrison, so I haven't worked on it any more. I'll try and get it finished and in CVS later today.

Goober5000

2005-11-18 15:44

administrator   ~0003886

There were a couple test missions in that thread, but they were attachments... and the attachments got lost when we switched boards. :(

I've ICQ'd karajorma to re-upload his missions to Mantis.

2005-11-18 17:59

 

2005-11-18 18:00

 

karajorma

2005-11-18 18:04

administrator   ~0003887

Last edited: 2005-11-18 18:04

If I remember how this went Bosch should sing about there being 5 bottles of beer as often as any other number. As it was he only sang about it once in a blue moon.

Anyway I've re-uploaded the mission for you.

edited on: 11-18-05 13:04

karajorma

2006-03-01 19:58

administrator   ~0005007

Fixed.

A value was being set in sexp[].value rather than sexp[].flags Why this was causing the last option to be picked less is beyond me but when I fixed the lack of persistance that bug died as well.

Goober5000

2006-03-01 21:07

administrator   ~0005010

Last edited: 2006-03-01 21:08

Actually, I don't think this is fixed. :p I just noticed that random-of calls rand_internal for each iteration of the loop. And since C/C++ recalculates the loop limit on each iteration of the loop (something I didn't realize before) this results in the loop upper limit continually being changed. As a result the odds of getting the last entry in the list decrease the longer the list is. :p

I'll fix this when I get home tonight.

edited on: 03-01-06 16:08

Goober5000

2006-03-02 02:45

administrator   ~0005014

K, that's fixed.

Goober5000

2006-03-02 02:45

administrator   ~0005015

Everything should work now. :)

Issue History

Date Modified Username Field Change
2005-07-24 16:10 karajorma New Issue
2005-07-24 19:39 Goober5000 Status new => assigned
2005-07-24 19:39 Goober5000 Assigned To => Goober5000
2005-11-18 04:26 taylor Note Added: 0003883
2005-11-18 04:46 Goober5000 Note Added: 0003884
2005-11-18 04:46 Goober5000 Additional Information Updated
2005-11-18 09:09 taylor Note Added: 0003885
2005-11-18 15:44 Goober5000 Note Added: 0003886
2005-11-18 17:59 karajorma File Added: Bug Test 01 - Random Of.fs2
2005-11-18 18:00 karajorma File Added: Bug Test 02 - Random Of.fs2
2005-11-18 18:04 karajorma Note Added: 0003887
2005-11-18 18:04 karajorma Note Edited: 0003887
2006-03-01 18:22 karajorma Assigned To Goober5000 => karajorma
2006-03-01 19:58 karajorma Status assigned => resolved
2006-03-01 19:58 karajorma Resolution open => fixed
2006-03-01 19:58 karajorma Note Added: 0005007
2006-03-01 21:07 Goober5000 Status resolved => feedback
2006-03-01 21:07 Goober5000 Resolution fixed => reopened
2006-03-01 21:07 Goober5000 Note Added: 0005010
2006-03-01 21:08 Goober5000 Note Edited: 0005010
2006-03-01 21:08 Goober5000 Note Edited: 0005010
2006-03-02 02:45 Goober5000 Note Added: 0005014
2006-03-02 02:45 Goober5000 Status feedback => resolved
2006-03-02 02:45 Goober5000 Resolution reopened => fixed
2006-03-02 02:45 Goober5000 Assigned To karajorma => Goober5000
2006-03-02 02:45 Goober5000 Note Added: 0005015