{"id":9588,"date":"2023-03-05T23:59:37","date_gmt":"2023-03-05T23:59:37","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=9588"},"modified":"2023-03-06T00:07:09","modified_gmt":"2023-03-06T00:07:09","slug":"p0-b4-part-1209-traffic-system","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p0-b4-part-1209-traffic-system\/","title":{"rendered":"P0-B4: Part 1209: Traffic System"},"content":{"rendered":"\n<p>The idea that I had to solve the direction of travel problem seems to work, but it was more complex that I thought.<\/p>\n\n\n\n<p>Searching for the nearest intersection node in the grid was quite complex, especially when I needed to make sure that it was an intersection with no obstructions (such as buildings, etc) in between.<\/p>\n\n\n\n<p>I was eventually able to solve this, but there were still other minor issues relating to collisions between vehicles, etc.<\/p>\n\n\n\n<p>I also had to add a solution for a situation where the AI could no longer travel in any direction. To resolve this case, I simply had the AI change lanes if there was no path possible on their current lane.<\/p>\n\n\n\n<p>This solution now works reasonably well.<\/p>\n\n\n\n<p>There are still some minor issues to fix, and I still need to add some simple placeholder art, but the main work on this seems to be done.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The idea that I had to solve the direction of travel problem seems to work, but it was more complex that I thought. Searching for the nearest intersection node in the grid was quite complex, especially when I needed to make sure that it was an intersection with no obstructions (such as buildings, etc) in [&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,32,17,31,10,11],"tags":[],"class_list":["post-9588","post","type-post","status-publish","format-standard","hentry","category-astral-realms","category-meridian","category-p-0","category-p0_b4","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\/9588"}],"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=9588"}],"version-history":[{"count":2,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/9588\/revisions"}],"predecessor-version":[{"id":9595,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/9588\/revisions\/9595"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=9588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=9588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=9588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}