Hey look, buddy. I'm an engineer. That means I solve problems. Not problems like "What is beauty?" because that would fall within the purview of your conundrums of phliosophy.
I solve practical problems.
Man, the title of the last devlog was NOT lying. I actually did quite some stuff throughout May, although none of that was for gm_boxedcommunity since I kinda took a break from that map to not burn myself out 😅
So.. let's begin
Website
SURPRISE!! I did work on the website! I finally managed to get past that list issue by just ditching the whole code and reimplementing it differently. Now I just copy the snippet wherever I need it until I can find a good way to "instance" the code or otherwise make it a template that can be easily changed in one place instead of having to update it literally everywhere. The implementation is nasty and is going to cause problems in the future unless I re-implement it in a much better way that is more maintainable (Nunjucks syntax + the many questions I have about it and how 11ty collections are set up (they're simple objects with a single array attached to them) is not making this any easier)
But hey, it works.
I do not feel like digging up a bunch of screenshots and I'm pretty sure everyone is tired of a million screenshots to scroll through so I just made a video of me clicking through the vault section of my site lol.
I then worked on other parts of the site like character profile layouts and how they'd work internally
it was defos an experience
Character Metadata
So for the character profiles, it's a mix of Markdown and YAML properties. For example, this is what Kathy's profile looks like internally.
In the YAML thing, the title, layout, altcss stylesheet, and other "custom" variables that get fed into the Nunjucks layouts are declared here. You might have noticed two interesting properties, IsMature and the thing of JSON sitting in the variables.
IsMature is a bit of an advanced variable I set up and it is a boolean (true or false toggles it). It basically determines if the little extra snippet of HTML gets included in the page or not.
{%- if isMature == true -%}
<dialog id=mature-alert open closedby=none>
<div>
<h1>Over 18?</h1>
<p>This page has been marked as <b>Mature</b> and may contain content not suitible for minors (under 18 or whatever the age of consent is in your area).</p>
<p><em>By clicking "Dismiss", you assert that you are of legal age <b>and</b> you consent to viewing of such content.</em></p>
<form method=dialog>
<button>Dismiss</button>
</form>
<p><a href="/vault">Take me back!</a> (Takes you back to Vault root)<br>
<small>Alternatively, use the browser back arrow</small></p>
</div>
</dialog>
{%- endif -%}
Yes, it is literally the exact same as a "R U OVAR EIGHTEEN M8???" popup on other sites lmfao. In the future I might just have this be a Content Warning page so it's more flexible in terms of usage and maybe rearrange the insides a bit? This is all No-JS friendly btw, this is entirely HTML since you can just make the dialog start open with an attribute if you have no intentions of touching it with JS whatsoever. The MDN docs have more info about <dialog> on their dedicated page for it.
The little extra bit of JSON is part of a system that makes the info table dynamic, since I prefer being able to add or remove values as needed instead of hardcoding anything in. I'm pretty proud of this little piece of code since before then, I tend to get confused whether something like bigthing.smallthing or collections.tag show up since I had no idea how the computer is interpreting it internally, but I get it now as shown here.
<table>
<caption>Basic Character Info</caption>
<thead>
<tr>
{%- for dataName in charinfo.dataName -%}
<th>{{ dataName }}</th>
{%- endfor -%}
</tr>
</thead>
<tbody>
<tr>
{%- for dataValue in charinfo.dataValue -%}
<td>{{ dataValue }}</td>
{%- endfor -%}
</tr>
</tbody>
</table>
I should probably explain the code. So what it's doing is that each for loop is accessing the charinfo object defined in the character's .md file, and then accessing the arrays inside that object. then it goes through the array and doing the stuff inside the loop block (in this case, filling in the blanks) for each entry. It does that until it reaches the end of the array. (as for whether you have to specify the array you want to access twice as above, idk. From my experience in for loops in other languages, JS included, the thing directly after "for" is a variable that is defined for the loop to use and can be referred back to. Here's an example of looping through an array in JS to print each value in the console:
const myArray = [
"qwerty",
"asdfgh",
"zxcvbn"
];
for (const i of myArray)
{
console.log(i);
};
Output:
- qwerty
- asdfgh
- zxcvbn
(i totally did not have to reread the docs because remembering syntax for a million different languages is hard and apparently there's a for loop thing specifically for looping through arrays?? huh??? i knew about for..in but not for..of dang lmao)
"i" is the variable declared to be used when looping through the array. It can be anything really, I'm pretty sure naming the variable you're going to use to loop through an array after the array itself is more to keep things tidy and easier to understand which goes where ig, as well as the fact that const is being used and you can't redeclare or reassign const's.
More context on constants:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const
- https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Scripting/Variables#when_to_use_const_and_when_to_use_let
But yeah, long story short, the layout has two for loops to populate each row of the table and the data that it uses to populate said table is defined in the character's markdown document.
Oh by the way, Kathy's profile is the only one rewritten as of typing this and it was so I had content to populate a character page with. I did not port everyone else over and the two profiles in the Overworld were only there to get subfolders working + testing additional features. There's nothing interesting in the rest of the profiles, so you're not really missing out on anything worthwhile :P Also everything in that video is a WIP and subject to change yadda yadda I think we know the drill by now.
Another thing, trying to implement images in an organized manner and getting 11ty to copy them over has costed me several minutes (maybe more than an hour) of my life that I am never getting back. All you need to know is that I went with the 'slower' method (adding to the list of known template formats instead of using passthrough copy in the config) because it breaks less stuff and is less maddening to set up.
Source Mapping
While gm_boxedcommunity is on hiatus, I got to work on my last stand concept, which became cp_laststand. It went through 2 alphas and for alpha 3... I'm just gonna redo the entire layout mostly from scratch.
Why? Because the current layout is extremely cramped and not fun to play in. I tried to expand it more in alpha 2 without having to fight the geometry too much, but I decided there is no salvaging the geometry and decided that I should start fresh for the most part and maybe bring in some geometry that I liked here and there. I'll keep alpha 2 as a "specialty map" (basically something like 2Fort and Turbine, where while it's not a fun map to play in, they work as a silly map to goof off in or otherwise just a 'funny map'.) but alpha 3 onwards I want to make it fun.
Even if I intend on starting over, I'm still gonna share a couple screenshots of alpha 2. The map itself is unlisted and no, I am not providing the link until it's ready (which won't be for a while).
(the top-down does not include the area in the second image, or cubemaps)
(i also have been playing with bots outside of any testing done with a tf2 server i frequent to make sure it's functional or smthing)
One of the people who playtested the map suggested I take a look at Quake maps and even shared a video, which I'll watch when I get to figuring out the new layout. I'm also gonna be paying more attention to the layout of other 'fun' maps that I play and get a sense of how open I can make my map to strike a balance between "cramped hellscape" (too closed) and "Sniper main wet dream" (too open).
Conclusion
So this month has been pretty productive (or at least the first half of the month. The later half I began to slow down a bit) in comparison to the last few months. The website has been brought back from shelved purgatory and I got to expand on my concept a bit. I might either work on my character profiles (not for Artfight though LMFAO) since the character page is pretty much done at the moment, revisiting the blog section or at least start the misc. section which will have elements that I'll carry over to the blog, work on alpha 3 of cp_laststand, or go back to working on gm_boxedcommunity and get that area all finished up and move closer to the beta release.
I'm also working (slowly) towards doing my first PC build. Yeah it would be easier to get a prebuilt PC but where's the fun and pain in that?
I'm probably gonna ramble about some ideas I have as well as extra stuff in an separate journal (esp. relating to DeltaVoid and hosting). Maybe on here, maybe on main, maybe on nowhere? Who knows? Anyways see you next month or smthing.