January 22th Update:General Stuff:This post is primarily about the journal mechanic development I've done.
If you don't want to hear about the personal side of development skip this section.Onto personal stuff. I had about 2 months off from school from the second week in December to basically today (school starts tomorrow). Before the break began I had planned to accelerate development as much as possible only accounting for Christmas week being lost. In actuality I only spent about 2 weeks of the the break working at my normal frequency and pace.
When the semester was over I had just got done staying up for an average of 22 hours each time I woke for the last 2 weeks of the semester. Being the main connector of everyone on a project this size means that if everyone is going to see their stuff int he game I need to be working on making that so.
Staying awake that long does a lot to your body, but the main thing I noticed was the my nerves feeling shot (my literal nerves not like how well I keep my composure). Around this time I also realized I had been working on this project close to full time (averaging 30 hours a week) for 9 months. Only 4 of those months were with other people, and the first 3 of those months I was working 40+ hours a week at a construction store that was very labor intensive (mainly freight...and mainly paint cans). Also that work day started at 10pm and went to 7am.
It finally became clear to me that I needed a break.
I could tell how the stress of this work affected other people on the project and other projects going on, but I didn't really feel it affecting me. But it was.
So I spent time playing games. Got back into Dota 2 a lot, played TES 4: Oblivion again(my favorite game of all time), figured out how to min-max Planet Coaster, and watched my 20 hour Rim World colony get wiped out by a gameplay patch and not by Scythers for the first time ever.
I also took a trip with my girlfriend to Seattle, Washington, a place I sincerely hope to move to someday. Maybe not right after college, but someday (please hire me Valve

).
As it stands now, I've spent that last 2 weeks working refreshed and writing some of the best code I ever have. Not really saying much since I know almost nothing of best practices, but I've been surprised at how quickly I've been developing complex systems that usually take a lot of trial and error.
Anyways, the point here is that you should always take time off, pace yourself, and don't take on too much responsibility in a project. Otherwise you burn out and lose out on a month of progress like I did
The Journal:The Visuals
So...the last time I mentioned this journal mechanic it looked like this.
Then while on vacation I made an updated one that looked like this.
Much better, but the textures have no normals and the leather binding looks a bit rigid.
Another huge improvement on this journal (that maybe only I really care about) is the addition of proper page distortion when opening and closing and proper textures for the edges of pages.
Still doesn't look like a real book, but it's getting there.
To achieve this I used the Morpher modifier in 3ds max that essentially lets you interpolate one model into the shape of another using a percent value of 0 to 100, which you can animate as easily as bones. The pages and the book binding still use traditional bone animation because its way easier to maintain a model's volume with those methods.
There was one final pass of updating these visuals:
Now we're talking.
Added a more realistic page tint, some random discoloration to the paper texture, remodeled the leather book binding to be more bendy, but I still kept a bit of rigidity to it so that it seems sturdy (makes it easier to animate
and makes it easier to have the option of letting it wiggle via physics later down the road). Oh and also there are now normal maps for all textures on this book.
The Programming
The old journal did have page turning, but no real logic to manage it beyond finite pages that are in the scene to start with. There was also no way to create text for the pages without using external software or at least baking them out in Unity using a very slow method of texture baking with alpha I hacked together quickly using online references.
The new journal is functional:
This is the result of a 4 part system.
- The journal model itself - As seen above
- The journal script - this stores information the journal would have
- The journal controller - this manages making the journal interactive
- The page text renderer - allows for dynamic text creation
The model itself has 4 pages within it. When you turn the page it deletes a page on the side the page was moved to and adds one behind the other on the original side.
I am also recycling the same 8 materials (one for each side of 4 pages). So the page that was last removed has its materials added to the new page.
At the moment there's nothing putting new text onto the pages, but this mostly because of testing however.
This is a pretty complex series of script with a lot of interlocking functions.
The script basically functions by having a class that represents sections (called chapters of course) and this class stores all the text files in a list to be given to the page materials as you turn pages.
The rest is just about making sure all of this good smoothly and linearly to actually look like a book.
The last element is the oh so great text rendering...this part almost made me lose my mind. It needs to have alpha to function, so there needs to be 4 channels for the texture even though I'm basically only using the color black. There was also very little helpful documentation on unity to make this happen.
The principle issue was that textures on import don't have their alpha as transparency so even once I got a camera to render with alpha using the camera's depth map, they wouldn't have alpha in the engine. And yes, you can change a texture's import setting through scripting, but since I was making these texture files through script they existed in project folders but not yet to unity because it hadn't processed it though it's importer.
Even with ridiculous pauses before trying to affect import settings it seemed that Unity was having some delay on processing the new textures. Strangely if I clicked into the project folder in the windows file browser that seemed to make it happen more quickly, but I had no way of reliably making this happen.
This led to me scripting in a particular kind of way.
The solution was a pretty simple one and its a very common one...
Editor ScriptingIt turns out you can affect the default import settings with a pretty simple script that looks like this:
So simple 
Then all of the messing around with trying to do these via script at run time just seemed silly. I should have looked into this a lot earlier and definitely will in the future whenever creating any objects at runtime. And now the renderer creates 2x2 text textures much faster with the new method of getting alpha and it is automatically transparent no matter when it is fully processed by the unity asset importer. The journal is very set to be made more robust and then filled with content.
Seems like a lot of work for this book...
I'd like to quickly address the fact that this may all seem like its a bit over the top. I know that other games have books in them all the time and they are as far as I know never done as in game objects. Usually there's a UI screen that shows you each page and the animations of pages turning are just 2D rendered ones.
However, I'm deliberately not doing it that way.
The journal in our game takes the place of traditional UI. All the information the player gathers is stored in here and the player can even manually type their own notes. This means that I want this journal to feel real. I want it to seem tactile and personal. And it also means this journal needs to be extremely dynamic and the text can't be pre-rendered because you will be gathering information in a non-linear fashion.
There are a lot of complications with this method, and there is little for me to draw on for inspiration or to see if I'm on the right path, but I'm confident this will be a great selling point of the game once it is properly created.
The Future
Last week I had this list of stuff the journal will do
- A bookmark - to have the journal always open to the page you want
- Tabs - to organize sections such as player health or specific investigation treads
- Tactile page turning - kind of on the fence about this. But I think turning the page yourself will add more than it takes away and make it really feel like a book and not just a game system.
- A player note section - have pages that the player can add their own notes into so they don't forget observations that may not be parroted by the game
yeahhhh.... it does none of that.
But I have been thinking about this a lot while working on the scripts. Everything is relative to a left page index so skipping from one page to another is easy (so there's the bookmark covered

). Every section is organized into chapters so its easy to find the first page index in that chapter and then skip to it in the same way. Tactile page turning is something I had in my prototype of this mechanics where you affect a animation speed multiplier with the movement of your mouse to scrub through a turn animation like you would turn a page. Its not even remotely implemented right now, but I can map that over with a small amount of work with the page animators. Lastly, the player note section is on hold at the moment. Because I'm rendering text to put on the pages so that they actually look written on the page I'm not sure if I can do this fast enough for the player to see the words on the page in real time.
I need a separate, flat surface for players to write on or I need to do some complex stuff with rendertextures and an additional camera. Both are good solutions but I need to focus on getting a full sort of alpha build of the game by the end of this semester so that it can be a powerhouse addition to my portfolio. So the player notes mechanics will be revisited at another time.
Conclusion:This was a much bigger undertaking that I anticipated. I had only allotted 1 week for it when I planned to do this about a month ago which was a big mistake. Admittedly the actually journal/journal management code was
mostly done in one sitting it's the tweaking and the big issues that take up the most time when its this interconnected of a system. I definitely shouldn't count on anything taking just a week to figure out fully ever in the future.
-Cinder