SamSuka
greslin
greslin

patreon


Dev Diary: PANPC 2.0.12 (dev-4)

The way things work in PANPC development is, I get some harebrained idea, start chucking code at it, come to the conclusion that either it was really stupid (and so, back it out and pretend it never happened), or else it creates a cascade of complications and consequences that drag the whole thing forward a few yards. Or miles. 

At that point, I often wonder if I'm writing the code, or if it's writing me.

Once I have something ready to test that I'm confident doesn't crash the game or destroy save files, I send it out to PANPC's dev test team to try out in their preferred builds. Then they tell me where I'm screwing up and what's working surprisingly well, and I do what they tell me to do, and eventually a new version of PANPC gets ready for general distribution. It's a system that has worked pretty well.

Cryss is one of our testers, and lately has been running the new 2.0.12 devs through the new Horizon 1.9 alpha release. He's also been kind enough to record it for our enjoyment. He shipped this Corvega battle this morning.

2.0.12-dev4 was put in test last night. It was a rabbit hole release, for sure - I started by removing the legacy ComeHere code (the feature that allows one NPC to summon another local ally to their position) in favor of a newly written real time version. 

I thought that would be a simple drop-in replacement - hah, right - but instead, what it did was highlight how much stuff in the codebase from versions 1.7 to 1.9 was done to compensate for lack of real time reactions. Now all that AI backfill was either unnecessary or dramatically overcompensating, and had to be removed or at least retooled. So I got to work on doing that.

In the midst of that effort, I realized that the real time version of ComeHere meant I could finally integrate traps into PANPC, particularly monkey cymbal and hanging tin can alert traps. Shouldn't be too hard, I figured, and I was right - once I had isolated the right activators, it wasn't hard to make a trap activator summon an NPC or two directly. 

I tested with the trap in the Corvega lobby, though, and while the trap signal was going off perfectly, the restroom raider still took an easy 5-10 seconds to start moving and I couldn't figure out why. The actual signal took less than a second to transmit, and I knew it was being received. 

After a couple of hours of analyzing log files, I finally realized that the culprit was Low Power Mode, the subsystem that keeps all the AI scripts from activating at once and frying the script system. It was designed for PANPC 1.7, when the stress problem was much more daunting, and basically meant that the first AI scripts didn't emerge from LPM for at least 5 seconds after cell load.

Sigh. Okay; well then, let's redesign LPM to deal with that and let traps happen.

And then THAT made me worry about cloning: the cloning system meant that someone out there was going to run hundreds of NPCs at a time through this system and real time LPM wouldn't be able to keep up. After all, that was why I put LPM in there in the first place. So now I had to deal with cloning, so that I could deal with LPM, so that I could deal with traps, so that I could deal with ComeHere.

Part of me just wanted to strip out clones altogether and be done with it. Another part of me just wanted to let it be the user's problem, to let them crash the game if they wanted to. Instead, I ended up doing what I should have done in the first place: make clones not activate AI by default, and then include a slider in MCM that limited the number of simultaneous AI-enabled clones. 

So, as of 2.0.12, you will now be able to generate as many clones as you want, only enabling PANPC AI on a handful at a time and saving the script system.

Clones fixed. 

LPM fixed.

Traps now working.

ComeHere now working.

It was like moving up the nested dream levels at the end of Inception.

And it certainly made Corvega a livelier experience than I remembered - as you can see for yourself in Cryss' above test video.

I doubt 2.0.12 will be ready to hit the street this weekend. This real time upgrade touches too many things, has too many downstream effects in the AI, so I want to give it at least a few more days to test and polish it. But it will be ready reasonably soon, and then I'll start seeing how much of this can be usefully ported over to PACE.

Coding so that you don't have to,

- G. 



Dev Diary: PANPC 2.0.12 (dev-4)

More Creators