{"action":"created","issue":{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3297","labels_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3297/labels{/name}","comments_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3297/comments","events_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3297/events","html_url":"https://github.com/pioneerspacesim/pioneer/pull/3297","id":53177343,"number":3297,"title":"Bundle Collision with SGM file","user":{"login":"fluffyfreak","id":825083,"avatar_url":"https://avatars.githubusercontent.com/u/825083?v=3","gravatar_id":"","url":"https://api.github.com/users/fluffyfreak","html_url":"https://github.com/fluffyfreak","followers_url":"https://api.github.com/users/fluffyfreak/followers","following_url":"https://api.github.com/users/fluffyfreak/following{/other_user}","gists_url":"https://api.github.com/users/fluffyfreak/gists{/gist_id}","starred_url":"https://api.github.com/users/fluffyfreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluffyfreak/subscriptions","organizations_url":"https://api.github.com/users/fluffyfreak/orgs","repos_url":"https://api.github.com/users/fluffyfreak/repos","events_url":"https://api.github.com/users/fluffyfreak/events{/privacy}","received_events_url":"https://api.github.com/users/fluffyfreak/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/labels/Art","name":"Art","color":"A0FFA0"},{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/labels/Build","name":"Build","color":"E04000"},{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/labels/Model%20system","name":"Model system","color":"DDDDDD"},{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/labels/Optimization","name":"Optimization","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2014-12-31T10:23:56Z","updated_at":"2015-02-02T07:53:35Z","closed_at":"2015-01-01T15:47:49Z","pull_request":{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/pulls/3297","html_url":"https://github.com/pioneerspacesim/pioneer/pull/3297","diff_url":"https://github.com/pioneerspacesim/pioneer/pull/3297.diff","patch_url":"https://github.com/pioneerspacesim/pioneer/pull/3297.patch"},"body":"# Description:\r\nWe have an optimised & preprocessed file format called SGM that was written by Luomu but, for some reason, we don't ship SGM files in with the main distribution. Part of that reason was that it helped loading times a lot but not as much as it could have due to the collision mesh generation being excluded from it.\r\n\r\nWith the merging of #3099 giving us 3 very complex new space stations and very complex collision meshes I've tried to add support for serialising and deserialising the collision meshes into our SGM format.\r\n\r\n## Distribution:\r\nWith this change it would make sense to build the `.SGM` files in-place, delete the `.DAE` from the build and only have them in Git and `pioneer-assets`. \r\nThis way players don't have to worry about having the correct files or building `.SGM` versions.\r\n\r\n# Loading times:\r\nA quick comparison, please note that this is done on my laptop with a 512GiB SSD so there's little variation due to disk access, but possibly some due to thermal throttling/behaviour.\r\n\r\n## SGM Load times:\r\nI did 3 runs and the times were\r\n* Loading took: 23865.460385 milliseconds\r\n* Loading took: 23486.056590 milliseconds\r\n* Loading took: 23832.089322 milliseconds\r\nFor an average of **~23727.87** milliseconds.\r\n\r\n## Standard Load times:\r\nOnce again but with no SGM files.\r\n* Loading took: 128687.466982 milliseconds\r\n* Loading took: 126967.270705 milliseconds\r\n* Loading took: 126556.816863 milliseconds\r\nFor an average of **~127403.85** milliseconds\r\n\r\n## Result:\r\nThis means that using SGM files with the collision mesh data results in the game loading to the intro screen **~5.37** times faster.\r\n\r\n# At the Command line:\r\n**WARNING**: The SGM files this creates will be chosen in preference to the original data in future so you might miss updates to files. Best to delete all of these SGM files after experimenting with this **WARNING**\r\n\r\nTo recreate the SGM files you just need to build the ModelCompiler, this should be shipped with the binaries versions, or you can build it yourself. It's built alongside Pioneer.\r\nSimply go to the Pioneer folder where ModelCompiler & Pioneer reside, open a prompt / terminal and enter something like: `modelcompiler -b inplace`\r\nThat will create an SGM file for every model in the game and place it next to it's `.model` file.\r\n\r\n# Status:\r\nWorth testing, as I've just fixed the bug I had caused and collision now works again. Loads fast and works!\r\n\r\nI've chosen to **compress** all of the SGM files the modelcompilier produces as this results in a reduction from ~132MB down to just ~39.5MB which is a significant reduction. It does have a negative impact on the loading times, raising it from an average 20 seconds to 24 seconds. However I think this is more than worth it.\r\n\r\nAndy"},"comment":{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/comments/72417629","html_url":"https://github.com/pioneerspacesim/pioneer/pull/3297#issuecomment-72417629","issue_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3297","id":72417629,"user":{"login":"impaktor","id":619390,"avatar_url":"https://avatars.githubusercontent.com/u/619390?v=3","gravatar_id":"","url":"https://api.github.com/users/impaktor","html_url":"https://github.com/impaktor","followers_url":"https://api.github.com/users/impaktor/followers","following_url":"https://api.github.com/users/impaktor/following{/other_user}","gists_url":"https://api.github.com/users/impaktor/gists{/gist_id}","starred_url":"https://api.github.com/users/impaktor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/impaktor/subscriptions","organizations_url":"https://api.github.com/users/impaktor/orgs","repos_url":"https://api.github.com/users/impaktor/repos","events_url":"https://api.github.com/users/impaktor/events{/privacy}","received_events_url":"https://api.github.com/users/impaktor/received_events","type":"User","site_admin":false},"created_at":"2015-02-02T07:53:35Z","updated_at":"2015-02-02T07:53:35Z","body":"> so I've deleted everything before December\r\n\r\nWe sometimes* refer players to older builds, in particular to the last OpenGL 2.1 build:\r\n\r\n\r\nhttp://sourceforge.net/projects/pioneerspacesim/files/pioneer-20141118-win32.7z/download\r\nhttp://sourceforge.net/projects/pioneerspacesim/files/pioneer-20141118-linux64.tar.bz2/download\r\nhttp://sourceforge.net/projects/pioneerspacesim/files/pioneer-20141118-linux32.tar.bz2/download\r\nhttp://sourceforge.net/projects/pioneerspacesim/files/pioneer-20140919-osx.zip/download\r\n\r\n_*In IRC, on the FAQ, and from Andy's blog_"}}