Replies: 9 (Who?), Viewed: 401 times.
Test Subject
Original Poster
#1 Old 20th Jul 2022 at 6:26 PM
Trying to understand how a TV clip is chosen to be played when TV is turned on
Hello fellow TS2 modder community,

I use replacement clips for all of the TV channels in my game and am trying to get behind an issue that has been bugging me for weeks.
I have been observing that the TV clips are not being played randomly as they should be, but instead, one or two TV clips are always favoured over the others.
Say I have clips named A through J in my Movies\Broadcast folder, I find that clip H would usually play first when a Sim turns the TV on.

My understanding of what happens when a Sim turns a TV on is as follows:
Sim uses a remote to turn the TV on -> TV light is turned on -> channel to watch is randomly picked, being a number between 0 and the total channel count -> channel is switched to the picked random channel.

Finally, in the BHAV "Channel - Switch To Channel", a "Change Material" operation is performed, which I think just connects the picked random number to the TV channel's material name (like "tvstation_sbn"...
But what happens then? Which function, that I am obviously missing, picks the actual clip to be played? How will I know whether Sims get to see a news report on a volcano outbreak, or a talkshow? And what about it could be flawed to cause the same clip to be picked over and over when the TV station is tuned to...?

Just like my "good gamer" mod, I know this may just be a pet peeve, but one that really drives me insane as I do enjoy watching TV whenever my Sims do, and enjoying the silly memes I put on the TV channels...
I would appreciate any help that eventually leads me to the root of the issue at hand.

Thanks in advance,
LimeyYoshi
Advertisement
Test Subject
Original Poster
#2 Old 19th Nov 2022 at 11:01 PM
Update from my end:
The TV clip thing is still an unresolved issue for me... however, I have since actually went ahead and renamed all the clips to neutral names (1.avi, 2.avi, 3.avi and so on), and have found something possibly interesting.

The clip called 1.avi is always played first on a given channel in a game session, meaning that if the game is closed and opened again, 1.avi is the first clip to play on that same TV channel again.
If it is present in the folder, I have found that 21.avi always follows after 1.avi.
After that, the clips seem to be randomised fairly well, but this is exactly the oddity that I am still looking to fix, and that I am still stumped about.

What I also found is that this issue does not happen with the ad breaks in between clips.
Mad Poster
#3 Old 20th Nov 2022 at 11:22 AM Last edited by simmer22 : 20th Nov 2022 at 11:36 AM.
Quote:
Originally Posted by LimeyYoshi
If it is present in the folder, I have found that 21.avi always follows after 1.avi.
After that, the clips seem to be randomised fairly well, but this is exactly the oddity that I am still looking to fix, and that I am still stumped about.


It's probably because the game sees the numbers a bit different.

Occasionally you get this weird, disorganized counting like 1, 10-19, 2, 20-29, 3, 4, 5, etc. (depends a bit how the rest of the file is named)

If you want to make sure the 1, 2, 3 comes in order, especially if you have higher numbers than 9, try writing the smaller numbers as 01, 02, 03, etc.. The 0 in front makes the game correctly count them as the lower numbers, instead of bunching them in with the 10s, 20s and 30s, etc.

01-09, 10-19, 20-29, etc.

If you want to name them in a 1.1, 1.2, 2.1, 2.2 order, but without the punctuation, make sure you use 2 digits for all the files so they appear in the correct order, or you can use letters instead (1a, 1b, 2a, 2b).
Test Subject
Original Poster
#4 Old 20th Nov 2022 at 9:19 PM
Hmmm... What you are saying makes sense, but it sort of clashes with my previous perception of how TV's in Sims 2 work. Is the clip selection not random at all, then? Because that's what I am aiming for.
Sure, it shouldn't be the case that 21.avi follows after 1.avi - but to me, it's little use if I get 02.avi to correctly follow after 01.avi instead. I want the selection to be random in the first place, and not have it follow a set order. It's not doing that though, and I wish I knew why.
Mad Poster
#5 Old 21st Nov 2022 at 12:04 AM
I don't know if the order they play is random, that could very well be. How many clips do you have in the folder? True randomizing can seem very not-random, especially if you have just a few clips (like when your sims get 7 boys and then one girl, or when the same animation out of a pool of 3-4 plays several times in a row).

