[1.0] RimFlix - Custom TV Shows

Started by kagamisama, March 17, 2019, 04:25:25 AM

Previous topic - Next topic

kagamisama

Description:
RimFlix allows you to display custom images in televisions. Create a show from images in a local directory, set the seconds-between-images, and assign it to TVs. A show with random images and a 10 second interval will act like a slideshow. A show with animation frames and a 0.033 second interval will act like a 30 fps animation.

How to create a show

  • In settings, click the Create Show button.
  • Browse to a folder that contains images you want to include in your show. All images in the folder (*.png, *.jpg) will be added. You can click an image to see how it will look in game.
  • Enter a name for your show.
  • Enter a time interval between images.
  • Select the TVs you want your show to be played on.
  • Click Create Show, and you're done!

Settings
Default settings are the same as Rimworld vanilla settings and will have no impact on gameplay other than visuals.

  • Play shows when no pawns are watching: If enabled, TVs will play shows all the time, even when no pawns are watching. If disabled, TVs will only play shows when pawns are watching.

  • Seconds until pawns change shows: Pawns will change shows after watching the same show for this many seconds. TVs will have new options for allowing / disallowing pawns to change shows as well as allowing the player to select shows.

  • Power consumption when playing: Set the power consumption for TVs when a show is playing. 100% is the same as vanilla.

  • Power consumption when not playing: Set the power consumption for TVs when now shows are playing. 100% is the same as vanilla.

  • Resize images to TV screen using:
    Stretch: Images will be stretched to fit the screen, ignoring aspect ratio.
    Fit: Images will be resized as large as possible while staying within the screen's boundaries and keeping aspect ratio.

  • Adjust sreen size and position: Click the icon at the top of the Settings window to open a new window that allows you to change the size and position of what the mod considers the "screen area" for each TV type.

Artists and animators
You can create and share RimFlix shows as individual mods. No coding is required. You only need the image files and an XML file that defines each show. Here is an example. Other players can add your shows to their game as long as they have the RimFlix mod installed and placed above your show in the mod load order.

Author/Mod Team/Translators
Thanks to the many (mehni?) helpful people in the Rimworld Discord modding channel. Japanese translation by Proxyer. As for me, you can find me here, on Steam, and on GitHub.
If you would like to help translate the settings and menu options, please message me!

Screenshots
Play always or only when pawns are watching
Main settings window
Creating / adding a show
Adjusting screen size and position
New TV menu options

Download
Steam Workshop
GitHub Release

How to install:

  • Steam Workshop: Subscribe in Steam Workshop, then activate in the game's mod menu.
  • GitHub Release: Unzip contents in RimWorld/Mods folder, then activate in the game's mod menu.

License: GNU General Public License

SansMasterBudaa :3

It supports any format?? (.Jpg  .Png .Gif)

kagamisama

Quote from: SansMasterBudaa :3 on March 19, 2019, 08:37:11 PM
It supports any format?? (.Jpg  .Png .Gif)
It supports PNG and JPG.

(I should add that in the description, thanks for reminding me.)

togfox

#3
This is so cool. I'll see if I can provide some content.  :)

I haven't played with this yet - I see github has image sizes defined, have you tested what happens if mod images are slightly larger? They are simply scaled up or down? I guess my real question is, will images the wrong size break the mod/game?

kagamisama

#4
Quote from: togfox on March 19, 2019, 11:44:23 PM
This is so cool. I'll see if I can provide some content.  :)

I haven't played with this yet - I see github has image sizes defined, have you tested what happens if mod images are slightly larger? They are simply scaled up or down? I guess my real question is, will images the wrong size break the mod/game?

Thanks! Larger / smaller images will scale down / up, no need to worry about breaking the mod. I've tried folders with completely random images / photos with all shapes and sizes, and didn't see any problems. The only thing is larger images will take longer to load. Also it's best if the height is a power of 2, since the game resizes image dimensions to powers of 2 to create its mipmaps.

When creating shows, I found it helpful to use batch resize operations in Photoshop, since resizing hundreds of images individually did not sound like fun.

