<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Programming on Jeremy&#39;s Variety Hour</title>
        <link>https://kennebel.com/categories/programming/</link>
        <description>Recent content in Programming on Jeremy&#39;s Variety Hour</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-us</language>
        <lastBuildDate>Sun, 15 Dec 2024 22:41:08 +0000</lastBuildDate><atom:link href="https://kennebel.com/categories/programming/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>Broadside #2, Working menus</title>
            <link>https://kennebel.com/2024/12/15/broadside-2-working-menus/</link>
            <pubDate>Sun, 15 Dec 2024 22:41:08 +0000</pubDate>
            <guid>https://kennebel.com/2024/12/15/broadside-2-working-menus/</guid>
            <description>&lt;p&gt;&lt;img alt=&#34;targets&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://kennebel.com/images/posts/2024/Broadside_20241214.gif&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;(the gif animation is a little choppy, but the actual execution of the effect is very smooth)&lt;/p&gt;&#xA;&lt;p&gt;Table of Contents&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Overview&lt;/li&gt;&#xA;&lt;li&gt;Scenes and Transitions&lt;/li&gt;&#xA;&lt;li&gt;Links&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;overview&#34;&gt;Overview&#xA;&lt;/h2&gt;&lt;p&gt;This round was focused on reorganizing the scenes in order to support a smoother transition from the Main menu area to the Battle view and back again.&lt;/p&gt;&#xA;&lt;h2 id=&#34;scenes-and-transitions&#34;&gt;Scenes and Transitions&#xA;&lt;/h2&gt;&lt;p&gt;While browsing various Godot resources online, I saw someone have this fade out/in effect when switching scenes, and I wanted to try to recreate it. I suspect I did this very differently from them, but it looks nice, so I think i&amp;rsquo;ll keep it (everything can be polished, but i&amp;rsquo;ll leave that for a later time when I&amp;rsquo;m stuck on something else). I pulled everything in to the main scene but I think in my next coding session I&amp;rsquo;ll work on separating the battle scene and code for better organization and more clear files. There will be a lot of custom stuff to deal with the configuration of a battleship and handling the battle itself.&lt;/p&gt;&#xA;&lt;p&gt;With this activity, I also learned about canvas layers. The first attempt correctly faded to black and back, but the Main Menu was still showing the whole time. This now works, because I changed the Overlay object &amp;ldquo;Canvas Layer&amp;rdquo; -&amp;gt; &amp;ldquo;Layer&amp;rdquo; to a higher number:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;targets&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://kennebel.com/images/posts/2024/Screenshot-from-2024-12-15-13-09-06.png&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;By default, all Canvas layer things start on Layer 1. The numbers force a sorting process where higher numbers are &amp;ldquo;on top&amp;rdquo; of lower numbers. Because this CanvasLayer contains a &amp;ldquo;Corlor Rect&amp;rdquo; that covers the whole screen, this covers everything, even the Main menu. :) The transition has an event call out at the halfway point, where the overlay is 100% opaque, which the main code uses to execute the switch over of the visual items. Hiding the main menu and rotating object, enabling the battle area, and triggering the random background star creation, and showing the battle menu.&lt;/p&gt;&#xA;&lt;h2 id=&#34;links&#34;&gt;Links&#xA;&lt;/h2&gt;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://godotengine.org/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;Godot Engine&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Github: ( broken link) &lt;a class=&#34;link&#34; href=&#34;https://github.com/kennebel/Broadside&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://github.com/kennebel/Broadside&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Specific Commit: ( broken link ) &lt;a class=&#34;link&#34; href=&#34;https://github.com/kennebel/Broadside/commit/3c993b274c5249f98da135b2685519a6c3c090c0&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://github.com/kennebel/Broadside/commit/3c993b274c5249f98da135b2685519a6c3c090c0&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</description>
        </item><item>
            <title>Broadside, Update #1 – Menus and Scenes (and files)</title>
            <link>https://kennebel.com/2024/12/11/broadside-update-1-menus-and-scenes-and-files/</link>
            <pubDate>Wed, 11 Dec 2024 14:36:00 +0000</pubDate>
            <guid>https://kennebel.com/2024/12/11/broadside-update-1-menus-and-scenes-and-files/</guid>
            <description>&lt;p&gt;&lt;img alt=&#34;Broadside menu animation&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://kennebel.com/images/posts/2024/Broadside_menu_20241210.gif&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Table of Contents&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Overview&lt;/li&gt;&#xA;&lt;li&gt;UI&amp;rsquo;s&lt;/li&gt;&#xA;&lt;li&gt;Resources&lt;/li&gt;&#xA;&lt;li&gt;Bonus: Godot File/Folder management&lt;/li&gt;&#xA;&lt;li&gt;Links&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;overview&#34;&gt;Overview&#xA;&lt;/h2&gt;&lt;p&gt;This update session, I worked on building a rudimentary user interface, and looked at how to switch between scenes. I also learned about the option to have Godot ignore a folder, so you can put files in the project, that won&amp;rsquo;t be a part of the development process.&lt;/p&gt;&#xA;&lt;h2 id=&#34;uis&#34;&gt;UI&amp;rsquo;s&#xA;&lt;/h2&gt;&lt;p&gt;&lt;img alt=&#34;Screenshot&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://kennebel.com/images/posts/2024/Screenshot-from-2024-12-10-14-16-41.png&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The Godot Engine combines a 2D rendering engine with a 3D rendering engine. By adding a &amp;ldquo;CanvasLayer&amp;rdquo; object in your 3D scene hierarchy (renamed to TopMenu here), you can add UI controls, manage their placement, and wire them up for actions. In this case, I used a &amp;ldquo;VBoxContainer&amp;rdquo;, which by default auto sizes based on content, and lays out each control vertically, in the order it is listed in the hierarchy.&lt;/p&gt;&#xA;&lt;p&gt;When you place a control, like the VBoxContainer, you will notice in the inspector, Layout Section, that there is a notification/warning message: &amp;ldquo;This node doesn&amp;rsquo;t have a control parent&amp;rdquo;. All this means is that the placement is entirely on the settings you provide, rather than inheriting the location, anchors, and all that. This will not impact the functionality of the control at all. It is safe to ignore that and move on if you know it is supposed to not have a parent Control managing it.&lt;/p&gt;&#xA;&lt;p&gt;For the scene with the ships, i used the HBoxContainer to easily place the buttons horizontally along the top.&lt;/p&gt;&#xA;&lt;p&gt;With the buttons set up, I was able to switch between scenes easily!&lt;/p&gt;&#xA;&lt;h2 id=&#34;resources&#34;&gt;Resources&#xA;&lt;/h2&gt;&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;https://docs.godotengine.org/en/stable/tutorials/scripting/resources.html&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://docs.godotengine.org/en/stable/tutorials/scripting/resources.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;A resource file is a way to have data accessible to Godot scripts, while avoiding the usual problems of data storage and &lt;a class=&#34;link&#34; href=&#34;https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;ORM&lt;/a&gt; issues. This allows you to create a class to store data, have the system save the information directly from the class. I have set one up, but haven&amp;rsquo;t tried to save/reload data over multiple sessions yet.&lt;/p&gt;&#xA;&lt;h2 id=&#34;bonus-godot-filefolder-management&#34;&gt;Bonus: Godot File/Folder management&#xA;&lt;/h2&gt;&lt;p&gt;In the documentation, there is a section called &lt;a class=&#34;link&#34; href=&#34;https://docs.godotengine.org/en/stable/tutorials/best_practices/project_organization.html#ignoring-specific-folders&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;Project organization&lt;/a&gt;, which covers some basic folder strategies. More importantly, it mentions the fact that if you add an empty file called &amp;ldquo;.gdignore&amp;rdquo;, the Godot Editor will ignore that folder. This means that it will not show up in the Editor UI, and it will not try to &amp;ldquo;import&amp;rdquo; anything in that folder. Since I created a folder to save progress screenshots, and they were being brought in to the game unnecessarily, this was a great find. 🙂&lt;/p&gt;&#xA;&lt;h2 id=&#34;links&#34;&gt;Links&#xA;&lt;/h2&gt;&lt;ul&gt;&#xA;&lt;li&gt;Godot Engine: &lt;a class=&#34;link&#34; href=&#34;https://godotengine.org/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://godotengine.org/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Godot Docs: &lt;a class=&#34;link&#34; href=&#34;https://docs.godotengine.org/en/stable/tutorials/best_practices/project_organization.html#ignoring-specific-folders&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;Project Organization&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Github: ( broken link ) &lt;a class=&#34;link&#34; href=&#34;https://github.com/kennebel/Broadside&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://github.com/kennebel/Broadside&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Specific Commit: ( broken link ) &lt;a class=&#34;link&#34; href=&#34;https://github.com/kennebel/Broadside/commit/2c2efe1b693fa05579cd4310a4b4fa606e7f20e0&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://github.com/kennebel/Broadside/commit/2c2efe1b693fa05579cd4310a4b4fa606e7f20e0&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</description>
        </item><item>
            <title>Broadside, Update #0 – Trying out Godot</title>
            <link>https://kennebel.com/2024/12/08/broadside-update-0-trying-out-godot/</link>
            <pubDate>Mon, 09 Dec 2024 02:43:02 +0000</pubDate>
            <guid>https://kennebel.com/2024/12/08/broadside-update-0-trying-out-godot/</guid>
            <description>&lt;p&gt;Godot Engine is similar to Unity and Unreal Engine, but is completely open source.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;https://godotengine.org&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://godotengine.org&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Project Overview&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/kennebel/Broadside&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;https://github.com/kennebel/Broadside&lt;/a&gt; ( to be restored later )&lt;/p&gt;&#xA;&lt;p&gt;After a more than a decade of using Unity personally and professionally, I have decided to try out Godot.&lt;/p&gt;&#xA;&lt;p&gt;I played with Godot and GDScript a little, but I felt like i was fighting the alternate syntax rather than focusing on learning the new game engine technology. So I have decided to make an honest effort project with Godot and C# as the underlying language. Maybe I&amp;rsquo;ll give GDScript another go later. Instead of trying to learn multiple things at once, let&amp;rsquo;s focus on one thing at a time. :)&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Short concept&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Cartoony sci-fi battle of two capital ships with a variety of weapons. Idea to provide a &amp;rsquo;load out&amp;rsquo; option to pick your weapons, have an enemy randomly generated, then slug it out until one side blows up. :) Still working out UI and control concepts.&lt;/p&gt;&#xA;&lt;p&gt;I don&amp;rsquo;t expect this project to go far, but I should learn several things:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Basic UI&lt;/li&gt;&#xA;&lt;li&gt;Enemy behaviors&lt;/li&gt;&#xA;&lt;li&gt;Special Effects&lt;/li&gt;&#xA;&lt;li&gt;Localization&lt;/li&gt;&#xA;&lt;li&gt;File ingesting (json config of game resources)&lt;/li&gt;&#xA;&lt;li&gt;(if i get far enough) Multiplayer&lt;/li&gt;&#xA;&lt;li&gt;Interesting base to explore a VR port (most VR things I&amp;rsquo;ve seen are first person, might be neat to explore a VR &amp;lsquo;overhead&amp;rsquo; UX)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;THe initial start has been promising, as I was able to instantiate the equivalent of the Unity Prefab concept via the overarching &amp;lsquo;scene&amp;rsquo; concept, and make a highly inefficient random star back drop. :)&lt;/p&gt;&#xA;&lt;p&gt;&lt;img alt=&#34;targets&#34; loading=&#34;lazy&#34; sizes=&#34;(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px&#34; src=&#34;https://kennebel.com/images/posts/2024/Screenshot-from-2024-12-08-18-06-54.png&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The project is available publicly under an Apache 2.0 license so that anyone can learn along with me. :)&lt;/p&gt;&#xA;&lt;p&gt;More to come as I document what I learn.&lt;/p&gt;&#xA;</description>
        </item><item>
            <title>WordPress error “The response is not a valid JSON response”</title>
            <link>https://kennebel.com/2024/11/13/wordpress-error-the-response-is-not-a-valid-json-response/</link>
            <pubDate>Wed, 13 Nov 2024 14:05:00 +0000</pubDate>
            <guid>https://kennebel.com/2024/11/13/wordpress-error-the-response-is-not-a-valid-json-response/</guid>
            <description>&lt;p&gt;So, while installing WordPress on my server, ran across an error when trying to save page edits:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;    The response is not a valid JSON response&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;All of the articles and help docs I could find online were unable to help. The reason is because the articles all presumed that you are running Apache for the web server. However, I am running NGINX, which requires a slightly different solution.&lt;/p&gt;&#xA;&lt;p&gt;From the following site: &lt;a class=&#34;link&#34; href=&#34;https://www.cyberciti.biz/faq/how-to-configure-nginx-for-wordpress-permalinks/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;&#xA;    &gt;nixCraft&lt;/a&gt;, found two tweaks to your /etc/nginx/sites-available config file based on if WordPress is on the main domain/subdomain or if you have it installed in a subfolder.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Domain/Subdomain&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;location / {&#xA;            try_files $uri $uri/ /index.php?$args;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Subfolder&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;location /blog/ {&#xA;            try_files $uri $uri/ /blog/index.php?$args;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This REPLACES the portion you will find in other articles talking about .htaccess, as that is not in use with NGINX, but this change accomplishes the same thing.&lt;/p&gt;&#xA;&lt;p&gt;So if you hit the error that sounds like it has nothing to do with the fix, that is IT life. 🙂&lt;/p&gt;&#xA;</description>
        </item></channel>
</rss>
