Performance, Orbit Labels, and Social Contacts

Hey Folks! More work on performance optimizations today, along with some orbital plotter and social contact work.

Early in the day, work continued on the optimizations. And I was able to find a fairly big one: pathfinding. It turns out that my pathfinding code was using a fairly expensive array IndexOf operation, since the type was an object (Tile) that required boxing/unboxing. (Particularly in large ships with thousands of tiles.) Since I was only doing this to see if the tile had been checked yet or not, I just switched that info into a BitArray and checked that instead. The resulting performance gain was pretty pronounced. A check used to take 300-400ms on a ship with 3000+ tiles, and the optimized code took only 30-50ms.

Not perfect, but a big enough change to move on to other things. And since I couldn't find any other quick/big wins in the performance profiler, I decided this was good enough to resume work on the game itself.

In the process of testing plots, I was finding I lacked certain info to verify they worked. Some of this would be just debug info. But several of these might find their way into the players' hands, since they seem like things players would want to know.

One of the big ones in that latter case is orbital labels. Unless you had the System memorized, it was hard to tell what you were looking at. Especially at high zooms. So I added registration ID labels to each station and ship on the screen, sort of like what a pilot or air traffic controller might see. You can see this in today's screenshot of the Mars system. Hangzhou (MHNG) is out there in a sync orbit with Mars, while Tharsis Landing (MTRS) and The Labyrinth (MLAB) are down on the surface. MVOL, however, seems to be sitting inside Mars. This seems to be a bug, as the station is meant to be on Deimos (the second moon).

Another big help in testing all this would be some way to view social contacts for an AI. Who does it know? What are their relationships to them? And where are those people now? I've started making a crude UI to show this info, and I plan to be able to pop it open on any AI I've selected.

I have a feeling some form of this will make its way into the final build, too. However, current location might not be known. And, of course, it'll need a nicer presentation.

That's all for today. Hopefully, I'll have the social contacts UI running tomorrow well enough to resume work on the plot system!

Comments

ra1's picture
ra1

You might want to do something more graphical for relationships as well.

For individual characters, you could have the person at the center, with lines going out as rays to all of the people they know.

Alternatively, you could have a "crew relationships" view which would be a "circle" with crew evenly spaced around its perimeter. Lines would be drawn between each crew member indicating a relationship.

- Lines could vary in color/length/thickness to indicate different types of relationship.

Rovlad's picture
Rovlad

Yeah, what ra1 says, like a family tree except a "relationship tree" instead. I don't even know why but I really like studying/browsing those in few games where they are present, i.e. genealogical trees of your empire in Total War series.

To depict crew relationships you could try doing something like in Zafehouse Diaries, e.g.:
https://imgur.com/a/eqTCI6k

dcfedor's picture
dcfedor

Good suggestions! As I work on just getting this info visible, I think it's becoming clearer that this should be an end-user tool, too. If I'm interested in looking at this info evolve over time, seems the players will be, too. And your comments pretty much confirm that :)

A visual diagram might be the right way to go. Though I was picturing this being for a character's entire social network, which includes off-ship family, friends, and enemies. It might get a bit hairy if we're looking at dozens of people. Still, it'd be more interesting than a simple spreadsheet :)

For now, I'm going to try to get the data displaying in a useful (albeit crude) way so I can verify social relations are tracking as they should. So if you see any more interesting display regimes, let me know!

Dan Fedor - Founder, Blue Bottle Games