{"id":2295,"date":"2016-02-04T03:23:33","date_gmt":"2016-02-04T03:23:33","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=2295"},"modified":"2016-02-04T03:25:05","modified_gmt":"2016-02-04T03:25:05","slug":"p-0-virtual-world-concept-update-6-performance-testing-and-optimisation-of-multi-part-meshes","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p-0-virtual-world-concept-update-6-performance-testing-and-optimisation-of-multi-part-meshes\/","title":{"rendered":"P-0: Virtual World Concept: Update 6: Performance testing and optimisation of multi-part meshes"},"content":{"rendered":"<p>I spent some time today conducting some tests on large numbers of objects in torque. For my project, I intend to allow the user to combine many simple meshes together to make more complex meshes. So, a complex building might be modelled from individual wall segments, floor panels, doors, windows, etc, instead of being one large structure. The problem with this is that I suspected that loading many meshes would cause a far greater performance hit than loading one single one.<\/p>\n<p>Based on some testing that I did, it turns out that I was right.<\/p>\n<p>I conducted a very simple test. I created some spheres in a modelling tool, with a known number of polys. One high res sphere, with 10082 polys, one medium resolution at 1058, and one low res at 105.<\/p>\n<p>I then wrote three drawing functions, which I executed separately:<\/p>\n<p>Test 1: Draw 512 of the high res spheres (512*10082 = 5,161,984 polys),<\/p>\n<p>Test 2: Draw 4,913 of the medium res spheres (4913*1058 = 5,197,954)<\/p>\n<p>Test 3: Draw 46,656 of the low res spheres (46.656 * 105 = 4,898,880)<\/p>\n<p>Since the polycount is quite similar in all cases, the FPS should be similar too, but it isnt. With nothing at all rendering, the polycount is about 200, after Test 1 (512 polys) the FPS is about 50, with all polys in view. However, Test 2, in the same conditions, produces a poly count of 9.3, and Test 3 wasnt really conclusive due to issues drawing all of those objects, but it was giving me about 5-9 fps, depending on the angle I looked at the objects at.<\/p>\n<p>I was also getting script warnings about &#8220;too many ghosts&#8221; from NetConnection, so, clearly, there is an issue here. The problem now will be deciding how to fix it. The polycount isn&#8217;t the problem, with 512 objects and over 5 million polys on screen I get an easy 50 FPS in debug build. The problem is optimising the system to draw many small objects as quickly as one large one.<\/p>\n<p>The main issues that I can imagine would slow this system down would be collision calculations for each objects, and network updates for each objects, but for this test, I used a single player game with no collision objects set, just simple TSStatic objects.<\/p>\n<p>I haven&#8217;t finished my testing, but this will likely be a difficult challenge to overcome.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2305\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_40_09-PM-300x234.png\" alt=\"PhoenixGameDevelopment - 03_02_2016 , 11_40_09 PM\" width=\"300\" height=\"234\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_40_09-PM-300x234.png 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_40_09-PM-768x599.png 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_40_09-PM-1024x798.png 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_40_09-PM.png 1026w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2304\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_40_16-PM-300x234.png\" alt=\"PhoenixGameDevelopment - 03_02_2016 , 11_40_16 PM\" width=\"300\" height=\"234\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_40_16-PM-300x234.png 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_40_16-PM-768x599.png 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_40_16-PM-1024x798.png 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_40_16-PM.png 1026w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2303\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_44_20-PM-300x234.png\" alt=\"PhoenixGameDevelopment - 03_02_2016 , 11_44_20 PM\" width=\"300\" height=\"234\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_44_20-PM-300x234.png 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_44_20-PM-768x599.png 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_44_20-PM-1024x798.png 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-03_02_2016-11_44_20-PM.png 1026w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2302\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-12_48_02-AM-300x234.png\" alt=\"PhoenixGameDevelopment - 04_02_2016 , 12_48_02 AM\" width=\"300\" height=\"234\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-12_48_02-AM-300x234.png 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-12_48_02-AM-768x599.png 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-12_48_02-AM-1024x798.png 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-12_48_02-AM.png 1026w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2301\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_37_01-AM-300x234.png\" alt=\"PhoenixGameDevelopment - 04_02_2016 , 01_37_01 AM\" width=\"300\" height=\"234\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_37_01-AM-300x234.png 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_37_01-AM-768x599.png 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_37_01-AM-1024x798.png 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_37_01-AM.png 1026w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2300\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_37_15-AM-300x234.png\" alt=\"PhoenixGameDevelopment - 04_02_2016 , 01_37_15 AM\" width=\"300\" height=\"234\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_37_15-AM-300x234.png 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_37_15-AM-768x599.png 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_37_15-AM-1024x798.png 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_37_15-AM.png 1026w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2299\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_39_12-AM-300x234.png\" alt=\"PhoenixGameDevelopment - 04_02_2016 , 01_39_12 AM\" width=\"300\" height=\"234\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_39_12-AM-300x234.png 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_39_12-AM-768x599.png 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_39_12-AM-1024x798.png 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/02\/PhoenixGameDevelopment-04_02_2016-01_39_12-AM.png 1026w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I spent some time today conducting some tests on large numbers of objects in torque. For my project, I intend to allow the user to combine many simple meshes together to make more complex meshes. So, a complex building might be modelled from individual wall segments, floor panels, doors, windows, etc, instead of being one [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,17,15,11],"tags":[],"class_list":["post-2295","post","type-post","status-publish","format-standard","hentry","category-astral-realms","category-p-0","category-servers-and-networking","category-spiritus-astrum","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"aioseo_notices":[],"builder_content":"","_links":{"self":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/2295"}],"collection":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/comments?post=2295"}],"version-history":[{"count":6,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/2295\/revisions"}],"predecessor-version":[{"id":2309,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/2295\/revisions\/2309"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=2295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=2295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=2295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}