diff --git a/_includes/_header.njk b/_includes/_header.njk new file mode 100644 index 0000000..f57a353 --- /dev/null +++ b/_includes/_header.njk @@ -0,0 +1,4 @@ + +
+

runtimefee.lol

+
diff --git a/_includes/layouts/base.njk b/_includes/layouts/base.njk deleted file mode 100644 index 427c4d0..0000000 --- a/_includes/layouts/base.njk +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: runtimefee.lol ---- - - - - - - - - {{ title }} - - - {{ content | safe }} - - diff --git a/_includes/layouts/home.njk b/_includes/layouts/home.njk index 2770e50..af6b4f8 100644 --- a/_includes/layouts/home.njk +++ b/_includes/layouts/home.njk @@ -7,10 +7,10 @@ title: runtimefee.lol - Homepage - + {{ title }} - {{ content | safe }} + {% include "_header.njk" %} {{ content | safe }} diff --git a/_includes/layouts/post.njk b/_includes/layouts/post.njk index 6f9bfdc..457dc4d 100644 --- a/_includes/layouts/post.njk +++ b/_includes/layouts/post.njk @@ -7,10 +7,13 @@ title: runtimefee.lol - - Post: {{ title }} + + runtimefee.lol - {{ title }} + {% include "_header.njk" %} + +

{{ title }}

