Fortress Occident Developer Blog

Comments

MOTOR LORRY OF THE DAY #1

Today we start our seminal, fabled, scandalous, highly controversial “Motor-lorry of the Day” series. That’s right, Martinaise has an intersection. With a long-standing traffic jam. (Perhaps the world’s first isometric traffic jam!). For it, we’ve created some heavy vehicles.

Faln_A-6_360

We call them motor lorries, sometimes camions. The drivers are called camionneurs. This is a a stylised render by all means, real pure blood lorries of course have textures as well.

This is the Faln A-6. It’s literally the most boring lorry at the intersection, perhaps in the whole world. Faln, the manufacturer, is an industrial conglomerate. They make houses, tracksuits and heavy vehicles. The houses are terrible, the tracksuits legendary and the vehicles, well, the vehicles are okay I guess.

Comments

Tiling of the World

Human memory has an interesting quirk: events in the past tend to fade and the busy, stressful times become a muddled extent of non-memories — I have years from which I remember: I think I was quite busy at the time.

When I think back a year, I feel definietly the same muddyness of ever-present programming puzzles, with one bright detour to the wonderful land of Blender.

Technical background to tiling

Our art pipeline, as explained by Rostov, starts with sketches and then a rough block-in which gets refined into a nice-looking render. Now: while we could render the whole image at a time we have decided to split the world into smaller tiles.

I don’t remember the exact discussions which led to our solution, but can still summarize one main decision.

We were thinking of doing the world in Pillars of Eternity way: essentially setting only the walkable ground planes and windows into the 3D world and then having a back-drop image without geometry, which occasionally occludes the player. Problems with that were manyfold, but mainly concerned in-world lightning and questions of what can the player see at a given time. Eventually we decided to have a simple 3D block-in world which gets a similar depth-occlusion shader.

This way we have a general understanding of geometry for the dynamic lights and visual raycasts while using a custom shader on the ground world to create the illusion of rich geometry.

World from its side

A slice of world from an unintended angle

How tiles are made

Now we were faced with an another problem: how to tell which part of the 3D world should show which tile and how to put it there?

The problem of mapping a 2D image to 3D space has been solved for a while and standard tools tend to call it UV mapping, which essentially means that every triangle of a 3D mesh gets its own location on a texture and then the texture is calculated with the right modifications.

As our renders are isometric and have a fixed angle we project them from the screen plane to the mesh. How does the mesh get its projections? Que my entrance music.

blender-app_2016-08-18_14-36-17

By hand the process would look like this in Blender. We create a cuboid which represents the orthographic rendering camera space. Then we join all the different meshes (walkables, barriers, walls etc) into one solid mesh.

Then tell the large joined objects in the scene that they should be intersected with the cuboid (which I started calling Intersector-1 since it reminded me of an old computer game).

blender-app_2016-08-18_14-36-41

Now, since our camera is animated to produce the tiles (a tile for a frame), the intersecting modifiers on every detail cut away all the pieces outside of the camera. For each of those tiles we apply camera-projected UV coordinates, so that the rendered and painted tiles match up exactly once imported to Unity. Then export an FBX file. For every tile.

This routine process is completely automatable.

Blender

Blender has been built with a decision that everything that a user does can also be done from Python. You can observe it by dragging down from the upper menu and scaling or moving the default cube. The lines starting with bpy.ops are the actual function calls and their arguments that you can type into Python console to make them happen again.

blender-app_2016-08-18_14-24-55

bpy.ops in action

While it takes some digging around, this log makes it incredibly easy to create your own plugins for automating any tedious or repetitive task.

Unity_2016-08-18_14-24-30

My own little slice of Blender

You can create operators, which are small Python classes which run a function when the user wants to. For tiling I have “copy everything to another scene”, “join everything”, “project UV from active camera”, “export frame”, “export everything” etc.

If you want to go an extra mile you can check if the context is right for calling them. And there is a nice way of creating user interface buttons — which then get automatically grayed out if you wrote the polling function right. Eventually you can even write some additional meta-information to create a plugin.

