The online racing simulator
Bad Apple in LFS -- Some April 1st (Class) Foolery
Read readme.txt pls.

What program can do:



If you got trouble reading readme.txt:


CHANGELOG:
Quote :

0.2.0:
- cleaned-up the nasty source a bit,
- new frame synchronisation mechanism -- invalidated -r param by a lot,
- bandwith saver - now program will only send update request to buttons which text actually changed,
- added -t and -s optional params -- equivalents of ffmpeg preinput -ss option and postinput -t, one skips forward the selected video, the other sets duration of playback.
- added versioning -- 0.1.0 didn't displayed it because I haven't expected to work on it further. But yet, the temptation was too strong...

0.1.9:
-- this is experimental colour version, which is abandoned due to unsufficient results vs. resources required to improve upon it. It's actually downstream from 0.2.0 version btw.


Okay, will just dump readme here too:
Quote :
CAUTION: USE THIS SOFTWARE AT YOUR OWN RISK, I"M NOT ELIGABLE FOR ANY DAMAGES

Incomplete source code included, but it's messy and all, cuz it's just a Aprill Fools project.

LFS InSim video player...

Requires ffmpeg to function properly, and optiononaly ffplay, both findable on official site, as of time of writing: https://ffmpeg.org/

Usage: bad_apple.exe [OPTIONS] --password <PASSWORD> --video <VIDEO_PATH>

Options:
-a, --insim-address <INSIM_ADDRESS>
Address to InSim protocol TCP IPv4 port

[default: 127.0.0.1:11000]

-p, --password <PASSWORD>
Password to lfs instance

-r, --rate <RATE>
Video playback rate.

This value now works so quirky, you just have to test your case.

[default: 30]

-f, --ffmpeg <FFMPEG_PATH>
Path to ffmpeg

[default: ffmpeg]

--ffplay <FFPLAY_PATH>
Path to ffplay.

If given, there's a chance sound will play along.

-v, --video <VIDEO_PATH>
Path to video.

Later on supplied to ffmpeg.

-s <S>
Skip forward video. FFmpeg time syntax.

The equivlaent of pre-input -ss ffmpeg param.

-t <T>
Duration of playback. FFmpeg time syntax.

The equivlaent of post-inputs -t ffmpeg param.

--subpixels <CHARACTER/S> <CHARACTER/S> <CHARACTER/S> <CHARACTER/S>
Determines display outlook.

More specificly, how the grayscaled picture pixels will translate to button text.

From lowest luminace to highest.

[default: ^0_ ^3_ ^6_ ^7_]

--delay <microseconds>
Optional delay between program start and playback start.

Applicable if you're afraid that you won't ALT+TAB fast enought to see show right as it starts.

-h, --help
Print help (see a summary with '-h')

-V, --version
Print version


Yeah, overdone joke.
Attached files
lfs_bad_apple.zip - 336.2 KB - 137 views
bad_apple_v2.zip - 683.9 KB - 87 views
Nice, I wanted to try Bad Apple in LFS using modded "vehicles" with lights for pixels, but then realized you could only control the local car's lights with this, so the only way I can hope to do something half-decent would be to have 40 people running some "pixels" in sync.
Never thought about using InSim buttons, this looks quite good! Maybe using filled rectangles instead of underscores would make it better?
Yeah, finding 40 people to run your code would be challanging of sort. Some square characters would require me to enter some diffrent page encoding on each horizontal line, which I kind of tried to avoid. You can always custom them, however, I found the gaps between pixel dots to be better, maybe cuz it's easier to fill in said gaps for our brain.
Over weekend freetime, something was tempting me to return to this joke. Experimented with adding render based on colour, but the results aren't as good and it's something I'll abandon. (well, overall, the program will be rather abandoned). The ~grayscale version worked good bcuz of the clever quantisation mechanic based on frame avarges, which I won't recreate with colours, bcuz that would be too much resource costly to make given what this program genesis. Also even with current implementation it requires loottt of tuning, which you can do manually by editing the source code, I myself haven't tuned it that well. You can see the results with the updated video section on top of this post!
I used the new AI control feature from version 0.7F2 to make this very important thing Big grin

I made a light strip object with 7 lights: rear fog, front fog, left indicator, extra light, right indicator, flash/high beam, and low beam (combined with side lights). I don't think it's possible to have more than these and retain independent control of individual lights (which is why I combined low beam and sidelights). Then I placed 20 of those objects to make a 14x10 screen, and animate the individual lights from the video.

It's a bit buggy right now, as fog lights and the extra light can only be toggled and not set on or off, and indicators have a fixed blinking pattern, which means they may be off when they should be on, so I have them turn off every 0.4s and the next video frame is supposed to turn them back on (I tried to synchronize with the music BPM). Plus I have a "loose pixel" issue where some of them get flipped at some random point.

I think I'll wait for 0.7F4 if Scawen does add the ability to specifically turn lights on/off, so I can fix my issue, and then post a video of the result. In the mean time, here's a screenshot of a random frame.
Attached images
LFS_bad_apple_test_4_snapshot_00:00:52.917_[2025.01.25_12.29.08].jpg
Scawen was quick to release 0.7F4, so I made the "final" version:

The indicators are blinking to the beat, 2 columns use flash and do have some blinking artifacts, and there seem to be some wrong pixels here and there, but I won't worry about this, my main objective is complete Big grin

FGED GREDG RDFGDR GSFDG