{{ content | safe }} diff --git a/content/blog/blog.11tydata.js b/content/blog/blog.11tydata.js index 3cd36cb..a7128c9 100644 --- a/content/blog/blog.11tydata.js +++ b/content/blog/blog.11tydata.js @@ -1,4 +1,7 @@ export default { tags: ["posts"], + type: "recommendation", + title: "UNTITLED", layout: "layouts/post.njk", + date: "Created", }; diff --git a/content/blog/cool-starter-projects.md b/content/blog/cool-starter-projects.md new file mode 100644 index 0000000..f99930b --- /dev/null +++ b/content/blog/cool-starter-projects.md @@ -0,0 +1,10 @@ +--- +title: Cool Starter Projects +tags: ["Godot", "Projects", "Game Engine"] +--- + +Some of the best projects to start your game dev journey! + + + +## Categories diff --git a/content/blog/first-post.md b/content/blog/first-post.md deleted file mode 100644 index 18706f9..0000000 --- a/content/blog/first-post.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: My first post ---- - -Hello World diff --git a/content/blog/recommended-godot-editor-settings.md b/content/blog/recommended-godot-editor-settings.md new file mode 100644 index 0000000..2341de3 --- /dev/null +++ b/content/blog/recommended-godot-editor-settings.md @@ -0,0 +1,126 @@ +--- +title: Recommended Godot Editor Settings +tags: ["Godot", "IDE", "Game Engine"] +--- + +The Editor defaults are good, but it can be better. + + + +The default Godot Editor has sensible defaults, but it isn't quite optimized for me. +Over the years working with the engine, I found various editor tweaks that make using the engine a little bit easier. +I will go through most of the editor settings and explain which settings I changed, what they are doing and how it makes working with Godot a bit easier. + +## Accessing the Editor Settings + +Let's start by changing the editor settings for the Engine. This will affect all projects opened with the Engine, which can or can not be what you want. So keep that in mind when changing a settings here. + +To open the settings, open an empty or current project of yours and click on `Editor` and then `Editor Settings`. This will open a window containing all the settings you can change. Based on the scrollable list on the left side, the following sections of this article will represent the groups and specific values to change. + +### `interface/editor/import_resources_when_unfocused` + +This setting affects when the Godot Engine Editor will try to import new resources you dragged and dropped into the project folder. The default behaviour will only import resources when the editor window is focused. Turning this setting on can help when importing multiple large folders. + +### `interface/inspector/default_color_picker_mode` + +If you are used to a different color model than RGB, e.g. HSL/V which is probably easier to visualize you can change the default color picker mode here and also in which shape it will be, either squared or a circular shape. + +### `interface/scene_tabs/display_close_button` + +If you have multiple scene open it can be annoying wanting to close a specific one, as by default only the active scene has a "x" button next to the scene name. + +### `interface/scene_tabs/show_script_button` + +Similar as above, a scene can have a button to quickly open the script attached to the topmost node. + +### `interface/scene_tabs/restore_scenes_on_load` + +If you have many scenes open most of the time, saving this state on exit will make the project load slower on the next startup. You can disable that behaviour with this setting. + +### `filesystem/external_programs/raster_image_editor` + +You can change which program shall open when using the "Open in External Editor" context menu entry. This is very useful to quickly open a 3D model with [F3D](https://f3d.app) for example. + +### `filesystem/directories/autoscan_project_path` + +If you have a folder that contains all your Godot Projects, you can set the project managers main directory to that folder, allowing you to auto-scan all projects, e.g. if you downloaded a project from the internet. You can also set `filesystem/directories/default_project_path` so it uses the same path for convenience. + +### `filesystem/file_dialog/show_hidden_files` + +Simple setting: you can show hidden files like a .gitignore file or something else. + +### `docks/scene_tree/start_create_dialog_fully_expanded` + +This is a useful setting, expanding the `Create New Node` dialog fully, so no arrows need to be clicked. This is also useful if you are rather scrolling through the list to find your node you want to add. + +### `text_editor/appearance/caret/caret_blink` + +This setting stops the cursor from blinking. It can also save energy as the editor does not have to redraw the cursor blinking. The line you are in is already highlighted anyway so that's a good setting for a few minutes of extra battery life (hopefully). + +### `text_editor/appearance/gutters/line_numbers_zero_padded` + +Pads numbers with zeroes to keep them more consistent. If you have more than 100 lines of code, the very first line will have '001' as the line number instead of '1' e.g. + +### `text_editor/appearance/gutters/show_info_gutter` + +Displays small helper icons for overriden methods or signals. + +### `text_editor/appearance/minimap/show_minimap` + +The minimap is a feature in code editors that is useful for a nice visualization but I'm just not using it often enough to really be valulable. I rather use bookmarks to jump to specific code. + +### `text_editor/appearance/whitespace/draw_tabs` + +If you don't like the chevron symbols for tabs, you can disable them. + +### `text_editor/appearance/whitespace/line_spacing` + +The default line spacing is a bit too much for me. Changing this parameter can fit more code on the screen. + +### `text_editor/behavior/navigation/scroll_past_end_of_file` + +I don't like looking at the end of my display when I code. Being able to move the last lines to the center of the screen is much angenehmer and this setting enables this. + +### `text_editor/behavior/indent/size` + +The default tab size of 4 feels a bit too much for me, I set this to 2. + +### `text_editor/behavior/files/trim_trailing_whitespace_on_save` + +This setting removes unnecessary whitespace at the end of lines and makes version control less noisy. + +### `text_editor/behavior/files/autosave_interval_secs` + +You can specify an auto-save every `x` seconds if you want to. Pretty good when the editor or your PC crashes frequently to avoid data loss. + +### `text_editor/completion/idle_parse_delay` + +A very important setting I always change. When you stop typing, the editor waits 1.5 seconds to check the script for errors, which is too long for my liking. + +### `text_editor/completion/code_complete_delay` + +This setting is related to the previous setting and can show suggestions either quicker or slower. + +### `run/output/always_clear_output_on_play` + +This is good to know: You can stop the output window (e.g. your debug logs) from clearing when starting and stopping the project. + +### `debugger/auto_switch_to_remote_scene_tree` + +This is a very helpful setting and prevents an unnecessary click when debugging projects. It will open your remote scene tree automatically e.g. with all your autoload nodes or attached levels under your level manager that would not be visible otherwise. + +## Recommended Godot Project Settings + +The settings require the "Advanced Settings" toggle to be active. Keep in mind that the following settings will only apply for your currently opened project unlike the previous Editor settings. + +### `debug/settings/stdout/print_fps` + +You can print the FPS and GPU information into your terminal (via stdout), e.g. how long a frame took to render. + +### `debug/file_logging/enable_file_logging` + +You can enable logging into a file for easier access and without the need to copy it from the output panel. + +### `debug/gdscript/warnings/untyped_declaration` + +You can achieve type safety by setting this to either warn or, if you're really brave, to error. Fixing the "errors" is very rewarding though, as it will lead to perfomance increases. diff --git a/content/blog/types-of-textures-explained.md b/content/blog/types-of-textures-explained.md new file mode 100644 index 0000000..b0c56ec --- /dev/null +++ b/content/blog/types-of-textures-explained.md @@ -0,0 +1,11 @@ +--- +title: All Types of Textures Explained +tags: ["Textures"] +type: Tip +--- + +Are you confused why a texture needs so many different files and why they have so many different names? + + + +TODO diff --git a/content/index.njk b/content/index.njk index bf0b1cc..acbeb9b 100644 --- a/content/index.njk +++ b/content/index.njk @@ -1,6 +1,23 @@ --- -layout: layouts/base.njk +layout: layouts/home.njk permalink: /index.html --- -Hello Homepage +
+ {% for post in collections.posts %} +
+ +
+ {{post.data.type | capitalize }} + {{ post.date | date }} +
+ +

