Search code examples
unity-game-engineperforceunreal-engine4p4vunreal-engine5

Perforce Typemap when using both Unity and Unreal?


I am currently administrating a Perforce server that consists of both Unity groups as well as Unreal groups. I am pretty new to Perforce, my experience is with Git.

I am looking into modfiying the typemap to work for Unreal and Unity - but there might be areas where certain files are needed for one engine but not for the other.

So my question is - what would be the best way to modify the typemap so that any depot on this server could work with either engine?

The second question is - would it be possible to have different typemaps for different depots?


Solution

  • Per the Unreal doc:

    https://docs.unrealengine.com/5.0/en-US/using-perforce-as-source-control-for-unreal-engine/

    you want a typemap of:

                    binary+w //....exe
                    binary+w //....dll
                    binary+w //....lib
                    binary+w //....app
                    binary+w //....dylib
                    binary+w //....stub
                    binary+w //....ipa
                    binary //....bmp
                    text //....ini
    

    and per this Perforce KB article on Unity:

    https://portal.perforce.com/s/article/15244

    the recommended typemaps for Unity files are:

       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
    

    There are some conflicts in there -- e.g. Unity's .ini files want to be binary whereas Unreal's .ini want to be text. As you suggest, though, that's easily resolved by just scoping the two sections of the typemap to different depots. Assuming you have two depots called "unity" and "unreal" you'd just do:

        binary+w //unreal/....app
        binary+w //unreal/....dll
        binary+w //unreal/....dylib
        binary+w //unreal/....exe
        binary+w //unreal/....ipa
        binary+w //unreal/....lib
        binary+w //unreal/....stub
        binary //unreal/....bmp
        text //unreal/....ini
        text //unity/....cs
        text //unity/....js
        text //unity/....meta
        text //unity/...shader
        text+l //unity/....cm
        text+l //unity/....ma
        text+l //unity/....md5anim
        text+l //unity/....md5mesh
        text+l //unity/....proc
        binary //unity/....dll
        binary //unity/....exe
        binary //unity/....ini
        binary //unity/....ip
        binary //unity/....response
        binary //unity/....lib
        binary //unity/....pdb
        binary //unity/....stub
        binary //unity/....u
        binary+l //unity/....prefab
        binary+l //unity/....mb
        binary+l //unity/....mat
        binary+l //unity/....psb
        binary+l //unity/....mp3
        binary+l //unity/....fbx
        binary+l //unity/....unity
        binary+l //unity/....asset
        binary+l //unity/....aas
        binary+l //unity/....tga
        binary+l //unity/....jpg
        binary+l //unity/....lwo
        binary+l //unity/....wav
        binary+l //unity/....ogg
        binary+l //unity/....demo
        binary+l //unity/....roq
        binary+l //unity/....doc
        binary+l //unity/....xls
        binary+l //unity/....celtx
        binary+l //unity/....pdf
        binary+l //unity/....odt
        binary+l //unity/....ods
        binary+l //unity/....ppt
        binary+l //unity/....skp
        binary+lS //unity/....dds
        binary+lS //unity/....bnk
        binary+lS //unity/....light
        binary+lS //unity/....shadow
        binary+lS //unity/....ibl
        binary+lS //unity/....bik
        binary+lS //unity/....upk
    

    This can also be done at the folder level, you can use wildcard patterns to cover multiple depots that follow a similar naming convention, etc.