{"id":1219,"date":"2015-01-05T04:42:44","date_gmt":"2015-01-05T04:42:44","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=1219"},"modified":"2015-01-05T04:47:23","modified_gmt":"2015-01-05T04:47:23","slug":"p-152-virtual-world-concept-update-28-spherical-terrain-polysoup-collision-update-4","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p-152-virtual-world-concept-update-28-spherical-terrain-polysoup-collision-update-4\/","title":{"rendered":"P-152: Virtual World Concept Update 28: Spherical Terrain: Polysoup Collision Update 4"},"content":{"rendered":"<p>I now have working player collision! This took a lot longer than I expected, and there is still quite a bit of work needed to clean this up, but it is working well.<\/p>\n<p>The problem was that a variable was not being updated on the server, only on the client, and so the server didn&#8217;t have access to the polylist for the collision calculations. This is now fixed.<\/p>\n<p>I can now begin work on large terrains, and optimisation of the collision system and rendering. I need to implement a system which only renders and collides with the polygons close to the player, and then updates these polys as the player walks around the surface of the planet.<\/p>\n<p>I also need to deal with the famous 10,000 unit problem in Torque. Torque uses 32-bit floats to store position transforms, and when the player gets to about 10,000 units from the origin, these 32-bit values lose precision, and this causes a noticeable &#8220;jitter&#8221; effect. To deal with this, I would either have to replace all of the 32-bit floats with 64-bit floats, which would require major reworking of the engine, or, implement a system where the player actually remains at the origin, and the world moves around them.<\/p>\n<p>This system is the one that I used in my Icarus Rocket Simulator, and it works quite well. This project is multiplayer however, which does make things more complex, since I will need absolute coordinates on the server (in the database) and I will need to translate those to local coordinates for each player (centered about the origin).<\/p>\n<p><a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/01\/PhoenixGameDevelopment04-Jan.-05-01.36.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1218\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/01\/PhoenixGameDevelopment04-Jan.-05-01.36-300x232.jpg\" alt=\"PhoenixGameDevelopment04 Jan. 05 01.36\" width=\"300\" height=\"232\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/01\/PhoenixGameDevelopment04-Jan.-05-01.36-300x232.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/01\/PhoenixGameDevelopment04-Jan.-05-01.36-1024x793.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/01\/PhoenixGameDevelopment04-Jan.-05-01.36.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I now have working player collision! This took a lot longer than I expected, and there is still quite a bit of work needed to clean this up, but it is working well. The problem was that a variable was not being updated on the server, only on the client, and so the server didn&#8217;t [&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,10,11],"tags":[],"class_list":["post-1219","post","type-post","status-publish","format-standard","hentry","category-astral-realms","category-software-and-games","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\/1219"}],"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=1219"}],"version-history":[{"count":3,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1219\/revisions"}],"predecessor-version":[{"id":1222,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1219\/revisions\/1222"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=1219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=1219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=1219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}