{{post.data.title}}

+

{{ post.page.excerpt }}

+ +
+
+ {% endfor %} +
diff --git a/eleventy.config.js b/eleventy.config.js index d817d1b..c8cf48b 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -1,3 +1,162 @@ +import { createNoise2D } from "simplex-noise"; +import { createCanvas, ImageData } from "canvas"; +import alea from "alea"; + +const SEED = "runtimefee.lol"; +var log_once = false; + +/** @param {import("@11ty/eleventy").UserConfig} eleventyConfig */ export default function (eleventyConfig) { - eleventyConfig.addPassthroughCopy({ "public/css/": "/css/" }); + // Directory configs + eleventyConfig.setInputDirectory("content"); + eleventyConfig.setIncludesDirectory("../_includes"); // relative to the input directory, therefore the ../ + eleventyConfig.setDataDirectory("../_data"); // relative to the input directory, therefore the ../ + eleventyConfig.setOutputDirectory("_site"); + + eleventyConfig.setFrontMatterParsingOptions({ + excerpt: true, + // Optional, default is "---" + excerpt_separator: "", + }); + + // Custom date filter + eleventyConfig.addFilter("date", (dateObj) => { + return new Intl.DateTimeFormat("de-DE", { + day: "numeric", + month: "long", + year: "numeric", + }).format(dateObj); + }); + + eleventyConfig.addFilter("capitalize", function (value) { + return value.toUpperCase(); + }); + + // generate a nice preview image for articles that don't have one + eleventyConfig.addShortcode("generateThumbnail", function (hash) { + return getThumbnailImage(hash); + }); + + // Collections + eleventyConfig.addCollection("posts", (collectionApi) => { + return collectionApi.getFilteredByTag("posts"); + }); + + eleventyConfig.addPassthroughCopy({ "public/": "/" }); +} + +function getRandomFloat(min, max) { + return parseFloat((Math.random() * (max - min) + min).toFixed(2)); +} + +function getRandomPaletteValues() { + // Generate random arrays for a, b, c, and d + const a = [ + getRandomFloat(0.5, 1.0), + getRandomFloat(0.5, 1.0), + getRandomFloat(0.5, 1.0), + ]; + const b = [ + getRandomFloat(0.2, 0.8), + getRandomFloat(0.2, 0.8), + getRandomFloat(0.2, 0.8), + ]; + const c = [ + getRandomFloat(0.0, 2.0), + getRandomFloat(0.0, 2.0), + getRandomFloat(0.0, 2.0), + ]; + const d = [ + getRandomFloat(0.0, 1.0), + getRandomFloat(0.0, 1.0), + getRandomFloat(0.0, 1.0), + ]; + + if (log_once == false) { + log_once = true; + //console.log({ a, b, c, d }); + } + + return { a, b, c, d }; +} + +function getPalette(t, a, b, c, d) { + const result = []; + + for (let i = 0; i < 3; i++) { + // Apply the formula element-wise to each component of the vectors + result[i] = + 255 * (a[i] + b[i] * Math.cos(2.0 * Math.PI * (c[i] * t + d[i]))); + } + + if (log_once == false) { + log_once = true; + //console.log(result); + } + + return result; +} + +function getThumbnailImage(hash) { + var width = 400; + var height = 400; + var rng = alea(SEED + hash); + + var noise2D = createNoise2D(rng); + + const canvas = createCanvas(width, height); + const ctx = canvas.getContext("2d"); + const imageData = ctx.createImageData(width, height); + const paletteSettings = getRandomPaletteValues(); + + var dist = 0; + for (let x = 0; x < width; x++) { + for (let y = 0; y < height; y++) { + const value = noise2D(x / 50, y / 50); + var threshold = Math.floor((value + 1) * 128); + threshold = value > 0.2 ? 128 : 0; + + const index = (x + y * width) * 4; + + const dx = x - width / 2; + const dy = y - height / 2; + const distance = Math.sqrt(dx * dx + dy * dy); // Euclidean distance + + // Normalize the distance to be between 0 and 1 (for a radial gradient effect) + const maxDistance = Math.sqrt( + ((width / 2) * width) / 2 + ((height / 2) * height) / 2 + ); + + const t = (distance / maxDistance) * 3.0 * Math.sin(dist); + dist += 0.00001; + + const a = [0.5, 0.5, 0.5]; + const b = [0.5, 0.5, 0.5]; + const c = [1.0, 1.0, 1.0]; + const d = [0.0, 0.1, 0.2]; + + const palette = getPalette( + t, + paletteSettings.a, + paletteSettings.b, + paletteSettings.c, + paletteSettings.d + ); + + if (threshold == 0) { + imageData.data[index] = palette[0] * 0.05; // Red + imageData.data[index + 1] = palette[1] * 0.09; // Green + imageData.data[index + 2] = palette[2] * 0.3; // Blue + imageData.data[index + 3] = 255; // Alpha + } else { + imageData.data[index] = palette[0]; // Red + imageData.data[index + 1] = palette[1]; // Green + imageData.data[index + 2] = palette[2]; // Blue + imageData.data[index + 3] = 255; // Alpha + } + } + } + + ctx.putImageData(imageData, 0, 0); + return canvas.toDataURL("image/jpeg"); } diff --git a/package.json b/package.json index a933fc9..f3066c9 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,17 @@ "scripts": { "serve": "npx @11ty/eleventy --serve", "build": "npx @11ty/eleventy", + "deploy": "rsync -av _site/* server:/tmp/build-runtimefee/ && ssh server 'sudo cp -r /tmp/build-runtimefee/* ~/www/runtimefee.lol/'", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "Luca Junge (https://luca-junge.de/)", "license": "MIT", "devDependencies": { - "@11ty/eleventy": "^3.0.0" + "@11ty/eleventy": "^3.0.0", + "alea": "^1.0.1", + "canvas": "^2.11.2", + "simplex-noise": "^4.0.3" }, "type": "module" } diff --git a/public/css/bundle.css b/public/css/bundle.css index e69de29..4720dfb 100644 --- a/public/css/bundle.css +++ b/public/css/bundle.css @@ -0,0 +1,117 @@ +/* See https://codeberg.org/lucajunge/css-reset for details */ +@import url(./reset.css); + +/* Custom fonts */ +@import url(./fonts.css); + +:root { + --font-family: "Lilita One", -apple-system, system-ui, sans-serif; + --font-family-monospace: Consolas, Menlo, Monaco, Andale Mono WT, Andale Mono, + Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono, + Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Courier New, + Courier, monospace; +} + +:root { + --background-color: #363d4a; + --dark-background-color: hsl(219, 16%, 20%); + --accent-color: #70bafa; + + --accent-red: #ffaaaa; + --accent-node3d: #ffaaaa; + + --accent-green: #aaffaa; + --accent-control: #aaffaa; + + --accent-blue: #aaaaff; + --accent-node2d: #aaaaff; + + --accent-yellow: #ffffaa; + + --aceent-purple: #c25bff; + --accent-media: #c25bff; + + --white: #eeeeee; + --dark-white: #cccccc; +} + +html, +body { + font-family: var(--font-family); + background-color: var(--background-color); +} + +h1, +h2, +h3, +h4, +h5, +h6 { + color: var(--accent-color); +} + +.header { + padding: 1rem; + background-color: var(--dark-background-color); + display: flex; +} + +.recent-posts-container { + margin: 12px 12px; + display: flex; + justify-content: flex-start; + gap: 12px; +} + +.highlight-card { + max-width: 24rem; + border-radius: 12px; + display: flex; + padding: 14px; + justify-content: stretch; + background-color: var(--dark-background-color); +} + +.highlight-card-header { + display: flex; + column-gap: 10px; + justify-content: space-between; + padding-bottom: 8px; +} + +.highlight-card img { + border-radius: 16px; + width: 100%; + height: 8rem; + object-fit: cover; + display: inline-block; + box-shadow: inset 0px 0px 32px 32px #000000; +} + +.highlight-card a { + color: unset; + color: var(--white); + width: 100%; + text-decoration: none; +} + +.highlight-card-button { + border-radius: 8px; + margin: 8px 0px 0px 0px; + padding: 4px 8px; + cursor: pointer; + background-color: var(--accent-color); + outline: none; +} + +.content-type.article { + color: var(--accent-red); +} + +.content-type.tip { + color: var(--accent-green); +} + +.content-type.recommendation { + color: var(--accent-yellow); +} diff --git a/public/css/fonts.css b/public/css/fonts.css new file mode 100644 index 0000000..5ceb4bc --- /dev/null +++ b/public/css/fonts.css @@ -0,0 +1,6 @@ +@font-face { + font-family: "Lilita One"; + src: url("../fonts/lilita_one/LilitaOne-Regular.ttf") format("truetype"); + font-weight: normal; + font-style: normal; +} diff --git a/public/css/reset.css b/public/css/reset.css new file mode 100644 index 0000000..9344914 --- /dev/null +++ b/public/css/reset.css @@ -0,0 +1 @@ +*,*:after,*:before{box-sizing:border-box}*{margin:0;padding:0;font:inherit}html{color-scheme:dark light}body{margin:unset}body{min-height:100vh;min-height:100svh}picture,svg,video,canvas{display:block;max-inline-size:100%;max-width:100%;block-size:auto}img{font-style:italic;background-repeat:no-repeat;background-size:cover;shape-margin:1rem;max-width:100%;height:auto;vertical-align:middle}h1,h2,h3,h4,h5,h6{text-wrap:balance}p{max-width:75ch;text-wrap:pretty}@media (prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}@media (prefers-reduced-motion: no-preference){:has(:target){scroll-behavior:smooth;scroll-padding-top:2rem}}html{hanging-punctuation:first last} \ No newline at end of file diff --git a/public/fonts/lilita_one/LilitaOne-Regular.ttf b/public/fonts/lilita_one/LilitaOne-Regular.ttf new file mode 100644 index 0000000..091ddf9 Binary files /dev/null and b/public/fonts/lilita_one/LilitaOne-Regular.ttf differ diff --git a/public/fonts/lilita_one/OFL.txt b/public/fonts/lilita_one/OFL.txt new file mode 100644 index 0000000..aa57586 --- /dev/null +++ b/public/fonts/lilita_one/OFL.txt @@ -0,0 +1,94 @@ +Copyright (c) 2011 Juan Montoreano (juan@remolacha.biz), +with Reserved Font Name Lilita + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/public/logo/logo.png b/public/logo/logo.png new file mode 100644 index 0000000..6bced78 Binary files /dev/null and b/public/logo/logo.png differ diff --git a/public/logo/logo.svg b/public/logo/logo.svg new file mode 100644 index 0000000..0e900f6 --- /dev/null +++ b/public/logo/logo.svg @@ -0,0 +1,78 @@ + + + + + + + + + runtimefee + +