Post news RSS Dev Log: Week 5 (out of 5)

A summary of the previous weeks of development. (5/5)

Posted by on

DAY 29 (3-4-2018): Disguise

- I have a little fun making the player get in the disguise uniform. I will share the few tries I did, and their results.

The goal is: to start the scene with the player wearing the disguise outfit and ready to go.

1- When curtains up, add the disguise item (outfit) to the player's inventory then use that item. -> The map didn't start at all, stuck the black screen before curtains are up !

2- After looking at Tsang's Tower mission in HK, I found it wasn't necessary to use the item. -> The map worked, but the player had to confirm adding the item to the inventory, and since they didn't have enough slots, they had to stash the outfit !

3- Before adding the disguise item, I removed the player's current outfit item. -> It didn't work ! I realized I was testing the map using Duncan character from HK, and figured that since Duncan is a fixed 3D model, the outfit will not affect him. So I tested the scene using 'Load Main Character' option.

This is similar to dressing up NPC's. If I used a predefined model (like Gobbet or Glory) probably the outfit will not appear. But if I used one of the generic models under HK/Wealthy category (like HumanMale, ElfFemale ...) the outfit works. I think I read this tip on the Wiki or at Dave's Model Viewer, so thanks a lot for the heads up, guys !

4- The main character now wears the disguise and the confirmation is gone. -> But the player starts the map with a T-pose, and I have to click anywhere on the screen so the player goes into the idle animation (normal pose).

Note: I think removing the player's outfit is not ideal, since it is basically unrecoverable now! I will try to find other solutions later.

5- When the map starts, the player was invisible ! It took some time for the game to load the new model wearing the outfit. -> I tried to play with delays and camera fading in and out, but found that I have just added an unnecessary delay.

6- Instead of applying the outfit script at the beginning of the scene, I applied it at the end of the previous scene, right before the scene transition script. -> Now instead of adding extra delay to give the player time to change clothes :) I used the delay of scene transition and loading screen to cover up for it. Now the player starts the scene ready.

- Started working on paths, and script variables and events. I start with basic gameplay structure to make sure the flow is solid, using only like 5% of the intended dialogue.

When the level's gameplay is in place, I write the full dialogue.

I also realized that my previous design was a bit scripted. I was 'moving' the player from an event to the next without giving him/her much choice. Given the sensitivity of the mission and some restriction from the Johnson, that would have been acceptable a bit. But I will try to give the player more options; like making multiple events happen at the same time, so the player has to pick which one to do first.

So instead of the old A->B->C->D, it will be like: A->B or C--(then when both B and C are done)-> D.

DAY 30 (4-4-2018): One Month ! And a lot of paths!

- It has been already one month, and I am already past the half of the mod. Yaaay !

- Today I created a lot of paths, regions, variables, and events. There is a lot of 'manipulation' going on in this level. Many NPC's have their own routes and stuff to do, and the player tries to change some of that to his/her advantage.

DAY 31 (5-4-2018): Noodles ! (photos included)

- I am making a building with many hallways and rooms. It would be boring if only the player is running around, so I decided to add someone to walk around randomly.

The Goal was: Pick a random location on the level, and walk to it.

Note: This one might be a bit technical, but I will try to keep it an interesting read :)

Note: many of the following steps were done in the main scene, but things got complicated and other scripts missed with the current one, so I took everything to my Experimental Scene and started from scratch.

1- There are many ways to direct an AI to go to a certain place (paths, regions, specific point on the map ...), but the easiest one -in my experience- that can be picked randomly is regions, because the editor has an option for that when setting a target for an AI.

So, at the beginning of the scene, I order the character "RR" to go to region "Reg", and when he arrives to the region, the engine moves the region to a new random location, and order RR to move to it again. Simple enough! And it worked, but not for all rooms ..

Note: To keep the player from waiting for RR's turn every time RR moves, make RR in passive mode at the beginning.

2- There are two types of rooms: Ones the player cannot go in, and ones the player can go in because they are related to the story. Let's start with the locked ones first.

How could RR go into a locked door ? Well I tried to mark the door's interaction as "AI Only door", but Haha! Didn't work.

