We are using the Perforce integration in FMOD Studio, and as we do with the rest of the game, we have many FMOD files set to exclusive checkout. This includes events, so that people don’t accidentally work on the same event at once. We noticed today that exclusive checkout is not working in FMOD, causing situations where someone can easily lose their work.
Here’s the situation:
User A makes changes to an event and saves their work.
- P4V checks out the event automatically
- A checkbox appears near it in the FMOD event browser
- A grayed out checkbox appears next the event on User B’s computer
All of this is as it should be. But there’s more to it:
User B does work on the same event, not realizing that it is already checked out by User A. User B saves the project and closes FMOD. Later they reopen it and do more work on the event.
- FMOD saves the changes to the event when it is closed
- Those changes are still there when FMOD is reopened
- The event does not appear in User B’s pending changelists
- The checkbox in the FMOD event browser stays grayed out
Aside from the checkbox in the FMOD browser, all of that behavior should not be possible. If you save an event, Perforce should check it out automatically if it can. And if it cannot be checked out, FMOD should not be able to save it because that file should be set to read only.
Here’s where it’s really bad:
User A checks in their changes, and User B gets latest. The file on User B’s computer gets overwritten with the version of the file that User A just submitted. User B gets no warnings because they do not have it checked out, so as far as Perforce is concerned, the file is identical to the previous depot version. This means that User B loses all their work, and it cannot be recovered either because it was never in the version control system to begin with.
This is a problem that can be pretty devastating, particularly because it fails silently. When you’re working on more than one event, and you check yours in at a different time than the other person, you have no reason to think your changes weren’t submitted, especially when submitting a changelist full of files only named with their GUIDs. You don’t even get to resolve the differences like you’re supposed to have to, you just don’t have that file in the changelist at all.
FMOD shouldn’t be able to save that event when you save the project. You should be notified that you can’t save a read only file as soon as you try to save it. Actually, FMOD is supposed to check the file out when you make your first change, so you should be notified then when it fails to check the file out.
Is this a bug? Is there something about setting up exclusive checkout that we may have missed? This has caused problems for us already, but fortunately nothing too serious. I’m hoping to find out what the limitations are of our current workflow before something really bad does happen.