Full credit goes to Takuan Daikon (of DFGUI), but we happen to share a mailing list, and this is worth spreading.
Throw this script in an Editor folder in your project, and anytime you save and switch back to Unity, it’ll automatically stop playing.
Full credit goes to Takuan Daikon (of DFGUI), but we happen to share a mailing list, and this is worth spreading.
Throw this script in an Editor folder in your project, and anytime you save and switch back to Unity, it’ll automatically stop playing.
As Dave and I begin working on Ugly Baby with Dejobaan, we had the opportunity to throw the Unity project in our version control system of choice. Coming off the heels of a couple projects versioned with Unity’s Asset Server, I was definitely looking forward to working with something slightly more robust.
Perforce, in a previous life, was very expensive to use ($700+/user). Their free licensing restrictions used to only allow a handful of users/workspaces, which wouldn’t be enough for a small team with a few dev computers. That being said, they have recently changed their terms to allow for up to 20 users/workspaces and unlimited files, or unlimited users, and a limit of 1000 files. Jumping into a game that’s closing in on it’s third or fourth year of iterative development, I decided the former would be the best option for us.
On top of that, it turns out to be very easy to get everything setup for yourself at absolutely no cost.
Normally, you’d have to worry about getting a server hosted somewhere, worry about the bandwidth, the disk space, the uptime. Turns out Amazon allows for small servers hosted on their huge EC2 backbone at absolutely no cost.
You have two options here, setup an instance on your own, or use BitNami to do the management of the Amazon EC2 server instance. I have played with both, and ended up sticking with BitNami because I had it setup a server with a base installation of some task management software I wanted to try. BitNami also sends you estimates of what your monthly payment will be with regards to your past week’s activity. It’s a good way to get a heads up if you’re pushing your instance a bit too hard.
This section of the setup will be a little bit sparse, as it’s been a few weeks since I setup my own server, and I did not take notes at the time. If I run through it with a friend, I’ll come back and update the post.
What’s important though, is you setup a server with either Debian or Ubuntu. Having the apt-get package manager makes our lives a bit easier. Realize that if you screw up along the way, and want to start over, simply terminate and delete your server instance off of Amazon’s backend, and start over.
sudo apt-get install daemon
cd ~
chmod +x p4 p4d
sudo mv p4 /usr/local/bin sudo mv p4d /usr/local/bin
sudo addgroup p4admin
sudo adduser perforce
perforce ALL = ALL
sudo mkdir /perforce_depot sudo chown perforce:p4admin /perforce_depot
sudo mkdir /var/log/perforce sudo chown perforce:p4admin /var/log/perforce
# Perforce Settings export P4JOURNAL=/var/log/perforce/journal export P4LOG=/var/log/perforce/p4err export P4PORT=localhost:1666 export P4ROOT=/perforce_depot export P4USER=perforce
source /etc/profile
cd /etc/init.d
#!/bin/sh -e
export P4JOURNAL=/var/log/perforce/journal
export P4LOG=/var/log/perforce/p4err
export P4ROOT=/perforce_depot
export P4PORT=1666
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
. /lib/lsb/init-functions
p4start="p4d -d"
p4stop="p4 admin stop"
p4user=perforce
case "$1" in
start)
log_action_begin_msg "Starting Perforce Server"
daemon -u $p4user $p4start;
;;
stop)
log_action_begin_msg "Stopping Perforce Server"
daemon -u $p4user $p4stop;
;;
restart)
/etc/init.d/perforce stop
/etc/init.d/perforce start
start
;;
*)
echo "Usage: /etc/init.d/perforce (start|stop|restart)"
exit 1
;;
esac
exit 0
sudo update-rc.d perforce defaults
cd ~ sudo /etc/init.d/perforce start
sudo /etc/init.d/perforce restart
Before Perforce can be used by a team there are two housekeeping task that need to be done – creating the journal and closing a security hole.
source /etc/profile
sudo p4d –d
sudo p4d –jc
sudo p4 protect
sudo p4 admin stop
I would suggest that you protect your Perforce connection by logging into it over SSL, rather than the plaintext connection that acts as a default.
sudo mkdir /perforce_ssl sudo chown perforce:p4admin /perforce_ssl
export P4PORT=ssl:1666 export P4SSLDIR=/perforce_ssl
# C: Country Name - 2 letter code (default: US) C = # ST: State or Province Name - full name (default: CA) ST = # L: Locality or City Name (default: Alameda) L = # O: Organization or Company Name (default: Perforce Autogen Cert) O = # OU = Organization Unit - division or unit OU = # CN: Common Name (usually the DNS name of the server) # (default: the current server's DNS name) CN = # EX: number of days from today for certificate expiration # (default: 730, e.g. 2 years) EX = # UNITS: unit multiplier for expiration (defaults to "days") # Valid values: "secs", "mins", "hours" UNITS =
p4d -Gc
sudo chmod 700 /perforce_ssl/
p4d -Gf
It’s also important to setup the typemap for Perforce, to ensure that the files that are being checked out are properly marked as text, binary, and binary exclusive.
In order to do this, type:
p4 typemap
You’ll want to paste in the following typemap, and be sure to save.
text //....js text //....cs text //...shader text //....meta text+l //....cm text+l //....proc text+l //....md5mesh text+l //....md5anim text+l //....ma binary //....dll binary //....exe binary //....response binary //....lib binary //....pdb binary //....u binary //....ini binary //....stub binary //....ip binary+l //....prefab binary+l //....mb binary+l //....mat binary+l //....psb binary+l //....mp3 binary+l //....fbx binary+l //....unity binary+l //....asset binary+l //....aas binary+l //....tga binary+l //....jpg binary+l //....lwo binary+l //....wav binary+l //....ogg binary+l //....demo binary+l //....roq binary+l //....doc binary+l //....xls binary+l //....celtx binary+l //....pdf binary+l //....odt binary+l //....ods binary+l //....ppt binary+l //....skp binary+lS //....dds binary+lS //....bnk binary+lS //....light binary+lS //....shadow binary+lS //....ibl binary+lS //....bik binary+lS //....upk
The majority of the credit for this knowledge is not my own. Thanks to the following sites that contained most of this information:
In an effort to save myself (and anyone else) some time in case I need to set this up again later, I’ve compiled some notes on how to get a really quick development setup working on Snow Leopard (OS X 10.6)
Here’s yet another tip for Visual Studio 2005/2008 users. If your company enforces any sort of line limit, and you want to make yourself visually aware of when you may be approaching or dealing with that limit, add this key to your registry:
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor]
(New String Value) "Guides"="RGB(192,192,192) 110"
110 Being your line limit, and 9.0 being the version of your VS. (2005 users should find 8.0)
Restart VS and you’re good to go.