So I added a small region that surrounds the front and back of the door, and ordered RR to Interact with the door when they enter this region.

So, when RR tries to move to a point inside a locked room, they will get stuck at the door, but since they are in the door's region, they will interact with it and open it, then they will go in. Neat !!

3- Now , I don't want RR to walk around the player when they are in the middle of a conversation in one of the rooms. Or for RR to walk casually into a room that the player still has to find its key ! So had to exclude them.

But since I am using a region "Reg" to guide RR, how would I know if the new randomly-picked point of Reg is inside a Locked room ? There was no direct way for that, but there was a way to know if a character is inside a region, so I created a character called ZZ (RR's sister/princess), and whenever the position of Reg changes, ZZ teleports to Reg automatically.

Spoiler: before ZZ was a character, she was actually a prob .. a Noodle Machine prob, to be exact !

This sounded applicable at first, but to make it actually work, we need a loop that keeps checking: Unless the picked position is valid, keep picking new ones until you pick a valid one. This is a good time to talk about a problem that appeared earlier, where the script was working fine, but only for one time -> I had to check the trigger's "Retain" option, to keep it firing many many times.

So, now we have RR chasing after ZZ, who keeps jumping to random locations whenever he catches up to her, and sometimes she hides inside locked rooms, and RR is kept stuck staring at the walls that surround her .. Your princess is in another castle, bro!

4- I added a big region, called "Big Reg", and moved Reg to a random location within Big Reg. Then made small regions called "X Reg", which Reg is not supposed to go into.

I split the script, which was kind of one block of commands, to 5 parts:

Part1: INITIALIZE - RR takes the first command to go to ZZ. No need it to Retain this one, but all the rest are Retained.

Part2: ARRIVAL - When RR arrives to ZZ: 1- Find a new location, 2- Checks if it is valid, then 3- Order RR to go to it.

Part3: FIND - Moves ZZ (and Reg) to a location within Big Reg.

Part4: MOVE - Ordered RR to walk to ZZ.

Part5: VALIDATE - If the position is within an X Reg, 1- Find a new location, then 2- Check again.

That " Should have worked™ ", but it didn't. RR kept getting stuck, and when the random new location happened to be very close (so RR is actually still inside Reg) the trigger didn't fire (because RR did not "Enter" Region Reg, he is actually still inside and didn't re-Enter it).

So instead of the 2nd step in Part5 (keep calling Check), I made a simpler solution.

(Can you spot the noodle machine ? Full size download)

Previously, the X Reg was exactly the size of the locked room, so I made it a bit bigger so it covers an extra unit around the locked room's wall. So when RR is stuck near a wall, he will actually still trigger X Reg. (Before, he was stuck, with no way for X Reg to 'feel' his presence).

And I made Reg only 2 units in size, this is barely enough for RR and ZZ to stand inside Reg without collision. So now RR is less likely to stay in Reg if its new location is very close to him (unless the new location is exactly the old one, which is very unlikely. If this happened to be the case for you when you play the game, then just think of it as an intended feature and keep playing !)

All of this seems organized somehow, but I just kept the good parts of the story. A lot of trials and errors happened today trying to get this to work. I want to thank some heroes of today's adventure:

- Passive Mode: Kept every character's nose in their own business, instead of stopping each other.

- Trigger Commands: First I relied on Events and Variables to make the code move from step to another, then I used the trigger commands and called the triggers directly instead.

- Ctrl+F1 (aka Debug Mode): Debug console messages are good, and the Disable Fog option helped me see RR's movements around the map.

- Round Counter: It took me a while to notice that the new messages in the debug console are actually added at the top of the window, not the bottom .. There was a number on the left, which for every full iteration to RR and ZZ's adventure, it increased by 1. There was a little story for uncovering the "conspiracy" behind this number.

For a while I noticed that RR and ZZ do not move unless the player makes any move, small or huge. It was as if they were waiting for the player. This mysterious number was non other than the Behind-the-scenes turn number. Every action the player makes can count as a turn. So if I order the player to walk 1 unit, a turn passes. If I order the player to run across the whole map from start to finish, this is another single turn.

NPC's keep executing their old commands regardless of this turn, but they do not take new ones unless a new turn starts. So RR might keep running to ZZ even when the player has ended their turn, but ZZ will not go to a new place, and RR will not start following her unless the player starts a new turn.

This made sense, because the game is turn based. The combat is actually a slo-mo version of those behind-the-scenes turns.

Sorry for any expert reading this if I made it look like a big deal :D, but had to make a small story to keep things from getting boring (I hope they didn't :D :D ).

DAY 32 (7-4-2018): Noodles ! (photos included)

- I made the solution in the last post less fancy.

Realized I just need the actor to move between two main regions, so whenever they reach one they just head to the other. It would have been nice to make something more generic and realistic, but that would take a lot of time, and it is not a core feature .. But I have learned many new things about the Editor and the SR Engine in the way.

- Still working on the main flow of the level.

Added few quest items today. Working on the main flow is basically linking variables, triggers, and events together. A line in the dialogue triggers and event, which checks for a variable (i.e. did the player visit this room for the first time ?) ..etc.

But when there are many variables and triggers, I try to simplify them as much as possible, so for example; if I can do the job with one variable, there is no need to use three.

DAY 33 (8-4-2018): More Flow .. OH! And ModDB !

- The "Mod" now has a name! Good Intentions. It is now has a page on ModDB, with a punch of brand new screen shots (Still Work in Progress !). You can check it out now, and please follow it because I will be posting updates there too.

- Sometimes the characters would refuse to move to a region. It was because I left the "No Facing" option thinking the character will just face any direction :). They must take a specific direction to face.

- Some AI characters need to walk to certain rooms. I first order them to walk to the region inside the closed room, and then when they are close to the door, I order them to interact with the door.

What happened is that the interaction happens so fast the door opens and closes before they can go in ! The way around this was to use the "Props/Force Prop Use" instead of "AI/Order Actor to Interact with Prop".

- Few weeks ago I was wondering how SR knows the player's name in the dialogue. And after a few minutes skim of some DF dialogues, I found that they used $(

It did the job so I didn't have to learn more about it. But now I found out that there are many other variables, well documented in the wiki's Text Expansion topic.

Another powerful tool in the SR Editor.

- For some reason, when I leave a response in the dialogue empty, it overwrites any other response beneath it. Only the first one appears (as "..." button), and the rest just do not show up.

So it is either: Make only one response, which is empty. Or make many responses, but none of them is empty.

- In one part of the level, the player leaves a room with its door open, and I need to close that door.

So the script was: 1- Disable the door's interaction (so the player cannot go in again), then 2- Force the door's use (Forcing to use it while it is open will close it).

The correct order should have been 1- Force 2- Disable, but I mixed them up for some reason, and the door was just still open.

It seems when the Editor tried to Force the door, it found that the interaction was disabled, and so "couldn't" Force it. It actually makes sense, since the the Force order is like "simulating" the manual task of opening the door, which is not possible -manually- if the door was disabled.

DAY 34 (9-4-2018): Flow Done!

- Phew! Main flow of the level is done. Not it is time for Writing!

- There have been a weird diagonal line in two of my maps. I don't know when did it appear, but I am sure it was not there when I first created the maps. It doesn't appear in the editor, only in the actual game.

DAY 35 (10-4-2018): Conversations: Part 1

- Finished 3 out of 9 conversations in this scene.

The reason they were done relatively fast is because there is not a lot of world exploration at this point. The team is in the middle of the actual job, so the dialogue must stay on topic (no branching or extra details).

Each conversation has a simple and clear goal; things the player needs to know about and respond to. This is the easy part. Telling these things to the player in a way that sounds logical from the perspective of the characters and the mission requirements is something else.

For example, the player might need some characters to do something for him/her. But these characters do not know the player is in a hurry, so they are just acting on their own pace. Making a character with a slow personality do their work faster, without ruining their personality, is hard.

An easy solution might be to "just make them fast!". Well, that is basically cheating, because the story has other requirements that needs that character to be slow. Maybe because their job is boring and they have been doing it for 30 years or so .. so they are bored like a sloth .. etc.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.