Album and journal

Two records, both optional. The album is the photos themselves. The journal is what the player has found.

The album #

Every kept photo becomes a real picture file plus a small record of what it shows.

What is saved #

Under Storage in the profile:

Setting What it does
Make Pictures Off keeps only the record of what was photographed, with no image at all.
Album Off means a photo only makes things happen (requests, discoveries, your events) and is not kept.
Save To Disk Off keeps the album only until the game closes.
Journal Fill in the journal.
Folder The folder under the game's save location. Use a different one per save slot or player.
Max Photos, When Full The most photos the album holds, and whether the oldest makes room or new photos are refused. Favourites and best shots are never replaced.
Format, Jpg Quality JPG (small, right for almost every game) or PNG (exact, much larger).
Size How tall saved pictures are: the screen's height, or 480 to 2160 pixels.
Shape Same as the screen, Square, 4:3, 3:2, 16:9, 21:9, or portrait 4:5 and 9:16. Other shapes are cut from the middle of the view, and the viewfinder shows the cut.
Smooth Edges Renders at twice the size and shrinks it.
Hide In Pictures Objects switched off for the instant the picture is made (a held item, your own HUD on a camera canvas).
Logo, Logo Corner, Logo Height, Logo Margin, Logo Opacity Your game's logo, stamped in a corner of every saved picture, so shared photos carry your name. Use a texture with a see-through background.

Pictures are files in the game's own save location (Application.persistentDataPath), so they survive between sessions and are easy to back up. The list of photos is written safely: a new file first, then swapped in, with the previous list kept as a backup. If the list is ever lost, the album rebuilds itself from the picture files.

The built-in screens never appear in the picture. A photo is a fresh render of your camera, not a screenshot.

The album screen #

Tab opens it. Tabs for All, Favourites and Best shots; a grid of pictures and a detail pane with the photo, what it shows, its score and medal. F marks a favourite, Delete removes a photo (with a confirm), Enter saves a copy to the player's Pictures folder on desktop platforms, and G raises the camera with that photo shown faintly over the view, to take the same shot again. Photo strips from the photo booth are in the album too.

From code #

var album = PhotoAlbum.Main;
foreach (var photo in album.Photos) Debug.Log(photo.mainSubject + " " + photo.score);
album.LoadPicture(album.Photos[0], texture => myImage.texture = texture);

For a different place to keep photos (cloud saves, a database), write an IPhotoStore and open the album on it with PhotoAlbum.Open(myStore). MemoryPhotoStore keeps everything in memory.

Photos in the world #

A Photo Display (Add Component > Photoworthy > Photo Display) shows one of the player's photos on an object: a picture frame on a wall, a pin board, a trophy case, a phone screen. Put it on anything with a renderer (a Quad works well) and choose what it shows: the latest photo, the best photo of a subject, the latest favourite, or the latest photo of a subject. It follows the album, so the frame changes when a better photo is taken, and it can stretch the object to the photo's own shape. The Meadow Trail demo has one on a board by the trail head.

The journal #

The journal remembers, for each kind of subject: when it was first photographed, how many photos, the best shot and score, and which behaviours have been seen, each with its own best shot. It also remembers which requests are done.

The journal screen #

J opens it. One tab per section (Animals, Landmarks, your own categories) plus Requests. Subjects not found yet show as "?" when Secret Until Found is on. A found subject shows its best photo, description, score and medal, and its behaviours: seen ones by name, the rest as "Not seen yet".

The order of sections and which subjects are listed come from the Photo Catalog asset (Create > Photoworthy > Catalog) on the profile.

Saving #

  • By itself, the journal saves to a small file next to the photos, whenever it changes.
  • With a save product that reads the shared save contract (Shipready does), the journal is part of the game's save slots automatically.
  • For your own save system: PhotoJournal.Main.ToJson() gives the whole journal as text, and FromJson reads it back.

From code #

var journal = PhotoJournal.Main;
if (journal.IsDiscovered("zebra")) Debug.Log("Best zebra: " + journal.Entry("zebra").bestScore);

Starting again #

PhotoAlbum.Main.Clear() deletes every photo and PhotoJournal.Main.Clear() empties the journal, for a New Game button.

Something unclear or wrong? Tell us · Get help