Path Clumping and Phantom Tile Fixes

Hey Folks! Hope everyone had a good weekend. Nice weather here, and a lot of quality father-daughter time, as mom attended a recertification course and did some painting. Exhausting, but fulfilling!

Back at the office, Michael heard my cries for pathfinding help, and checked-in some code which fixes most of the clumping issues we were seeing. AI preferentially chooses spots which are unoccupied now when walking to a task. And you can see the results in today's screenshot.

With that solved, I thought I might run a quick test to see if I could record a new video for today. But as you're probably well aware by now, that didn't pan out.

I decided I'd try OBS today instead of BandiCam, to see if the smaller video sizes made the workflow faster. And I have OBS setup to record a windowed game (while my BandiCam records a region of the desktop). So I generated a release build to run in a separate window, loaded a test ship in the editor, then tried to run it. But I got an empty screen. No crash or anything, but nothing loaded, either.

And what's worse, it only happens in release. The editor runs the test fine.

I'll spare you the long, boring process I went through trying to figure that out. Especially without my usual debug tools available in the release build. But by late afternoon I had it. The culprit was raycasting expired ship tiles.

Basically, when the game is editing a ship, and the user clicks "Crew Sim" to test it, it first clears the scene, then starts a new game with the layout we were just editing. However, objects destroyed are not immediately removed from the game in Unity. They're marked as "destroyed" and the game cleans them up later. So when the game destroys a ship and starts building a new one immediately after, the process of checking what tile is below each object as it is placed detects not only the current ship's tile, but the destroyed one.

Now, I could've solved this by null-checking each time I did a raycast, but this doesn't ever happen in the Editor. So I checked why. And as it turns out, I was using DestroyImmediate() when in editor mode, but plain old Destroy() in release mode.

Switching this to always use DestroyImmediate solved the problem. I think it makes loading/unloading a bit slower, since it has to clean up "right now" instead of in the background. But not enough for me to go back into all the places the code raycasts to add null checks. In short, this just makes release work like the editor mode. And if/when the time comes for me to optimize for speed, I can decide if refactoring the raycasts to be safer is the better way to go.

Anyway, I think it might be safe to record now. So I'll try again tomorrow!

Tags: Ostranauts

Comments

Josh_A_Culler's picture
Josh_A_Culler

OBS all the way

https://soundcloud.com/invisible-acropolis

dcfedor's picture
dcfedor

OBS is definitely still a useful tool. Got some good footage done in it.

Just one problem, which I'm not sure I can blame on OBS or Premiere, but likely one of them: my footage of a text file (list of new stats) wouldn't show in Premiere. I ended up having to re-do the shot with game footage and splice a screenshot of the stats list over parts of it. Weird!

Dan Fedor - Founder, Blue Bottle Games

Josh_A_Culler's picture
Josh_A_Culler

its premiere... trust me its glitchy as f.. ive been using it for years and its great but always has tons of bugs

the subscription based, always upgrading platform is probably a big part of it

kinda sucks adobe has a monopoly on that.. avid is sorta unavailable at prosumer level, and there really isnt anything else

DAWs used to be like that but not so much anymore

btw, id use screenshots in premiere as much as possible instead of static footage of screens, text, etc.. its just easier to manage overall and you get better more relevant options than video

https://soundcloud.com/invisible-acropolis

dcfedor's picture
dcfedor

Yeah, I'm actually still on Adobe's CS4 for everything. Honestly, I don't need the latest Photoshop features or anything. Probably the only new feature I'd care about is 64-bit RAM access for bigger projects. But subscription isn't worth that, and I still feel wary of not permanently owning the software.

Humble Bundle occasionally does productivity bundles these days, including video editing stuff. They currently have a streamer package, for example. And usually the price maxes out at ~$25. Worth keeping an eye on!

Dan Fedor - Founder, Blue Bottle Games