Coding BS

I thought I’d do something a bit different and write a post bit-by-bit as I worked on the game this weekend. So, what we have below is a bit of a free-form train-of-thought blog about what adding new content to Interns can involve sometimes (and why it can get rather frustrating).

I really could have saved this post to use as a special behind-the-scenes post for backers, but I thought I’d share this little piece of my self-created private hell with everyone.

So, without further ado…

Adding a new scene to Interns

So, let’s that you’re me and you’ve written a bunch of scenes and made some graphics. Now you’d like them to be in the game. How does that work?

Well, since you kinda suck at this coding, planing and game logic thing, it looks a bit like this:

Step 1: Identify all the places where the new scenes need to be injected.

Right now, I’m working on events for Cynthia, so this includes:

• Her normal arrival time, which has its own block in the morning preparation loop

• The shower block (which is currently one special event that really should influence the following event in the aforementioned normal blog—in other words: The scene shouldn’t have Cynthia arrive since she’s already there)

• The bathroom masturbation block (a fairly similar scenario to the one for the shower block)

• The post-work event block

Technically, I have an event where she’s supposed to arrive before the PC even starts to get ready for work, but I’m not sure how I want to handle that yet.

Step 2: Lay the groundwork.

In the case of the after-work event, there’s already a (somewhat dated) block of code that handles these events. (It needs an overhaul, but this isn’t really the time for it.) So, in the section where it checks for events, I’ll make a call to a new function that will specifically check for Cyn-related events.

I create a placeholder function and I just toss the variables for that into the rather dated code and worry about the rest later, since these will rely on some logic that will be handled elsewhere. (Fortunately, this works in such a way that it shouldn’t break anything.

For normal arrival events, there’s already an existing block. Right now, it’s just a really archaic way of choosing one of three scenes at random, and playing a default scene when those have been exhausted.

Let’s overhaul this a bit. For now, the existing code is going to be shoved into its own little function that will only be called in the first few days of the game. These are pretty much fluff/filler events for pacing, so I’m going to have it randomized to play between one and all of these scenes.

Biggest problem with this is that I don’t want to break old saves if I can avoid it. So I’ll need to write a little function to check the existing variables to see if the player has already seen them.

Speaking of not breaking existing save files, all of the new events require variables to track things…and it’s a lot of new variables.

To keep these from breaking old saves, I need to have the save updater code check for them and initialize them if they’re missing. Most of them aren’t too bad, since these variables won’t be used until the new scenes play for the first time, but one involves a change I made to a scene on the morning of Day 4, and most save files are probably going to be past that, so that’ll require some way of figuring out how to set it after the fact.

Okay, so in some of these scenes, Cyn needs to comment on changes in the player, so I need to add a function that will check for those. I’ll need another function to initialize those variables, too.

Okay, for now, that just checks hair and eye color, so good enough for what I’ve got.

When it detects a change that Cyn should react to, that function will trigger another that will play the comment. I don’t actually have the comments ready right now, but it’s a good idea to figure out the logic for it and get some placeholders in, uh…place.

Okay, so remember how I said I need events in this block to react to scenes that will be injected into prior scenes (like the shower or masturbation sequences)? I’m going to need a function to check for those and to jump to the appropriate scene. So, let’s make that. It’s going to be mostly empty until I’m ready, but this seems like a good place to check for some other special circumstances, such as Cyn offering the PC her first haircut…

Whew! Okay, that’s a lot of work for scenes I haven’t even written yet. Cyn’s makeover events were the real reason I started this, so, after checking that there are no other scenes that are more urgent, we’ll make a new function that will be called for that…

The clothes scene might be tricky since I want the PC to be able to call Cyn and request additional clothes at any time, which could render that scene irrelevant.

Also, I consider the clothing and nail-painting events to be at roughly the same suggestion “level” so those can be encountered in either order (provided they’re both available), so I need a way of handling that.

Okay, so now we have the start of our block for handling the morning side of Cyn’s makeover “quest.”

Let’s make the placeholder scenes and add the variables that will track the player’s progression through the “quest.”

I’m “flying by the seat of my pants” here, as I haven’t fully figured out how the logic of this is going to work out. For now, I’m tracking if the PC accepts Cyn’s suggestions or not, and keeping a general “attitude” score to gauge if the Cyn feels the PC approves of the changes or not.

So around now, you’re probably asking: “But, Usagi, you demonic weeb-bunny… What happens if conditions for more than one of these cases is met simultaneously? Like, say the PC has green hair, AND she gets caught masturbating, AND some other special event is triggered?”

Well. Crap! Why do you want to make my life harder?

The truth is, I was already juggling enough items that I didn’t consider that before now. I’ll have to tackle that issue, and I think it’s going to come down to making the scenes modular so that the different scenes can be combined…

…but let’s save that for later. We still have the evening portion of these events to add, but, for now, we’ve already made a ton of edits to the game so it’s time to make sure it still works. Let’s do some bug testing!

Step 3: Make sure the game still runs and the new code fires properly(ish)!

Well, Cyn’s code hasn’t been touched since long before the wardrobe code update, so that’s come back to bite me. The original perfume and sunscreen menus are popping up, and Cyn’s visit ends up messing up the “trying on swimwear for the first time” scene—it ends up firing off at night, instead! Plus, it looks like the phone system is broken; I can call Cyn but nothing happens.

I think it would be nice if those first swimwear scenes were a bit different if Cyn is with you in the morning, so it looks like I need to track down the source of these bugs, remind myself of how Cyn’s morning code differs from the regular mornings and figure out what I need to add, and where, in order to call her special version of these events.

So, I’m off to track down some bugs and test the game to make sure my placeholder scenes are all showing up properly before I work on actually getting the story and graphics in there.

Step 4: Probably add the stuff I’ve actually written to the placeholders?

I would detail this section, but I’m still working on Step 3…

Summary: Don’t Try This at Home!

But, to sum things up here: Do a linear visual novel, or something with one or two choices, kids! With this kind of game, you could give yourself a massive headache just trying to figure out how to get the scenes you’ve written to even fit into the game!

PS: Yes, I caught that “hair” was spelled “hiar” and that one of the “+=”s should have been “-=”.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Up ↑

%d bloggers like this: