Social Contacts, Data Fixes
Hey Folks! Continuing work on the game's social/plot system again today, and fixing things along the way.
The social debug UI now lists line items for each person the player knows. Name, relationship, and current location. In the process of doing this, I discovered a bug in the save/load system that caused NPCs to be loaded twice, with the second copy being completely different from the first and in the wrong place. It turns out I was looking up NPCs on game load by their name, when all things in the game are stored by unique ID. I switched that a while back because it was more convenient/immersive to use the NPC's actual names than GUIDs in many places.
So for now, I've made NPCs use their names as GUIDs, too, and just added some code to ensure each name is unique. There are over 600k combos in the basic name code, and today's changed added a few ways to embellish those random names more in case I generate a colliding name. Things like "Jr." and hyphenated last names.
Now, loading a save file restores NPCs where they left off, with their original stats. No copies to be found!
In the process, I also discovered a few typos in the data that were causing career and other chargen rewards to be missed. Those are fixed now. And while I was there, I changed the K-Leg hulk salvage event to generate an antagonist on K-Leg instead of some random distant station, since that's where the crime happens.
Now that I can see this social data more easily, I'm wanting more info on why each of these people have these relationships to me. So I've started storing the event text that caused each relationship in the social info for each character. This way, I can look it up later for context. The presentation is rough, though. Just a copy of the interaction or career event text, which if this ever becomes an end-user UI, will need some treatment.
Anyway, I'm starting to feel like I have a better picture of the current social network in the game, which makes plot testing a bit easier. The other thing that seems like it'll help a lot is making docking more foolproof. Currently, one has to be within 50km of a station to initiate docking, but that's really hard to achieve in the orbital plotter right now. Due to precision issues when zoomed in close enough to see 50km, there's a lot of jitter in positions, and the ship course simulation rarely gets in a position that allows docking before jitter ruins the setup again. I'm thinking there are two things I could do here.
The first approach is to just make the docking range crazy. Like 4000km away. In theory, the jitter shouldn't be too bad at that zoom level, and I should have an easier time initiating docking before I lose range again. This is trivial to code (just tweaking a variable), but also an obvious cheat that would ruin immersion a bit.
The second approach would be to make it actually work. Probably by making a short range docking plotter that avoids precision issues. This would involve plotting just close range things centered on the camera when within a certain zoom level, and somehow allowing player control in that mode while affecting the real world position in the overall System. This is a lot more effort, but also likely a better player experience.
I have a feeling I'll need to do the second at some point, but I might just try the first for now until things are working better. There's always endless polish to do later :)