Blender has shown us its nasty side too: it appears that crashes with boolean operations, especially when objects have open meshes or exactly overlapping surfaces. Regardless of automation the artist who builds the block-in has to be careful.

Researching how to modify Blender was fun, the hack-try cycle really short and if I ever need to mess around with automating the program I know that I find it delightful. Now back to the Unity.

Comments

Afterthought system for dialogues

Since this devlog is all about skinning milk cartrage assets in SKUyA — I make this remark with deep apologies to our technical artists, SKUyA is not a real thing and no one “skins” anything — I thought I’d share a little “RPG stuff” with you. For good measure. It’s this little trick I might have implemented over the weekend. It’s called afterthoughts, because L’esprit d’Escalier was too fussy to copy-paste in this post.

For those unfamiliar, L’esprit d’Escalier or Spirit of the Staircase is a cute french expression for the predicament of coming up with a perfect reply too late. I.e. when the conversation is already over. When you’re walking down the staircase and suddenly the perfect witty reply or devastating argument pops into mind. Well — how would that work in an RPG?

I haven’t, technically speaking, seen it work in engine yet, but I think we have the answer.

CHECK IT

In No Truce, you have conversations with a lot of people. But the person you’ll have most conversations with — is yourself. We use this literary device a lot. We’ve even built special systems to facilitate it. Systems like our sense orbit, that lets skills pop up outside dialogues. Basically, we designate areas and then — if you have a high enough skill — said Skill will pop up there. Click on the skill and you can have a conversation with it (a part of yourself), if you like.

For example: you step on a stage, Drama pops up and asks you if you feel at home. This grounds you in the world more. We can even give conditions to these pop-ups: click on a drainpipe, it says: “rainwater is gushing out.” Then go down the street, Visual Calculus pops up and tells you the street is tilted to east, because the water only streams there. (No click on drainpipe — no get this pop up. Conditions!).

So, using these building blocks, we can do afterthoughts too! Even exactly the same L’Esprit D’Escalier effect I described before. Say you’re in a conversation. With a colleague from the RCM, the Revachol Citizen’s Militia. You get into a little argument over an irrelevant detail, then go back to the main topic. You end the conversation and walk away. So far so usual. But the area around the colleague you just talked to is designated as the area where a medium difficulty Rhetoric pops up if you had the argument before (the condition is met), and you have enough points in the Rhetoric skill. You then click on the little Rhetoric orb on your head, this starts a dialogue. Your Rhetoric gives you the perfect thing to have said. If you’re nice to it. Some skills are touchy. (Yes, really).

Then turn back to that colleague of yours. The argument appears on his main conversation menu. You choose it. He replies with something like: “You literally just came up with that four meters away. I could see it on your face, you made this…” (Makes crooked face) “stupid face, like you were trying to come up with something.”

WHY I REALLY LIKE THIS…

Postmodern tricks aside, afterthoughts let us make our dialogues shorter and leaner. No Truce is a talk-em-up, but conversations still need to have pacing. And under pacing I mean they need to be FAST. The quicker the better, so as not to become chores. On the other hand, we like to pack in as much content as we can for different character builds. The detective with perfect encyclopedic knowledge wants to pick up trivia and discuss that with his colleague. The physical character wants to get Half Light anger flashes (more on that another time) and hound the suspect on a stupid suspicion he has. Putting all these skills in the conversation, however, slows down the tempo and leads you into tangents. This draws attention from the main dynamic of the conversation.

We work on some dialogues for well over a month. In this time a writer-designer gets many weird, adventurous ideas for different skills to add. Afterthoughts could be a way for us to keep dialogues leaner while adding more content for different builds. A win-win.

In theory.

It may be annoying in practice, who knows. Right now I’m quite excited about them. I made a bunch of these micro-dialogues over the weekend. Who knows, maybe there’s even a gif added to the post, illustrating one pop up…

2016-08-08_15-24-31