As an aside, I think it's more memory efficient if you resize the width to a power of 2 as well, since the game will create mipmaps at those sizes anyway. For example, with a 157 x 128 image, you could resize it to 256 x 128 (yes, breaking aspect ratio), and the game will scale it correctly to fit the screen (as long as the user chooses "stretch" in settings). It should be more efficient for the game because it doesn't have to do the 157 x 128 -> 256 x 128 resize in the first place.

I did a test using 954 images with 256 pixel-height. The non-power-of-two versions (902x256, 620x256, and 315x256) caused Rimworld to use 1,432 MB memory, while the power-of-two versions (1024x256, 1024x256, and 512x256) caused Rimworld to use 1,150 MB memory.

In the end I just kept the width at the original dimensions, since it's less confusing to players and modders. I'm debating now whether I should make this an issue and recommend people to resize all their images to powers of two. It really only makes a difference with several hundreds of images, and I don't want to make this too confusing. I'm also not an expert in this, so maybe someone with more knowledge could comment.

togfox

I made a show using the CREATE SHOW option in the game - no xml editing. I'm curious to find out where my show is saved and can I share this show without doing the xml editing you describe in the github?

kagamisama

#6
Quote from: togfox on March 23, 2019, 08:43:05 AM
I made a show using the CREATE SHOW option in the game - no xml editing. I'm curious to find out where my show is saved and can I share this show without doing the xml editing you describe in the github?

Shows created in the mod are saved in the game's mod settings, which in Windows is:
> User\AppData\LocalLow\Ludeon Studios\RimWorld by Ludeon Studios\Config\Mod_1685381492_RimFlixMod.xml

It doesn't copy any files to create the show, it just stores a link to the directory you specified for the show. It also doesn't store links to individual images, so if you add/remove images from that directory, the show will automatically include/remove those images.

To create a show to share with others, it's probably best to follow the instructions in the example repo:
https://github.com/ritsu/RimFlix-Anime-Loops

I've also created a blank template you can use, which contains fewer shows than the example above and is probably easier to start with:
https://github.com/ritsu/RimFlix-Template

If you have any more questions I'll be happy to try and answer them.

hauvega

#7
Why is this mod giving me ideas?  Moar insane stuff we can create.   8)
Congratulations to making a fun mod.

Work on mod
Break mod
Fix Mod
Break mod again

EggLord

Now my colonists will be able to watch crappy slideshows of peter griffin doing his shenanigans epic style.  8)

jager666

Any chance for the mod to support .gif or .webm files? :)

Kirby23590

#10
Hmmmmm....

I think i could remake this commercial like this one, with some slideshows shots of it...

https://www.youtube.com/watch?v=8kcUjuXBFA8

Man i hope there is a update for this by adding in some sounds depending on the channel it is playing...

Otherwise, Very Goodwork! I'm already downloading it! ;D

One "happy family" in the rims...
Custom font made by Marnador.



kagamisama

Quote from: jager666 on March 23, 2019, 08:48:20 PM
Any chance for the mod to support .gif or .webm files? :)

Probably not, since RimWorld / Unity doesn't support it. The next best thing would probably be to use something like https://ezgif.com/cut-video to split a gif / webm into individual frames.

Quote from: Kirby23590 on March 24, 2019, 07:12:37 AM
Man i hope there is a update for this by adding in some sounds depending on the channel it is playing...

It's something I want to look into once I get some more free time, though I don't want to promise anything yet.

hauvega

#12
I my opinion this mod acts like a gif.  I already REed a gif into the frames and used it.  It is just extra work, but it is worth it.

Work on mod
Break mod
Fix Mod
Break mod again

togfox

#13
Would anyone like to try my experiment? You'll need a mega-tv screen.

RAR file:
https://www.dropbox.com/s/gc2bydgbgqn6meo/RimFlix-A-New-Hope%20v0.01.rar?dl=0

This is a Rimflix movie. You need to place Rimflix and this movie in the mod folder (after unzipping of course).

kagamisama

Quote from: togfox on March 25, 2019, 09:52:42 AM
Would anyone like to try my experiment? You'll need a mega-tv screen.

RAR file:
https://www.dropbox.com/s/gc2bydgbgqn6meo/RimFlix-A-New-Hope%20v0.01.rar?dl=0

Thanks for sharing! Nice scene selections. It looks good to me. :D