Could be worth testing if it's the numbering it follows, or if it's randomized.
Just east of Lyra, northwest of Pegasus
retired moderator
#6 Old 21st Nov 2022 at 12:28 AM
Quote:
Originally Posted by LimeyYoshi
The clip called 1.avi is always played first on a given channel in a game session, meaning that if the game is closed and opened again, 1.avi is the first clip to play on that same TV channel again.
If it is present in the folder, I have found that 21.avi always follows after 1.avi.
After that, the clips seem to be randomised fairly well, but this is exactly the oddity that I am still looking to fix, and that I am still stumped about.

What I also found is that this issue does not happen with the ad breaks in between clips.


How are you testing this exactly? In a modded game/ unmodded game? Are you booting the game, loading the lot and having them turn the TV on immediately? These things might be relevant, because we know that most of the game's randomisers are not randomly seeded.
https://modthesims.info/showthread....122#post5095122
Mootilda discovered that the sex randomiser is truly random but some of the others are not.
She also said that BHAVs have access to only one random number generator and that generator is not properly seeded.
So maybe the clip choosing happens to be affected by this.
Of course I could be wrong, but a way to check this would be to randomise the generator, either by using the batbox, rolling the pacidier or using LazyDuchess' fix. Just an idea!
Test Subject
Original Poster
#7 Old 21st Nov 2022 at 2:19 AM
Quote:
Originally Posted by simmer22
How many clips do you have in the folder? True randomizing can seem very not-random, especially if you have just a few clips...

Quote:
Originally Posted by simsample
How are you testing this exactly? In a modded game/ unmodded game? Are you booting the game, loading the lot and having them turn the TV on immediately?


I don't have the same amount of clips on each channel, so it varies, but on SimStation Dance, which my Sims often watch so I vividly remember always seeing the same clip there, I currently have 24 clips that the game can pick from.

In my main - heavily modded and CC'd - game, the game always picks 1.avi from the Movies\Broadcast folder to be played as the first clip. I am using LazyDuchess' RPC launcher which does fix the first-born syndrome, but doesn't do anything about whatever randomiser the TV uses. However, whether I use Sims2RPC or the standard Sims2EP9 exe file makes no difference, from my testing.
The game also picks 1.avi if I use the Batbox before my Sims can watch TV at all.

Also, I have dug out my old AnyGame1 that has all EP's and SP's up to BV, which is entirely vanilla. Just as it happens, same issue there. Whenever I tune into KidzTube, it's always the robot clip being played first.
Just east of Lyra, northwest of Pegasus
retired moderator
#8 Old 21st Nov 2022 at 1:26 PM
Really interesting, the clip selection must be chosen in some other way then (or else affected by a different randomiser). I have a custom channel I made and that's the same.
Lab Assistant
#9 Old 21st Nov 2022 at 10:02 PM
That's interesting, I'd think that RPC would fix that but I guess not, I think it's likely hardcoded and an unseeded random number generator I didn't pick up on when making the FBS fix, as I did address as many as I could find, including the BHAV one.

That does mean that there's likely nothing you can do about it without disassembling the game's executable memory.
Test Subject
Original Poster
#10 Old 24th Nov 2022 at 7:01 PM
Quote:
Originally Posted by LazyDuchess
That does mean that there's likely nothing you can do about it without disassembling the game's executable memory.

I have literally zero experience in this matter, but I just downloaded a decompiler and will see how far I get. If I report back, that means I found something. If not, then I'm probably still stumped as to how the application works. XD

Either way this would mean making changes to the EXE as a whole, which I am definitely not capable of. ^^;
Back to top