{"id":102,"date":"2022-11-15T06:51:12","date_gmt":"2022-11-15T06:51:12","guid":{"rendered":"https:\/\/trew.tk\/blog\/?p=102"},"modified":"2023-12-05T09:34:46","modified_gmt":"2023-12-05T09:34:46","slug":"golf-demo-colorful-names","status":"publish","type":"post","link":"https:\/\/trewest.dev\/blog\/index.php\/2022\/11\/15\/golf-demo-colorful-names\/","title":{"rendered":"Golf Demo &#8211; Colorful Names"},"content":{"rendered":"<div class=\"wp-post-series-box series-golf-demo wp-post-series-box--expandable\">\n\t\t\t<input id=\"collapsible-series-golf-demo69dedeefb62b8\" class=\"wp-post-series-box__toggle_checkbox\" type=\"checkbox\">\n\t\n\t<label\n\t\tclass=\"wp-post-series-box__label\"\n\t\t\t\t\tfor=\"collapsible-series-golf-demo69dedeefb62b8\"\n\t\t\ttabindex=\"0\"\n\t\t\t\t>\n\t\t<p class=\"wp-post-series-box__name wp-post-series-name\">\n\t\t\tThis is post 3 of 5 in the series <em>&ldquo;Golf Demo&rdquo;<\/em>\t\t<\/p>\n\t\t\t<\/label>\n\n\t\t\t<div class=\"wp-post-series-box__posts\">\n\t\t\t<ol>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/trewest.dev\/blog\/index.php\/2022\/10\/27\/golf-demo-part-one\/\">Golf Demo &#8211; Part One<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/trewest.dev\/blog\/index.php\/2022\/11\/12\/golf-demo-scoreboard\/\">Golf Demo &#8211; Scoreboard<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><span class=\"wp-post-series-box__current\">Golf Demo &#8211; Colorful Names<\/span><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/trewest.dev\/blog\/index.php\/2022\/12\/09\/golf-demo-finale\/\">Golf Demo &#8211; Finale<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/trewest.dev\/blog\/index.php\/2023\/01\/15\/project-golf-demo\/\">Project: Golf Demo<\/a><\/li>\n\t\t\t\t\t\t\t<\/ol>\n\t\t<\/div>\n\t<\/div>\n\n<p>Today I did a bit of networking work to add Colors to the Golf Balls!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"519\" height=\"392\" src=\"https:\/\/trew.tk\/blog\/wp-content\/uploads\/2022\/11\/image.png\" alt=\"\" class=\"wp-image-103\" srcset=\"https:\/\/trewest.dev\/blog\/wp-content\/uploads\/2022\/11\/image.png 519w, https:\/\/trewest.dev\/blog\/wp-content\/uploads\/2022\/11\/image-300x227.png 300w\" sizes=\"auto, (max-width: 519px) 100vw, 519px\" \/><figcaption>Two differently colored Golf Balls<\/figcaption><\/figure>\n\n\n\n<p>And they&#8217;re even synced to each client!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/trew.tk\/blog\/wp-content\/uploads\/2022\/11\/image-1.png\" alt=\"\" class=\"wp-image-104\" width=\"666\" height=\"599\" srcset=\"https:\/\/trewest.dev\/blog\/wp-content\/uploads\/2022\/11\/image-1.png 746w, https:\/\/trewest.dev\/blog\/wp-content\/uploads\/2022\/11\/image-1-300x270.png 300w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><figcaption>Two different clients with working synced colors<\/figcaption><\/figure>\n\n\n\n<p>There&#8217;s been a lot of frustration in getting this working- First since Game Objects cant be serialized over the network I had to find a good way to target it, in a way that both sides know what is what, which is a little harder than it seemed.  Eventually though after getting frustrated by trying to do it myself, I ended up using the Networked Object ID&#8217;s built into the Netcode package to identify everything which worked out great.  The big issue before was syncing all the ids I was trying to make myself in a quick starting thread of the game object in the middle of initialization which just didn&#8217;t work.  <\/p>\n\n\n\n<p>The other thing I added was Names!  Players can now choose a name to identify themselves by.  I had this working fully before but after tinkering a while I accidentally broke it so currently only the host&#8217;s name is shown but that&#8217;ll be fixed soon. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"497\" src=\"https:\/\/trew.tk\/blog\/wp-content\/uploads\/2022\/11\/image-2-1024x497.png\" alt=\"\" class=\"wp-image-105\" srcset=\"https:\/\/trewest.dev\/blog\/wp-content\/uploads\/2022\/11\/image-2-1024x497.png 1024w, https:\/\/trewest.dev\/blog\/wp-content\/uploads\/2022\/11\/image-2-300x146.png 300w, https:\/\/trewest.dev\/blog\/wp-content\/uploads\/2022\/11\/image-2-768x373.png 768w, https:\/\/trewest.dev\/blog\/wp-content\/uploads\/2022\/11\/image-2.png 1290w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Don&#8217;t worry about the random text in the view, that was for testing stuff earlier<\/figcaption><\/figure>\n\n\n\n<p>So sadly the other player&#8217;s names don&#8217;t show.  A bit of a shame but hey what can you do?  Also to power these I had to finish up some User Interface stuff, such as the settings menu.  The settings menu works both in game and in the main menu, allowing players to change name and color whenever they want.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"522\" height=\"418\" src=\"https:\/\/trew.tk\/blog\/wp-content\/uploads\/2022\/11\/image-3.png\" alt=\"\" class=\"wp-image-106\" srcset=\"https:\/\/trewest.dev\/blog\/wp-content\/uploads\/2022\/11\/image-3.png 522w, https:\/\/trewest.dev\/blog\/wp-content\/uploads\/2022\/11\/image-3-300x240.png 300w\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" \/><\/figure>\n\n\n\n<p>Some pretty neat stuff, maybe it was worth the hair pulling.  The project is rapidly approaching the point where I said it&#8217;d probably be called complete, according to my <em>super-official<\/em> Post-It note todo list I only really have to make a menu to connect to a remote server, and make a menu to set up a dedicated server which would literally just be changing which port the host listens on.  After that I have a choice to make, whether or not I make a &#8220;Proper&#8221; level for it.  Which to me would mean a lot more work.  Because I&#8217;d feel as if I&#8217;d have to make the whole game match the quality of the level.  That&#8217;d include: Adding Sound effects, Music, more features(in game chat, for instance), a better looking UI, etc.  And then making the level would require a lot of work designing, sourcing models, etc. in addition to testing and other things.  Needless to say it&#8217;s not a decision I take lightly, especially for a project I chose to learn with.   But also all of that would display my skill level and effort that I put into my projects, which is also important since this is a piece of my portfolio.  Maybe after I&#8217;m done with it I&#8217;ll take a nice break and clear my mind with another project.  I have a few ideas of what to do but hopefully it&#8217;ll have a little less networking.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"485\" height=\"1024\" src=\"https:\/\/trew.tk\/blog\/wp-content\/uploads\/2022\/11\/20221115_014043-485x1024.jpg\" alt=\"\" class=\"wp-image-108\" srcset=\"https:\/\/trewest.dev\/blog\/wp-content\/uploads\/2022\/11\/20221115_014043-485x1024.jpg 485w, https:\/\/trewest.dev\/blog\/wp-content\/uploads\/2022\/11\/20221115_014043-142x300.jpg 142w, https:\/\/trewest.dev\/blog\/wp-content\/uploads\/2022\/11\/20221115_014043-rotated.jpg 704w\" sizes=\"auto, (max-width: 485px) 100vw, 485px\" \/><figcaption>The <em>Super-Official Post-It Note<\/em> Todo List<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This is post 3 of 5 in the series &ldquo;Golf Demo&rdquo; Golf Demo &#8211; Part One Golf Demo &#8211; Scoreboard Golf Demo &#8211; Colorful Names Golf Demo &#8211; Finale Project: &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5,23,8],"tags":[12,13,14,21,15,7],"post_series":[68],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-coding","category-gamedev","category-golf-demo","category-project","tag-code","tag-development","tag-game-dev","tag-golf","tag-project","tag-unity","post_series-golf-demo"],"_links":{"self":[{"href":"https:\/\/trewest.dev\/blog\/index.php\/wp-json\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trewest.dev\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trewest.dev\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trewest.dev\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trewest.dev\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":2,"href":"https:\/\/trewest.dev\/blog\/index.php\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":110,"href":"https:\/\/trewest.dev\/blog\/index.php\/wp-json\/wp\/v2\/posts\/102\/revisions\/110"}],"wp:attachment":[{"href":"https:\/\/trewest.dev\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trewest.dev\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trewest.dev\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=102"},{"taxonomy":"post_series","embeddable":true,"href":"https:\/\/trewest.dev\/blog\/index.php\/wp-json\/wp\/v2\/post_series?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}