ratrogue’s log
www.fholio.de
SEEN / PLAN / DONE / contract work not included
posting on https://mstdn.io/@ratking too
2023-09-22
SEEN
2023-09-21
SEEN
- I should write down some of the knowledge I gain from reading A Tour Of C++, just because it’s new to me or I forgot about it.
- Initialising a variable via { } instead of = is preferred because it’s type-checked.
- constexpr allows calling a function during runtime, consteval doesn’t. If you use either, the function is not allowed to have side effects.
- foreach (var x in v) from C# is for (auto x : v) in C++.
- You can do for (auto& x : v) { x = … }
& in a declaration means “reference to”.
* in a declaration means “pointer to”.
& in an expression means “address of”.
* in an expression means “content of”. - Use nullptr instead of 0 or NULL. There is no “null reference”, they always reference valid objects.
- Use import (modules) instead of #include if possible.
- Only use unsigned for bit manipulations.
- Use enum class for strongly typed enumerations, so there is no confusion like with normal enums.
- Don’t use “naked unions”, maybe std::variant instead.
- Use export module MyClass; to define a module at the top of a file.
- using namespace can be used very locally. Don’t use using in a header file.
- Return values can be inferred. Instead if int Function() { } you can write:
auto Function() -> int { }, as it’s more logical. - If a function returns several values via a struct, you can use structural binding:
auto [n, v] = read_entry(stream); // return struct with two members - Use static_assert() to check things at compile time.
- dynamic_cast<>() returns nullptr if the argument isn’t of an expected type.
- Use unique_ptr<> or shared_ptr<> instead of naked pointers; they even make destructors superfluous.
- If a method (member function) doesn’t change its object’s state, declare it const.
void foo() const { … } - A class with virtual functions should have a virtual destructor.
Use override to make overriding an obvious and explicit choice. - Add = default to a declaration to force the standard generation of a constructor. Add = delete to force the compiler to not generate an operation.
- Use explicit in order to hinder automatic conversion due to single argument constructors; use it as default choice and only remove it if really needed.
- Foo(const Foo& a); // copy constructor
Foo& operator=(const Foo& a); // copy assignment
Foo(Foo&& a); // move constructor
Foo& operator=(Foo&& a); // move assignment - Use std::move() in order to enforce the move assignment (instead of getting a copy).
- <=> is the spaceship operator, working similarly to strcmp().
- For a container class Foo to support for (auto& iter : foo) { }, give it a begin() and end() method (cbegin() and cend() for a const container) that return an iterator.
- Implement swap() for sorting algorithms.
- Implement hash<K>() for std::unordered_map<K, V>.
- To automatically have an std::string instead of const char*, add an s to a string (“Hello World”s). A number with an s is an std::second. A number with an i is imaginary, i.e. of type complex. Implement your own literals like this:
constexpr foo<bar> operator””x(int arg) { return { … }; }
2023-09-18
SEEN
- So I tried to check out O3DE, which is basically Lumberyard, which is basically Cryengine. It doesn’t even start the editor for me. Very unfortunate, as nobody in the Discord could help with the problem. It’s not even clear what’s happening here.
- I had another look at Evergine too, and I guess I can survive the “no instant play test mode” thing, but I find it really concerning that it doesn't even have a Discord channel or some other form of community. All I found so far is a repo on github where people can post issues. It’s a bit alienating.
- Unigine’s component system looks good enough for me. Problem with Unigine of course is that it has the same problem as Unity - it’s so proprietary that at any point they could change the pricing and without any source code it’s yet another thing I would get locked in. Also it only supports Windows, basically.
https://www.youtube.com/watch?v=hHcUYQUlG00 - Reading A Tour Of C++ by Bjarne Stroustrup currently, as maybe we will use an engine in the future that demands some C++ knowledge. Last time I used C++ was in 2010, and I was never a good C++ programmer anyway, so this book contains some fun knowledge on the first pages already. For example, I never knew that you can do
if (auto x = vec.size(); x > 5) { … }
in C++. It’s something I actually miss in C# sometimes. And if the check after the semicolon is used for != 0 or nullptr, it can be shortened to
if (auto c = vec.size()) { … } - Defold feels slick, with tutorials built in as small projects. Nice. But it’s actually only for 2D games I guess, and I don’t see a reason right now to use it over Godot, although I like Lua more like GDScript and I like the idea of not having to install additional stuff for building for Android and so on.
2023-09-14
PLAN
- The Unity nav mesh bug I reported finally was accepted as a bug. This is after it was closed before, because the behaviour would be “By Design” (which was a lie). Ugh, Unity. And then this whole thing with the fee for installations, I want to change engine again (some day). The problem is that we don’t know yet what our next project will be. Patou needs to stay in Unity unfortunately. Again, what are my options?
Unreal feels too bloated and I actually want to do smaller projects.
Godot is always so alien to me and feels like it needs more time.
Stride?
Flax is probably “too early”.
O3D?
Heaps again?
Wicked?
Defold?
Armory3D?
NeoAxis? (It’s Russian and that could be a problem. Also not enough platforms.)
Kha?
Unigine? (Looks like Unreal all over again? Also v2 doesn’t have support for mobile.)
Evergine? (No instant testing.)
Raylib? (A bit too barebones probably.)
FreeBasic? (Haha.)
Wish I knew how to create my own custom engine without spending too much time on it.
2023-09-03
SEEN
DONE
2023-08-29
DONE
- As I’d like to do more low-level stuff (DOS programming, maybe Arduino) and recently learned about Exercism, I tried some of their exercises. So far I like it a lot, I had three different mentors for several small tasks and they always were helpful and deepened my knowledge about C.
https://exercism.org/profiles/ratrogue
2023-08-25
SEEN
2023-08-12
DONE
- A lot has been done but not talked about, for Patou. We’re preparing the current version for the devcom, and while I’m not overly confident (as usual) I try to cram enough things into it to make it shine a bit. A new debug menu for teleporting, collectibles (dog treats, flowers) that can be used as secrets in each level, special animations like sitting on benches for Kit, the Sphinx appearing during dialogs, a simple intro text, bug fixes, and so on.
2023-08-01
SEEN
2023-07-31
SEEN
2023-07-29
SEEN
2023-07-24
DONE
- While trying to fix annoying glitches in Patou especially regarding nav meshes and off-mesh links, I noticed that, when changing the nav agent’s position per frame during the traversal of an off-mesh link, I also should directly set the agent’s velocity to prevent an ugly break in the path by the dog.
2023-07-22
SEEN
2023-07-19
SEEN
- For Patou I’m still searching for a pipe tool - because we want to show that puzzle elements are connected to each other (a trigger activates an elevator, etc.) and everything else - wires, particle effects - doesn’t quite fit with the style and world. Instant Pipes seems like it fits the bill quite nicely, it looks good and is easy to use.
https://github.com/leth4/InstantPipes
2023-07-18
DONE
- In preparation for the devcom I updated our website a bit, mostly removing an old project, changing the banner pictures, more focus on Patou and replacing Patou’s screenshots. Hopefully I’ll remember that I hardcoded the project with the modal ID 2500 to be always at the top, as our current WIP project.
https://ratking.de/
https://gohugo.io/templates/introduction/
2023-07-11
DONE
2023-07-10
DONE
- I had some serious problems with ABGEFAHREN’s character controller. I use the one I made aeons ago for my jam needs and never really touched it again because it most often worked “well enough”. So when Stepahn couldn’t even rotate the player on his Mac I thought I should dig into it a bit and try to fix the most annoying parts. Mostly it turns out that I rotated the player transform and that was a bad idea because in combination with a RigidBody that can lead to unexpected behaviour.
https://ratking.itch.io/abgefahren/devlog/558342/small-but-important-fixes
2023-07-09
DONE
- Over the weekend we created a game for the bpb game jam 2023. With “we” I mean Jana and I and three other people (plus Crabman doing the music). The theme was Mobility. This was the first time that I was in a team with two programmers, and it was quite an interesting experience. I am also happy about our creation, as it became pretty atmospheric and full of potential for interesting content. ABGEFAHREN recreates the experience of travelling per train in Germany.
Pretty much all the other entries are great too - this was truly an inspiring event.
https://itch.io/jam/bpbgamejam-2023/entries
https://ratking.itch.io/abgefahren
2023-07-06
SEEN
2023-07-04
SEEN
2023-07-02
SEEN
2023-06-26
SEEN
2023-06-12
SEEN
- I’m more and more convinced that Character Controller Pro is the most stable and usable character controller asset for Unity right now, at least for me. Maybe I’ll use it for Patou (or rather Kit) later on - but right now we’re concentrating on getting a new version ready for the upcoming Devcom.
2023-06-03
SEEN
DONE
- I experimented a bit with small3dlib and TinyPTC, using it with DOSBox by compiling a small test case (a single triangle) via DJGPP. I had a lot of strange bugs with variables not even working correctly, and I feel like giving up, because apparently C is dark magic. Combine that with the fact that 3D stuff will always have bad performance if using libraries like that, I definitely go in the wrong direction, even if I just want to do something simple like a gridder.
https://gitlab.com/drummyfish/small3dlib
https://sourceforge.net/projects/tinyptc/
2023-06-01
SEEN
- I read this short tutorial about Unity’s inbuilt object pooling system. I might use it someday, as I think my own solution isn’t the best. Pooling is such a crutch, just because you have to know what a Garbage Collector is and why it has its problems; I guess everything comes with advantages and disadvantages.
https://unity.com/how-to/use-object-pooling-boost-performance-c-scripts-unity
2023-05-30
DONE
- Recently I got interested in FreeBASIC, and how I could use it to target both Windows and DOS. I found a version of TinyGL for FreeBASIC, but I had to compile the library myself so it would run in DOS. Even TEST01.BAS is unfortunately quite slow, 8fps with only three triangles shown. I don't think I want to put more time into this, but it was an interesting excursion.
https://mstdn.io/@ratking/110459022509065635
2023-05-25
DONE
- After a power loss somehow the git repo of Patou was broken again, it showed DETACHED HEAD and there was no way to reattach it, at least not inside Fork. The solution was to manually edit the files in .git/ref/heads and .git/ref/remotes/origin so they would contain the correct SHA again. What a waste of time.
2023-05-24
DONE
- Yet again I had to fix a bug in the Wordpress theme Blogrid, because the creators didn’t include the fix I sent them. In the file inc/template-tags.php, there’s a missing “$byline .”, which means the author is never displayed.
2023-05-23
SEEN
2023-05-21
SEEN
- Funny little tidbit I came across today - in ugBASIC, the keyword FUNCTION is defined, but subroutines/procedures actually only use PROCEDURE and GOSUB. Apparently this keyword isn’t used at all. I wonder if there are more of these. In any case there are a lot of keywords in ugBASIC where I think this should be defined differently, especially a lot of music instruments.
https://retroprogramming.iwashere.eu/ugbasic:syntax
DONE
- Last week I had to create a video with gameplay from Patou. Well, it wasn’t really an absolute must, but I got interviewed by ludipe, for the AstraFund, and I wanted to show some of the “thinky” parts of Patou. Of course, nothing worked, because we did stuff for the AMAZE demo the days before and changes were made that affected the puzzle levels. So afterwards I fixed it and sent him the promised video, hopefully redeeming myself. It felt good, even though I’m sure I won’t be selected for the Fund.
2023-05-20
SEEN
2023-05-19
SEEN
- I finally discovered the NavMeshModifier component that excludes game objects from the navigation mesh creation in Unity. I had a problem with it not working for some objects, but then I read that the layer must be right too.
https://forum.unity.com/threads/navmesh-modifiers-are-completely-ignored.676369/#post-7854210 - I’m done with reading the C book, and it feels so archaic and alien sometimes. I won’t need most of the stuff, but still it was good to get into the way of thinking again. Somehow I missed this.
2023-05-15
SEEN
- I’m currently reading a book about C, and I didn’t know that C11 allows some kind of generic functions, by using the _Generic keyword. I’m really eager to try some low level programming for a small dungeon crawler project.
https://en.cppreference.com/w/c/language/generic
DONE
- We’re back from the AMAZE, where we showed Patou for a few hours. Overall it was a very positive experience, but of course it also made clear how much more work there is to be done, in every department.
2023-05-03
DONE
- After hunting another strange bug where an animation would not get played but only if the player comes from another scene, I should remember this: always make sure that everything is initialised BEFORE the component’s core functionality is used. In this case the Start() method would reset the animation, as the object was hidden until then.
2023-05-01
SEEN
- I was visiting the Indie Outpost in Nuremberg today, and someone held a talk about Godot. It was pretty negative towards Unity, but the guy was showing a few tools he uses and one of them was Dotgrid, which I never heard of before. It looks interesting, a vector art tool specifically for logos and icons and maybe more.
https://hundredrabbits.itch.io/dotgrid
DONE
- Version 0.8.0 of connected adds the Search Phrase tool, which is pretty much the last feature that was missing from the original Moritalk and that I wanted to have in again in any case. (The Node Flow functionality and the Dialog Border are definitely not as important, but would be nice to have.)
https://mstdn.io/@ratking/110292550876345626
2023-04-28
DONE
- I was hunting a bug with connected - a dialog file for Patou would have two nodes with the same ID; which is not allowed to happen. (Also only in the game file, not in the editor file.) So I investigated for quite some time, but in the end I had to conclude that this happened due to a badly solved merge conflict, because I could not find a way to replicate it.
2023-04-22
DONE
2023-04-19
SEEN
PLAN
- While I didn’t submit anything to the Dungeon Crawler Jam 2023, I feel like the project I did could have potential so I currently plan to create a story for a potential “real” crawler and just try it out. As Jana still is not interested in a gridder I might try finding another artist for this.
DONE
- It’s not really newsworthy, but I wanted to add something to the Patou blog at least, so I wrote about the start menu screen I worked on for a day. I liked how we did it in TRI, loading a real level into the background, so I did that again.
http://ratking.de/patou/2023/04/19/start-menu/
2023-04-15
DONE
- I made another update for connected, as there were some serious bugs and flaws, so now it’s v0.7.2. I also took the opportunity to add a quality-of-life feature - finally, duplicated nodes will be positioned at the right position: under the mouse cursor.
https://ratking.itch.io/connected/devlog/517016/connected-v072
2023-04-14
SEEN
- I tried to rename several files in several subfolders. They had the form “nostalgia_100_ghost_bury” and I just wanted to replace the “nostalgia” with “nost”. So via startpageing I found a piece of command line code that allegedly does what I want:
for /r %x in (nostalgia_100_*.*) do ren "%x" nost_100_*.*
But that didn’t quite work. It renamed the files to something like “nost_100_gia_100_ghost_bury” - and nobody else seems to have that problem. So I resorted to ChatGPT which told me to use PowerShell instead and this script:
Get-ChildItem -Path .\ -Recurse -Filter "nostalgia_100_*.*" | Foreach-Object {Rename-Item $_.FullName -NewName $_.Name.Replace("nostalgia_100_", "nost_100_")}
And that actually worked.
https://stackoverflow.com/questions/245840/how-do-i-rename-files-in-sub-directories
2023-04-13
DONE
2023-04-09
DONE
- I did a first iteration of the prototype for a visual novel that might or might not happen, together with a guy named Baddy. Right now I’m only testing the dialog UI, so pretty much the same as with Patou. The most interesting result so far is that adding connected is a bit complicated when not using the provided example dialog code, so I will have to look more into making this easier, I guess.
2023-04-08
SEEN
DONE
- As I did a bit of “sound design” for Ghost in the Paint, I uploaded a new version with footsteps, wind ambient sound and a wobble effect I made with Helm. I actually don’t know how to create sound effects that aren’t natural, so I want to look into this a bit more.
https://tytel.org/helm/
https://ludwig-hanisch.itch.io/ghost-in-the-paint - While working on my dungeon crawler I noticed a bug in SBT, which caused some strangeness with the first few ticks. Which means it would only be obvious when SBT is used in a turn-based game. Fixing it was just a matter of initialising a variable differently, phew.
https://github.com/ratkingsminion/simple-behaviour-tree
2023-04-07
DONE
- I participated in the Dungeon Crawler Jam 2023, but I didn’t finish my entry, because half-way through the last day I noticed that I wouldn’t have time to make something complete and interesting. I’m kind of proud of what I achieved though, because as I re-created my usual stealth gridder project I found some ways to make it work. So maybe I will continue with this, in some way.
https://mstdn.io/@ratking/110157354068685494
2023-04-03
DONE
- I finally created that video I wanted to make for applying at Astra Fund. While I don’t think I will receive it, as I’m too old for this, it was kind of a good exercise to do this retrospective. The low view count though shows me yet again that I’m probably in the wrong profession altogether.
https://www.youtube.com/watch?v=IRumvZbGHEk
2023-03-31
DONE
- I uploaded a new version (v0.7.0) of connected, which finally supports node type definitions from the outside (via JSON and C# files). All that's missing is some documentation for that. Additionally there's now a free lite version which does not allow new node type definitions and also does not generate a separate file for texts, but otherwise has the same functionality.
https://ratking.itch.io/connected/devlog/510360/connected-v070
2023-03-30
SEEN
- Useful tip for the future, when using git and Unity: Place a .gitattributes file into the folder with all lightmap textures and light probes to override the root folder setup, with *.asset binary as content. The root folder contains the line *.asset text eol=lf. I’ll have to check how to combine this with LFS.
2023-03-26
DONE
2023-03-25
DONE
- Finally I removed Small Basic from connected and replaced all the configuration code for the nodes with C#, of course fed to the Roslyn compiler. I even fixed some issues I was having with connection order being lost when changing a node that would reset its contents. One wrinkle is still there: if there’s a variable amount of connectors, like with the Switch node, the connections can get completely lost on undo actions.
2023-03-24
SEEN
2023-03-22
SEEN
2023-03-21
DONE
- I uploaded a version 0.4.0 of Ghost in the Paint, as I could bring the gallery level to a playable state. The second level isn’t interactive at all yet, but that will come with the next update, probably in a month or later. Also, sounds.
https://ludwig-hanisch.itch.io/ghost-in-the-paint
2023-03-20
- While the C# support for the configuration of node types is still in the works, I made a new version of connected because I noticed some bugs. Also I had to finally add the path settings to the Settings menu because this week connected will be used by all Patou team members to create some fake dialogs.
2023-03-19
SEEN
2023-03-18
DONE
- Another new version of connected uploaded - it’s still not a release candidate, but I could add some small but important features (like the display of an out connector’s connections order) and a welcome screen (with a list of files recently opened and an online version check via itch.io). The next big steps for an actual release are an integration of options (with a JSON file) and switching the configuration scripts for the nodes from Small Basic to C#. After that it’s all about creating a free (lite) version and a commercial (pro) version. The plan is that the pro version allows changing and adding node types, and saving texts in an extra file (which already works, so I actually have to “remove” that feature for lite only).
2023-03-16
DONE
- The interaction hints in Patou got improved. Instead of just showing “E - Interact” it now actually says which object/NPC the player currently can interact with, and what this interaction is (picking up, talking, unlocking, etc).
2023-03-15
DONE
- I upgraded Patou’s dialog UI a bit. It’s based on our intern Patrick’s design - he actually created the UI in Unity too, but unfortunately it would be too static for my taste. So basically I only took some inspirations from it, like the wobbly outline, and tried to fit it into something that can have different text lengths and amount of player choices. Of course NPC texts that are too long will still be cut off (because I really don’t want scroll bars in this case, especially if we have voice overs), but if there ever is a reason to support text walls - which we hopefully won’t, because they’re boring - there will be a simple solution ready by just splitting the text in two or more parts. Anyway, it’s still a problem that UGUI doesn’t quite well support giving elements a maximum size, and the solution I have is a bit hacky, but at least it works.
2023-03-13
DONE
- I think I could solve most of the problems with connected’s Test Mode, so I uploaded a new version. The nodes are not dynamic yet, but the code now supports that. A bit of a problem is that I can’t just add C# code files as text assets to be referenced in a script, but that problem should be temporary. The question is if I will jump the shark and replace all the SmallBasic code with C#...
2023-03-12
SEEN
DONE
2023-03-11
DONE
- I added a useful zoom menu to connected, so it’s now version 0.5.4. And I’m on the path to bring back the Test Mode. Right now it’s mostly a copy of the old legacy version, so it’s not dynamic yet, but I plan to use the Roslyn compiler next.
https://mstdn.io/@ratking/110006452968350739
2023-03-10
SEEN
- TIL that a GameObject that was never active and gets destroyed doesn’t call OnDestroy() on its children. Strange but true. At least I could fix that null ref error from yesterday.
DONE
- Uploaded the new version of connected with the correctness check. Next step obviously is to finally use the new format with Patou and make it the “official” version.
2023-03-09
SEEN
DONE
- I re-added the correctness check to connected, and also fixed a pesky bug that would prevent saving variables that are not bound to an element of a node (for example, the number of cases in a Switch node). As soon as I find the reason why the connections sometimes create null reference errors I will upload the update.
https://mstdn.io/@ratking/109995638236707384
2023-03-07
DONE
- The fifth episode of our Patou dev log is exclusively about the visuals of the dog. So the next part might be about dog gameplay. Hopefully this won’t be too awkward, I’m still far from confident about showing it around, but it has to be done either way.
https://www.youtube.com/watch?v=39_daYk6B0w - I’m finally continuing to work on Ghost in the Paint by adding some screenshake, an in-game menu (with an options screen) and the ability to change the level after the Black Gate. It’s probably a long way till it’s finished, of course; so it’s not yet updated on itch. Before there’s an official update I have to improve the second level (the gallery) and add some kind of ending. Sounds would be great too.
- I updated some of my open source libraries (as I needed some additional functionalities) in the last few days; there’s now a hotkey analyzer in the Game Jam Base Code and also sounds can follow a transform, and for SIH I added temporary schemes (only if you use Rewired). Oh, and already for some weeks now SUS can be used outside of Unity.
https://github.com/ratkingsminion/game-jam-base-code
https://github.com/ratkingsminion/simple-input-helpers
https://github.com/ratkingsminion/simple-utility-system
2023-03-02
DONE
- I updated the new version of connected, adding confirmation dialogs and doing a few small bug fixes. Next up I should do Patou supporting the new format, and then it will be the actual main dialog editor for the future, probably.
2023-03-01
SEEN
2023-02-26
SEEN
2023-02-25
DONE
- When we showed Patou at the Gamedev Meetup in Leipzig, I noticed that the Speedlines effect wouldn't appear in the build (only in the editor). I actually had this problem before, but the reason was something on my side. This time it definitely was something with SCPE, probably since the last update. After a very long debug session, where I would change the order of post-effects, remove some, and do a lot of other things, I finally found the alleged culprit: Only if the toggle is ON for the Noise Tex - no matter if the actual texture is changed or not - the effect would show, otherwise it never appears. My guess is that Unity somehow thinks that the texture is not used if the toggle is off and doesn't include it in the build. Anyway, this took way too long, and I hope there is some kind of fix for this.
- A student who does security stuff on the side mailed me because of a potential security flaw on my website. I was a bit shocked, but it wasn’t really my website but the blog that I wrote for my graduation project (Schwere in der Schwebe / Hals über Kopf) 13 years ago. My PHP game was never really strong, so I never expected it to be the best thing ever. In the end it was “just” a flaw that other people could use an URL of my blog to gain access to another person’s computer (i.e. XSS), so all I did now was make my blog a static HTML website, by removing some dynamic stuff (especially the tag selection) and then using HTTrack to crawl it on a local webserver (XAMPP). Also, the student wanted some money for him finding the bug, but to be honest this actually caused me quite some stress and I don’t have much money anyway, so I refrained from that.
https://www.fholio.de/archive/sids/
2023-02-24
DONE
- Conclusion from tonight’s Gamedev Meetup Leipzig, where we showed Patou on a laptop: As expected, not many people dared to actually try it out (only 3 people in total - it’s a pretty small meetup), but it was more than enough for feedback. Overall we left with a positive feeling, people thought it was pretty and above all somewhat unique. The digging is the main problem right now, too much has to be explained when people try it out.
2023-02-18
SEEN
- The Uxn ecosystem looks fun, somehow. It’s appealing because of the simplicity.
https://100r.co/site/uxn.html - In Unity, I really need to remember how to set the layout for a vertical list of buttons with different/dynamic heights based on their text contents. (Mostly important for Scroll Views.) First step is to add a Vertical Layout Group on the Content panel (Control Child Size Height toggled on and Child Force Expand toggled off) and a Horizontal Layout Group on the Button (same toggles). The Content panel also gets a Content Size Fitter with Vertical Fit set to Preferred Size. The text element of the button doesn’t need any additional component.
DONE
2023-02-17
DONE
- I will rename Terrobot X to Games for Rats, because Terrobot X itself is another project altogether. Anyway, I made the log output much nicer, and it even jumps to the faulty line when the user clicks on an error. Also it’s now possible to change the “screen resolution” by using Small Basic, and soon there will be more options available. Before I do a soft release I want to have screen focus (so you don’t manipulate both the editor and the in-game controls at the same time anymore), and a rudimentary welcome screen.
2023-02-14
DONE
- Some more work on Terrobot X - I copied connected’s top menu bar and reused it for this project. I’m also working on the API now, which hopefully will soon allow some interesting experiments with variable screen shapes.
https://mstdn.io/@ratking/109865113821737902
2023-02-12
DONE
2023-02-11
DONE
- I uploaded a new version of bloed, mostly with hotfixes for bugs that I noticed during making Root 666. But Tom ‘voxel’ Purnell also allowed me to add the textures he made for 666 Coins; this way people are quicker in creating something with the tool out of the box.
https://ratking.itch.io/bloed/devlog/488499/bloed-v113
2023-02-10
SEEN
- Somewhere I saw this construct: public ref Character Character => ref _Character;
… and if I understand the ref modifier correctly I don’t really see how this is any different from just having a public Character variable, other than making it more complicated? In any case ref return is something I should try to use sometime; should be useful with array stuff and when returning big structs.
2023-02-09
DONE
- While working with bloed in Root 666 I noticed that the old bug with the Tab key was occurring again and I wondered why. Today I dug into it and it was an easy fix - I used #define UNITY_2021_OR_NEWER instead of the correct UNITY_2021_1_OR_NEWER. I really think they could just add both.
2023-02-06
SEEN
DONE
- I did a small update for Root 666, as there were some annoying things that happened (and were released) because of the time constraints of a jam. But now the enemies can hit the player when they’re fighting on a slope, and you can exit the game via Escape. Also, Jana made a video of the gameplay.
https://ratking.itch.io/root666/devlog/486493/version-03-for-root-666
https://www.youtube.com/watch?v=AcviSew1V1Y - As I stumbled over a somewhat strange edge case while doing behaviour trees for the enemies in Root 666, I finally looked further into the issue and actually I was just using the InsertTree() method of SBT in a wrong way. But instead of adding a note about the correct usage to the docs I just allow the incorrect usage and therefore make it correct usage. Basically a tree can now have more than one root (how fitting for the GGJ theme!) and this way InsertTree() can be used more dynamically.
https://github.com/ratkingsminion/simple-behaviour-tree
2023-02-05
DONE
- Jana and I participated in the Global Game Jam for the ninth time, so the next one is a jubilee! This time the theme was “Roots”. With the help of Norrimo (Patrick Eckardt), mostly in the music department, we created a horror game where you throw screaming mandrake roots and hit enemies with a stick that has an eye stuck on it. Jana used bloed to make the level, and I got to use my fluent behaviour tree C# implementation for the first time. Of course a lot of bugs became apparent this way, but in the end we actually finished our entry Root 666.
https://globalgamejam.org/2023/games/root-666-0
https://ratking.itch.io/root666
2023-02-02
DONE
- Just encountered an annoyance with the Patou project - after a ruin would emerge and change the navMeshData, the changes would persist on the hard drive. That’s pretty bad. After trying different things, I concluded that only this code seems to help:
var copy = Instantiate(surface.navMeshData);
surface.RemoveData();
surface.navMeshData = copy;
surface.AddData(); - Some more work on Terrobot X, with a name change soon hopefully. Anyway, I made the layout resizable, which was relatively easy thanks to UGUI’s layout system.
https://mstdn.io/@ratking/109797230691527241
2023-01-31
DONE
2023-01-30
SEEN
2023-01-29
DONE
- I had some strange issue with my input strings in Terrobot X, where sometimes some keys wouldn’t show up in the text field. Only a lengthy debug session would make it clear that using Update() for input handling leads to the return key sometimes overwriting what I type. So I had to switch to OnGUI() and handle key events manually. Probably the better way in the end, but this also has some quirks (like a key event would fire twice, once with the character and one with the KeyCode).
2023-01-28
DONE
2023-01-27
SEEN
PLAN
- We’re going to participate in the Global Game Jam again, although in a very constrained and small manner. Basically it’s just us and another office (Prefrontal Cortex) in the same building (MMZ).
https://globalgamejam.org/2023/jam-sites/ggj-halle-rat-prefrontal-king-cortex - A year ago I worked on Terrobot X, and unfortunately it never became what it was meant to be (an extended version of the first-person gridder programming jam game), but at least the code editor I made was mostly working. I never used it for anything though, I streamed a bit and that was it. Now I want it as the basis for a fantasy console (which I already planned back then too), especially for simple entries for the One Hour Game Jam. I would be able to extend the console itself from time to time while still having all the entries inside; well, that’s the plan at least.
https://onehourgamejam.com/
SEEN/DONE
2023-01-24
SEEN
2023-01-22
SEEN
- Interesting but short article from 2006 about how the original God of War was developed, as there was some kind of conflict between the lead designer (who wanted “all special cases”) and the programmers (who think of special cases as their natural enemy). The executable was only 1.5 megabytes big!
https://www.gamedeveloper.com/design/gdc-i-god-of-war-i-how-the-left-and-right-brain-learned-to-love-one-another - I finally tried Evergine (which was Wave Engine before), and it doesn't seem to have any kind of play mode, so you have to build in order to test the game. I guess it's retro. Call me entitled, but if I could work without instant testing I would just use Heaps or Raylib.
https://evergine.com/
2023-01-21
SEEN
- Just had a serious bug with closures, serious because it was hard to track down. Basically a closure gets generated each time so if you store it in a variable and compare it later again the result is false instead of true, because it’s actually not the same object. Which makes sense of course.
2023-01-20
SEEN
- I read this short tutorial about how to create a “see through” effect for characters in Unity URP. Could be useful for Patou, but I actually don’t like that it (of course) does that for everything at once; for example if only the protagonist’s feet are hidden by some floor plate, it’s jarring.
https://docs.unity.cn/Packages/com.unity.render-pipelines.universal@11.0/manual/renderer-features/how-to-custom-effect-render-objects.html - We did another video for the Patou vlog, this time about the portals. The video is pretty short, mostly because I forgot to mention some stuff, like how the flowers and trees are using instanced mesh rendering and are actually placed directly on the terrain.
https://www.youtube.com/watch?v=S8hRFF_ZfzA - I followed another tutorial about custom effects, because I wanted to know how to create post processing effects with URP. Turns out it’s even more of a hassle than I thought, at least according to this tutorial. Just the simple effect of having a colour overlay has several scripts with a lot of hard to understand boilerplate code. And it doesn’t work with another effect (by SCPE), as it gets removed by the Black Bars post effect. Ugh.
https://www.febucci.com/2022/05/custom-post-processing-in-urp/
DONE
- I’ve done quite a bit of work on Patou, mostly on the cutscenes. I call the scripted sequences and they are probably both under and over powered, as they are hard to set up for the creator but also are pretty extendible. So I guess they’re mostly perfect for me, and not so much for any artist working on the project. It would be nice to have some kind of preview feature, but overall I don’t expect that we have too much of them.
2023-01-15
SEEN
2023-01-12
SEEN
- Today I learned that C#’s HasFlag() method for enums uses boxing and therefore allocates memory! Ugh.
2023-01-09
DONE
- I found a serious bug in my behaviour tree implementation, where Repeat and Retry nodes could lead to nodes being processed and executed more than once during a tick, which is obviously bad and even creates endless loops. I fixed it with a tick counter, which looks a bit like a hack, but I guess it does make the implementation more foolproof, especially if I ever add more node types.
https://github.com/ratkingsminion/simple-behaviour-tree
2023-01-07
PLAN
- I had an idea for a code ping-pong, but it wasn’t received with approval, so here it is, for archive reasons, and maybe I’ll come back to it later:
Basically a ping-pong based on levels. The participants start with a simple arcade game base mechanic, for example Pac Man guy with Pac Man movement. First participant A adds a level with the player having to collect pellets. Then participant B adds a level with a simple enemy, with the pellets. After that A adds a level with moving platforms; and so on, until the last level doesn't even resemble Pac Man anymore maybe, or it's just Pac Man on steroids. There could be some ground rules like "the level has to reuse at least half of the features from the levels before", or "the basic player movement is not allowed to change, so it's always controlled by the arrow keys only".
Of course each feature would need to be documented clearly, and it should be very easy to add a feature to a level.
2023-01-06
SEEN
2023-01-05
SEEN
2023-01-04
SEEN
2023-01-03
SEEN
- So it’s possible to speed up the Play mode of Unity significantly, but it comes with a big caveat. Via unchecking “Project Settings → Editor → Enter Play Mode” Domain and Scene are not reloaded anymore. It also means it doesn’t reset static variables to their initialisation values, which can be quite annoying. But I guess this can be counteracted via a static method with the RuntimeInitializeOnLoadMethod attribute. I have to check if this is viable.
https://www.youtube.com/watch?v=wRCnKtpzf5U
https://blog.unity.com/technology/enter-play-mode-faster-in-unity-2019-3 - I finally watched Freya Holmer’s video about splines; it’s a very good introduction into the subject, and also has in-depth explanations and, of course, extremely good animations. Her maths helper collection should be helpful too in the future.
https://www.youtube.com/watch?v=jvPPXbo87ds
https://github.com/FreyaHolmer/Mathfs - I watched this introduction video to Super Netcode. Looks quite easy (the devil is probably in the details). Though getting people from across the planet to join a networking session will still be a problem I’m sure - a relay is needed for that (e.g. via Steam or Photon) - and, well, friends. Anyway, someday I will try a multiplayer game again, just for fun.
https://www.youtube.com/watch?v=Odn1MQo6V_k
https://assetstore.unity.com/packages/tools/network/super-netcode-175227 - MonoBehaviour Systems - more DOTS stuff, this time combining it with MonoBehaviours so maybe I don’t have to give up my comfort zone completely. In any case I should look more into it.
https://www.youtube.com/watch?v=RhU8NZtgYp0 - More things using DOTS with GameObjects. I love how such posts always talk about how easy this is, but the code always looks like a mess to me.
https://coffeebraingames.wordpress.com/2021/11/23/the-safest-way-to-use-dots-in-your-monobehaviour-project/ - I also want to find out more about DrawMeshInstancedIndirect() to be able to have more meshes on the GPU instead of the CPU. These articles help a bit.
https://toqoz.fyi/thousands-of-meshes.html
https://coffeebraingames.wordpress.com/2022/10/04/sorting-a-million-sprites/ - So actually there is a (very convoluted) way to have custom lighting in URP! It only really works with ShaderGraph though, it seems, and for hand written shaders there would be other steps. Thanks to this tutorial I also learned about ScriptableSingletons in Unity.
https://bronsonzgeb.com/index.php/2021/10/04/custom-lighting-in-urp-with-shader-graph/
https://bronsonzgeb.com/index.php/2021/10/11/custom-lighting-in-shader-graph-part-2/
https://docs.unity3d.com/2020.1/Documentation/ScriptReference/ScriptableSingleton_1.html - A breakdown of how AAA clouds are done in games, via ray-marching and SDFs.
https://www.youtube.com/watch?v=Qj_tK_mdRcA
2023-01-02
SEEN
2022-12-30
SEEN
- Unity supports proprietary 3D model formats like .max and .blend if the programs are installed. I thought I had Blender correctly installed, but apparently Unity doesn’t find it if it’s installed via the Microsoft Store … a bummer. (It’s not recommended to use .blend files in a Unity project anyway.)
2022-12-25
SEEN
2022-12-23
SEEN
2022-12-22
DONE
2022-12-16
SEEN
2022-12-14
DONE
- I wasted a lot of time today finding out why I get thousands of “Failed to unpersist” errors when stopping the play mode during Patou development. This only happened when starting with certain scenes, in a certain order, with a certain scene being the active one. Really strange and esoteric. In the end I had two options: remove the Volumetric Fog from that scene (because then the error wouldn’t appear), or find out what is actually causing it. I could pin it down to a prefab that had a PolyBrushMesh component attached to it, and thankfully that one was not necessary. Still, what a strange bug, and hopefully it’s not coming back.
2022-12-12
DONE
2022-12-11
SEEN
DONE
2022-12-10
SEEN
- As I’m doing the PICO-8 jam next weekend I’m preparing by watching some videos. This one is very interesting, because it improves the workflow a lot. I should remember how to do the debugging by using printh and tail, and that you can #include Lua files.
https://www.youtube.com/watch?v=srPKBhzgZhc&t=918s
2022-12-09
SEEN
- Watched this interesting breakdown of Zelda: Breath of the Wild’s render pipeline - because there is a strange graphics bug in a certain situation, people wondered why it happens, and this video gives a very long and thorough answer.
https://www.youtube.com/watch?v=By7qcgaqGI4
DONE
- I extended the shader for Patou’s floor fog a bit, so now it allows creating a “hole” inside a certain boundary. For that you need a manager, as the boundary changes per sub level of course.
https://mstdn.io/@ratking/109485341899048091
2022-12-07
DONE
- Not much to report these days, as I’m working on Patou, steadily, but with many smaller tasks not really worth talking about. For example, the tool that I created to be able to make barriers is now more usable, and I actually reuse it for creating “sound lines” - lines where a sound source can move along, which is useful for rivers for example.
Then I changed the barriers so that they don’t just make a big mesh collider, but box colliders along each segment. Now those are triggers which repel the player walking in by turning them around and moving them a bit back. This led to improving how the whole “warping” works a bit, because otherwise the player, especially the dog, would behave wrong.
2022-12-04
SEEN
2022-12-01
DONE
- I will never be comfortable with such a format, generally with talking into a camera, but we did a short development video about Patou, something we want to do more regularly from now on.
https://www.youtube.com/watch?v=nQBG5XqHKAw
2022-11-30
DONE
- My brother and I soft-launched the Ghost in the Paint space today, which has roughly half of the planned content. The file got very big, so there is no WebGL build anymore. I’m satisfied though with how much I could get done within a few days.
https://ratrogue.itch.io/ghost-in-the-paint
2022-11-28
DONE
- While checking on the profiler while working Patou I noticed that there was an Update() method that would create 80 bytes of garbage every frame, but inside I couldn’t find out at first what was leaking it - no foreach, no string, nothing. Only later I noticed that I had a closure (a lambda that would use a local variable) inside an if() then only was true in rare cases - yet the closure was generated every frame. Gotta be more careful in the future…
2022-11-25
SEEN
2022-11-23
SEEN
DONE
- I sometimes have static variables in my Unity components that I set once to initialise some stuff, and then would like to reset them when the game restarts (without restarting the whole application, that is). So I wrote an attribute that helps in this regard. Reflection always feels a bit icky though.
https://gist.github.com/ratkingsminion/d867cb556ec0f03ccacc2674c6b6c276
2022-11-20
SEEN
- A video about pitfalls of generics in C# and how to use them in an allocation-free way. Not bad.
https://www.youtube.com/watch?v=YAOqHj1cUaQ - I really like the light hearted world of Alba, so I enjoyed this dev video about how they approached the open world in Unity. Some interesting take-aways, like how they had to change the trees to a much simpler style because imposters with lots of alpha would crash the performance on mobile platforms.
https://www.youtube.com/watch?v=YOtDVv5-0A4
2022-11-18
SEEN
2022-11-17
DONE
- We showcased Patou once again, at the GameDev Leipzig MeetUp - just my laptop and a gamepad. The few people (it is a very small meetup) who played it mostly liked the music and sounds and also the style of the landscape. The current prototype/game only consists of the “overworld” - the place where you ride on the dog and later on try to find buried memories (which will be small-ish separate scenes). There are some issues with the dog’s movement, but overall I think it works well enough and there were no big bugs. Some performance hiccups though. I am glad we took several steps back and now work more focused on single game elements, in this case the riding and the overworld. It’s just much more motivating.
Most of the work the past week went into this version for the meetup. I wrote a very simple tool that allows me to create a barrier (so people don’t walk outside the terrain). A lot of sounds were added, for example water splashes and their particle effects. The kamis from TRI are back somehow (I reused their spline code at least), and now they help the player to find the memory islands.
2022-11-13
DONE
- For Patou I’m currently trying to bring the screen space fog effect that we use for most of the scenes to transparent materials - just because we will have so many of them. My approach is to copy the whole URP folder from Unity (putting it into the Packages folder) and later on change the MixFog function for the shaders. At first I had a lot of pink materials, but it turned out that I just needed to re-import most of the shaders inside the project. Now onto the actual fog change. But in any case the current version looks already somewhat presentable.
https://twitter.com/RottenHedgehog/status/1591777299959279617 - Added a bit more interactivity to the Ghost in the Paint project; you can now drag down a basketball basket (with a Dreamteck spline). Next on I want to display some text in a Zelda fashion when you interact with the basket.
2022-11-10
SEEN
- Re-learned today that a particle system in Unity does not get automatically destroyed unless the emission module’s enabled parameter is set to false, the main module’s stopAction to ParticleSystemStopAction.Destroy and its loop parameters to false. The last one was what I was missing.
- Another learning: grass on the Unity terrain looks bad in the distance as long as the mip-map settings are suboptimal - one has to set Mip Maps Preserve Coverage to true, and the Alpha Cutoff Value that appears to a value between 0 and 1. But! Setting it to 1 is the same as 0 - so you actually have to change it to 0.99 if you want full coverage.
2022-11-07
DONE
- Implemented copy & paste in the new version of connected. This might sound easy enough, but there are some pitfalls that I had to consider, so it’s not like I can just call Instantiate() and be done with it. For example, I actually have to make sure the copied nodes don’t use the current localised text data (as that one is serialised separately and can change in the meantime), and copied nodes can be pasted even if the user clears the current canvas.
2022-11-04
SEEN
- Reminder to myself: when adding a webhook from Discord to Github, don’t forget to add /github to the secret URL.
DONE
- We’re trying a new-old direction for Patou and getting back to terrains. It’s instantly nicer to look at than our Blender levels, mostly because we can iterate faster; but overall it’s missing a bit of personality though, at least in my opinion. In any case I currently want the player to switch between an “overworld” and different “small islands” which would host the ruins and their puzzles (if there are any). This overworld should only be accessed by riding the dog, and automatically left when unmounting him. This might give it a nice pacing.
- I uploaded SIH, Simple Input-related Helpers, on Github. It’s a small collection of input wrapper scripts for Unity that I seemed to write again and again, so here’s something reusable (untested). With these scripts I can easily add delayed input to interactable objects, making behaviour in the vein of “tap E to consume item; keep E pressed to collect item” possible. The system is for Unity’s legacy Input Manager, but also for Rewired. Unity’s new Input System works very differently, which is why SIH doesn’t support it (yet?).
https://github.com/ratkingsminion/sih
2022-11-01
DONE
- Today I gave another Unity course, again for absolute beginners. The target group is design students, so I tried to be very careful in what to tell and especially what not to tell, but somehow it isn’t always possible to decide.
2022-10-29
DONE
- The grid in connected is now functional, more or less. Next up I should probably do copy & paste, and then do some quality of life things; like extending the settings dialog that I also added. Right now it only has one setting, for the grid size, and being able to change the save paths would be good too.
https://mstdn.io/web/@ratking/109253076471033762 - Last week I “hosted” a game jam for my students; the task was to create a small game depicting a single interaction, based on foreigners working in the German Democratic Republic. It’s interesting that a lot of teams chose not-game mechanics for this. In any case, as they pretty much all used PlayMaker, I will try to give them some scripting basics
2022-10-23
DONE
- I added a grid to the new version of connected, and it instantly looks a bit more professional. It is not really usable yet though, it just looks nice.
https://twitter.com/RatKingsLair/status/1583881853114933249 - While we currently have conceptual problems with Patou I still work on the basics, like adding “atmosphere changing zones” that can change the sunlight, fog and sky whenever the protagonist enters them. It’s somewhat similar to what the posteffect volumes do, but I dislike that they’re only reacting to the camera, so I will have to change those too.
In other news the spine animator I tried does really work for my case, so for now I just removed all spine related components; in the end it will probably not make any difference other than saving me some more time.
2022-10-20
SEEN
- Optional values in Unity - simple, but useful. (See link.) As I like to use [field: SerializeField] instead of just [SerializeField] for properties with public getters, I have to take care to write property.FindPropertyRelative("<PropertyName>k__BackingField") instead of just “PropertyName” inside of the custom property drawer.
https://www.youtube.com/watch?v=uZmWgQ7cLNI
https://gist.github.com/aarthificial/f2dbb58e4dbafd0a93713a380b9612af - Unity/URP: How to get a certain post effect from the stack and manipulate it:
FindObjectOfType<Volume>().profile.TryGet<XYZ>(out var xyz);
xyz.parameter.Override(value);
2022-10-19
PLAN
- I received the beta version of PandaBT 2, and somehow I’m inclined to give it a go. Apart from lack of time I don’t know really what kind of project I’d like to do with it. When I used the first version for Pry I somehow enjoyed it, but also got the feeling I’m making too complex behaviour trees. So I want to keep things simpler this time. Currently I’m thinking of very simple, but many, free roaming agents that serve the player in some kind of 8-bit dungeon, while mean heroes enter their domain and try to steal loot. Some kind of Dungeon Keeper (which concentrates on individual units instead of buildings like in a Tower Defence), but much less features of course.
2022-10-16
DONE
- I’m currently trying to add undo and redo actions to connected. My usual approach is very tricky this time because of the highly dynamic nature of the dialog nodes. I feel like I got the gist of it working, but there are so many edge cases … especially when anything is involved where the nodes have to be rebuilt.
- By the way, I’m still updating the list of “things I learned about C#”, date 2022-10-02. Maybe I should move this to somewhere else.
2022-10-13
DONE
- While it isn’t used in production yet I built a very very very simple spine animator for Patou. The actual plugin SpineAnimator always looks beautiful, as long as you don’t do anything crazy like walking backwards. So I just bend some bones and it might look okay enough, hopefully.
2022-10-10
SEEN
- Apparently it’s not possible in Unity to have a dropdown UI element without selecting options, which for my use case is a bummer. Simple workaround so far: create an empty entry in the options list and always select that one whenever something else was selected. Ugh.
2022-10-09
DONE
- Within the debug menu for our game project Patou it’s now possible to open a “build menu” - where other people, in this case our writer, can create their own NPCs (actually only ghosts) to test an NPC’s position and dialog.
2022-10-07
DONE
- Patou’s new debug menu has a new entry already: toggle the player’s gravity. This way reaching different places for testing is much easier now. I also added grouping to the debug menu, making it much nicer to use. A feature I’d also like to implement is being able to add shortcuts that consist of modifiers and a key.
2022-10-06
DONE
- I added a debug menu to Patou that is easily extensible inside its script. The core functionality is there already (although some extras would be cool), and now I can add two things that are currently missing: a mode to easily fly though the level with Kit, and a “build” mode that allows to create characters, for testing purposes.
2022-10-04
DONE
- Still working on the new FSM for Patou. I try to do the most complex part now, the “Distraction” state where the dog is lured by ruins and other things and should behave differently based on the distance to the ruin and to the player. For now I tried to make this a real matrix with three different states each (player can be near, far, away to the dog, and the same with the point of interest - for both). But this might lead to strange looking behaviour. For example it would probably be much better if the dog is always ahead of the player when approaching the ruin.
2022-10-02
SEEN
- I’m reading the book C# 10 Pocket Reference - and as I use C# only in the context of Unity and also only alone without looking at other peoples’ code, I encounter a lot of new things (and old things) I didn’t know. I should write them down here. Be aware that Unity 2021 only supports C# 9.
- I can write C# programs without any classes - the Main class will be automatically created in that case. Good for small and simple scripts. (Only one file with commands on the top-level is allowed.)
- To create a console program, I need to call dotnet new console -o MyProgram. To be able to give my program arguments, the Main method needs to have a string[] args parameter. It can also return an int.
- I can do logic operations like A && B || C bitwise too: A & B | C. The difference is that all parts will be evaluated, so it will only seldom make sense to use this.
- The type decimal is used in financial matters; it is based on 10 instead of 2. The suffix is M. It’s ten times slower than double.
- I can put underscores in large numbers: 1_000_000.
- Use the keyword checked to give an error if a number is overflowing.
- For lots of Booleans in an array, use System.Collections.BitArray.
- I can use verbatim strings which don’t support escape sequences, for example @”\\server\fileshare\hallo.cs”. In interpolated strings it’s possible to format values: $”15 in hex is {15:X2}”. I can use constants in constant interpolated strings
- It’s possible now to use ranges in array indexers. Indices and Ranges have their own types (Index and Range).
- I should probably use the modificator in more often, as it helps with the performance of big structs as parameters.
- I can use the short form new() for creating an object even outside of declarations, even as arguments when calling a method.
- switch not only has break, but also goto case x, goto default and continue (when inside a loop). I can do a switch case like this: case bool b when b == true.
- And since C# 8 switch can be used as an expression! I like this example:
string cardName = (cardNum, suite) switch {
(13, “spades”) => “King of spades”,
(13, “clubs”) => “King of clubs”, … // _ => … is the default - New in C# 10 - by typing namespace Namespace; at the top of a file all following types are defined in that namespace. Less indentation this way. And adding global to a using directive makes a namespace visible to all files in the project!
- I should remember more often I can “abbreviate” long namespaces via
using XYZ = Some.Very.Long.Namespace; - Deconstructors in C# 7 and later are somewhat strange to me, but could be neat in some places: var (width, height) = rect; (with a method called Deconstruct() defined).
- Instead of set one can also use init for properties - they’re only writable during initialisation then.
- I never use indexers, I wonder if I ever will. public T1 this[T2 index] { get …
- It’s possible to declare partial methods in partial classes. If they’re not extended they are private and must be void. If they’re not extended and not implemented, any calls to them get removed by the compiler(!) and behave like a method with the [Conditional] attribute (which I should use more too).
- In MyClass { public virtual MyClass XYZ() { … } }, it’s possible (since C# 9) to override XYZ() inside class MyDerivedClass : MyClass { … } so that it returns MyDerivedClass.
- Adding ref to a struct restricts its usage as it can only be created on the stack. This can lead to some optimizations. Adding readonly instead makes all fields inside the struct readonly, so it’s more clear what this structure should be used for; it’s also possible to add the readonly modifier to a function inside the struct instead..
- Apart from just internal, protected and private I can modify the visibility of a method or field with protected internal and private protected. Apparently, private protected means the member is accessible only within its assembly. So I can't create an object of the same type as the class I’m inside and access its members too - interesting.
- Explicit implementation of interfaces (via int MyInterface.Foo() { … }) can be used to hide members that may confuse the user.
- Since C# 8 it’s possible to have default implementations of interfaces. Those are always explicit though (i.e. the default implementation can only be called via the interface)! Interfaces can also now have static members, and default implementations can use them.
- Enums can be based on something other than an integer:
enum Side : byte { Left, Right, … } - Generic type parameters can be constrained with where T : <X>, and <X> can be (among others) class, class?, struct, unmanaged, new(), notnull.
- I use System.Action<> and System.Func<> a lot, but I should be more aware that with plain normal delegates I can also use ref/out and even pointers.
- C# 10 finally allows implicit typing for lambdas (so I can just write var hello = () => “Hello!”;).
- With C# 9 came the possibility to have static lambdas, so they don’t catch local variables.
Func<int, int> mul => static n => n * 2;
This also applies to local methods, adding static to them disallows them from using any local variables. - The iteration variable inside a foreach() loop is implicitly local, so it can be used inside a lambda without problems (which is the opposite of how the variables in the for() loop header behave).
- Anonymous methods exist - mostly replaced by lambdas, but they can be shorter by having to write the parameter declarations.
- Using using in front of the creation of a local Disposable variable automatically disposes it at the end of the block.
- Apparently it’s possible to iterate (use foreach()) over a class that has just a Current member and a bool MoveNext() method. To get the enumerator, create a class that has a GetEnumerator() method.
- Initialising a dictionary is possible via var Dict = new Dictionary<int, string>() { { 5, “five” }, { 10, “ten” } }. But also - and this is the way for anything with an indexer - like this: …string>() { [5] = “five”, [10] = “ten” }.
- I never used anonymous types. Apparently they’re not possible to use as members, as they need var and var is not allowed for member variables.
var anonym = new { str = “Test”, num = 100 };
They’re immutable and mostly used with LINQ. With C# 10 it’s possible to add with to create a copy with changed values. - Tuples can have names:
var tuple = (Name:”Brian”, Age:11);
static (string Name, int Age) GetPerson => (“Harry”, 34); - Records are like structs, but immutable, and can be very easily declared:
record Point (double X, double Y);
They automatically have a deconstructor and a Copy() method which allows the usage of with to create copies with different values. - The var pattern for pattern matching looks like a fun extra step.
bool ContainsAOrB(string str) => str.ToUpper() is var upper
&& (upper.Contains(“A”) || upper.Contains(“B”); - I can also use the operators <, >, <= and >= in patterns now. So something like
if (x is > 100) { … }
is useful in a switch. Also the keywords and, or and not can be used to combine patterns. - With LINQ I can project types into an anonymous type during a query:
var query = names.Select(n => new { Name = n, Len = n.Length });
foreach (var row in query)
Debug.Log($”{row.Name} has {row.Len} letters.”); - MinBy and MaxBy look interesting too:
names.MaxBy(n => n.Length); // returns longest name in list - Attention! A lot of query operators of LINQ get only executed when actually enumerating them (i.e. when MoveNext() of the Enumerator gets called). This is called deferred execution.
- With let it’s possible to add a new variable in a LINQ query (in query expressions only, not in lambda expressions). I pretty much never used query expressions, but I might as well.
- I never used dynamic for anything (because I love static typing actually), but who knows if I need it someday? It has some interesting characteristics, but in the end it’s just an object that you can shoot yourself with.
- I wonder if I should try more operator overloading, but on the other side I like to be a bit more explicit in my intentions and thus use method names instead. Yet it’s interesting that I can overload operators like !, |, %, ^ and even true and false.
- I also should look more into how to use Attributes (they inherit from System.Attribute and can be used for classes and members). Via GetCustomAttribute() the attribute is actually callable at runtime. With the attribute [AttributeUsage] I can tell an attribute which constructs are actually applicable. With C# 10 it’s possible to assign attributes to lambdas’ parameters and return values.
- Used for validation and assertion stuff, the attribute [CallerArgumentExpression] returns the actual written code. There are also attributes like [CallerMemberName], [CallerFilePath] and [CallerLineNumber].
- I should look into how my code could benefit from async/await.
var Result = await Expression
Instruction(s), getting called afterwards
Also usable with lambdas! For parallel execution I need to use Task.WhenAll:
await Task.WhenAll(DoSomething(), DoAnotherThing());
There’s also WhenAny. - One can even combine async and iterators:
async IAsyncEnumerable<int> CountAsync(int count, int delay) {
for (int i = 0; i < count; ++i) {
await Task.Delay(delay);
yield return i;
}
}
To consume it, foreach needs to be prefixed with await.
DONE
- I’m currently reworking the Follower character controller for Patou, as the old script became quite messy, and I wanted to give it better extensibility and readability too. My old system uses SUS (my own simple system based on utility theory) and Panda Behaviour Trees, and while it worked, it never felt like a good way to do it - I always dreaded a bit to get back to it to work on it. To be honest though I could still use SUS, as what I’m doing now is basically a recreation of the system, but tailor-made for the dog AI. In the end it’s now a finite state machine that has no fixed transition links, but bases everything on a priority value - just like SUS, but a bit more rigid.
- I can now hover the wires in connected and delete them with a right click context menu. This was a bit more involved only because the wires are done with a custom Unity UI element that doesn’t have a height or width.
2022-09-29
SEEN
- Once again downloaded the Godot "instancing" example project. It's still for Godot 3, and importing it in Godot 4 worked, but when running it, the line @export (PackedScene) var Ball threw an error. Apparently it now should be @export var Ball:PackedScene - which is actually a good change, the former syntax was so alien to me.
DONE
2022-09-27
SEEN
- I was a bit bummed today because I learned you have to call C# extension methods via this.Method() inside the extended class.
2022-09-26
SEEN
2022-09-23
SEEN
DONE
- A small problem in Patou turned out to be a bit bigger: OffMeshLinks. Those are special constructs for the pathfinding system which allow navigation agents to traverse gaps that would normally be, well, gaps. My problem specifically arises when the dog (the agent) tries to reach the protagonist and gets too near while being on an OffMeshLink. The normal behaviour per state machine is that he would just stop walking (i.e. following the path on the nav mesh) and get to the idle state. What happens is that on the OffMeshLink he follows the link to the end (as this is scripted that way) and then instantly follows it back again. There is no way to tell the navigation agent to clear the current Link, is what I learned today; and it’s also not possible apparently to find out if the agent is going to be on a Link during its path (maybe in some convoluted way). So instead I have to check all the time if the agent is on a Link and if the endpoint of the Link is near the player and if so, instantly stop following that Link. This works mostly, but probably only for this special case I constructed; further tests will most likely show the flaws. Oh boy.
2022-09-21
SEEN
PLAN
- As I created a graph of Patou’s behaviour I mostly made myself aware of what the dog actually should be able to do in the game. But transforming this graph into code proves to be harder than I thought; so right now I am still trying to plan the structure of the system on paper. My thinking currently is having “moods” that would be controlled by the dog’s current state. A “mood” basically is either “idle” or “following a target” or “focusing on a target”. It’s basically a usage of the navigation agent’s behaviour. Apart from the base state of the dog following the player, every state has exit conditions, especially if there is another state with a higher priority.
I thought about making the dog much more dynamic, letting him decide for himself how to interpret various parameters of signals by the objects around him (like reachability, danger, usability, distance, maybe even smell …), and that would make him an interesting AI companion maybe, but much less so a useful gameplay tool. And the latter is more important, because otherwise it would be frustrating for the player, never being able to tell why the dog doesn’t do what he was commanded to do. This might be fun if this were some kind of sandbox game, but Patou is much more of a straight forward story and exploration game.
2022-09-20
DONE
- Finally the save and load window came back to connected - and it’s almost complete already. I planned some kind of log within the screen, but I think I will remove it again, and add a general log window instead. This is for things like when writing or reading a file went bad, or just general infos like “file with X nodes loaded”.
2022-09-19
SEEN
- I tried local post-processing volumes in Unity (URP), and I’m less than impressed. The blend factor depending on distance is nice, but they can only be used with cameras (makes sense, but not always what is wanted in a 3rd person game) and the transition is hard when you just teleport inside the volume.
- Today I read an article from a month ago, titled “This game used TikTok to get 120m views, 60k Steam wishlists!". Videos and screenshots of the game look impressive enough, the quality is definitely high. The developers just launched a Kickstarter campaign back then so I checked out how it is/was going for them:
Three days left - and even with a meagre goal of 50K Euros they only got 38K so far (860 backers). The game will probably still get funded; but somehow this shows how damn useless TikTok as a marketing tool is. (And Steam wishlists too, at least for this case.) Update: The game got funded.
DONE
- Some more work had to be done on connected’s code regarding saving and loading; in the end I made it far more simpler than before, where I didn’t understand why I added the complexity in the first place. I also added a new command for the nodes, ced.TypeTextLocalised(), which allows saving its content to a special JSON file for the texts, instead directly into the normal dialog JSON data. (This was of course already done in the legacy Moritalk, but adding SmallBasic to the mix made it a tiny bit more complicated.)
2022-09-16
DONE
- I ported the old saving and loading code to the new version of connected, and it works so far, but I didn’t test it too deeply for now. Of course simply saving some JSON would have been a no-brainer, but the dynamic nature of the dialogs makes it much more complicated (for example, JUMP and PIN nodes have to be removed first, by rerouting their connections, for the saved dialog file that is to be used in games).
2022-09-14
SEEN
DONE
- I added an extendable top bar menu to connected; it’s not perfect yet but I might reuse it for Patou.
2022-09-13
SEEN
DONE
2022-09-12
DONE
- While I’m still thinking about how to tackle the main menu in connected (how dynamic it should be), I finally added (working) panning and zooming. Much more usable now.
- I created a visually appealing graph of Patou’s behaviour - it mostly shows which actions of the dog already work, but some things are still missing. The most important part though is that it is now relatively well formalised. And it makes me feel like I should start from scratch …
2022-09-09
SEEN
DONE
- Doing small stuff for the new version of connected, like adding little up/down buttons to the number fields, or making it possible to create nodes by dragging a wire from an IN connector. Hopefully this means I feel comfortable with the code again and can do the important additions like undo/redo, a main menu, save/load and so on.
2022-09-08
DONE
- I’m still updating the legacy version of connected from time to time, because the new version won’t be ready for the foreseeable future - I just don’t get around to work on it anymore. So now at least I added a config file that lets the user define where the different JSON files get saved, and the number of backup files.
2022-09-06
DONE
- Several small things done for Patou, nothing that noteworthy; there are now small texts that can appear over the head of the protagonist, and do appear when talking with an NPC. It does make the texts less “UI” and more grounded in the world. Portals can be better handled now thanks to Odin. Overall we’re mostly busy with planning and defining the dog’s behaviour more precisely, so the AI of the dog will probably be my main task in the coming weeks, again.
2022-09-01
SEEN
2022-08-30
SEEN
- C#/Unity tip: I dislike having only “Nothing” and “Everything” as names for these options of an enum flag, but I found out I can rename them by adding, for example, None = 0 as first element and All = ~0 as last element of the enum. (It must be the last one.)
https://twitter.com/RatKingsLair/status/1564588831562776576
DONE
- I wrote a blog post about my recent work on Patou’s NPCs. And today’s work mostly was making camera positions easier to handle for when creating a new NPC - of course this won’t reach the cinematic quality of most games nowadays, but I find it better anyway to have a more minimalistic approach. Mostly because of being able to finish the game with 2-3 people only …
http://ratking.de/patou/2022/08/30/talking/
2022-08-29
SEEN
DONE
- I’m more and more using Odin when I feel the need for it, and it really lets you make some neat tools inside Unity without having to create your own custom editor. So for Patou I wrote a script that would make parts of a character visible or not, to have a more diverse “cast” of ghosts. (This is an ancient technique of course, and I used it back then for my little goblins in Fascinated by Evil.) Such a script sounds pretty easy to do, but can be a bit tricky when it comes to usability for someone using it from the outside. Odin helped a lot to make more sense to the Inspector display.
https://fholio.de/assets/projects/fascinated-by-evil/02.jpg
https://odininspector.com/attributes/table-list-attribute - I finally fixed some bugs with the current connected dialog editor - the test mode wouldn’t work anymore, and it didn’t save changed texts inside the Text and Choice nodes. I really need to work on the new version of connected, especially as Patou will need a lot of specialised commands.
2022-08-26
DONE
2022-08-25
DONE
- I currently try to make Patou’s NPCs more reusable, so while the rudimentary Troll and Ghost characters still work as intended, it would be cool of course to have more options regarding their animations. So I tore a lot of components apart, and even added Small Basic once again. It’s still a rocky road though. But the more I work on it the more I feel confident with this.
2022-08-20
SEEN
2022-08-17
SEEN
DONE
2022-08-15
SEEN
2022-08-12
SEEN
2022-08-11
SEEN
2022-08-10
DONE
- For over a week now I worked on the aforementioned Snake clone. I try to generate a snake body on the fly in Heaps, which isn’t that easy if you’re used to all the maths functionalities in Unity, but somehow I managed to create something I like. The part of the snake digging down into the dirt is missing though, so after adding a head that will be my next task.
2022-08-06
SEEN
- Today I found out that the slerp() method for Heaps’ quaternions is broken in some cases. I wrote an issue for that, maybe someone will pick it up. I’m always amazed when I find such bugs.
https://github.com/HeapsIO/heaps/issues/1088
2022-08-04
SEEN
2022-07-30
SEEN
DONE
- We showcased Patou at the GameDev Leipzig Meetup two days ago, and it went well enough. We compared the old prototype with the semi-”realistic” graphics with the new style. As preparation for a playable demo I also did some small stuff like giving the troll NPC several animations or letting the dog rotate his head when walking.
https://ratking.de/patou/2022/07/29/gamedev-leipzig-meetup-in-july/
2022-07-25
DONE
- I added a sun to the sky shader in Patou, which was not hard to do - at least much easier than trying to make a big sphere rendering behind all the other objects but not being affected by the fog. The downside is that the fog post-effect we use blends over to the skybox, and so it can look like the sun is in front of objects far away. But well, this is a dreamworld, after all.
2022-07-24
PLAN
- I wrote down the concept for a little Snake-like dungeon game. The idea is that you actually control an earthworm who is capable of digging through dirt (in a limited manner). We’ll see if this will be fun. In any case it should be jam-sized more or less and doable in a relatively short amount of time, especially as this might be the second collaboration with voxel; although 666 Coins technically isn’t finished and not yet off the table of course.
DONE
- I finally found out what was causing the jittering when riding Patou. The problem was that I directly asked the transform’s position instead of doing that via the EasyCharacterMovement’s component. Always a new thing to consider, ugh.
2022-07-23
SEEN
DONE
- Because the dither shader (for vanishing Patou’s player model when the camera is near) has unexpected problems with the outline effect we’d like to keep, I changed it to some noise effect. It looks a bit like the kid is getting shredded, which is not the worst though, because this is all about memories and how they get lost and resurface sometimes.
2022-07-20
DONE
- I followed a tutorial for simple noise based “puffy” cloud layers, done with ASE. Just the thing I needed for Patou. We’ll see if it’s actually a viable shader, but it looks good enough for now. It’s for the void in between the floating islands, so there should be more optimizations possible.
https://nokdef.com/Articles/Stylized-Puffy-Clouds-Shader/
2022-07-19
SEEN
DONE
- I slightly updated our website, adding Patou, HAQR and bloed.
https://www.ratking.de/ - Also updated my portfolio - 666 Coins, Holocode, Alternative Artefacts, The Last Dream and HAQR - Der unsichtbare Raum were added. I’m on the fence if I should mention Behind Stars somewhere on it, because it was a lot of work, but then again it was never released.
https://www.fholio.de/
2022-07-16
PLAN
- As with the depressing news of Unity merging with a malware company and such, I want to get back to find another engine/framework/whatever for making small-ish games. Of course most things pale in comparison to Unity’s editor and ease-of-use and asset store and C# support and… Well, you get the idea. Anyway, I had fun before with Haxe and Heaps and other frameworks, so maybe it’s all about being a bit more persistent this time. It also doesn’t mean I will abandon Unity completely - too much knowledge would be lost, and too many cool tools at my fingertips would be not available anymore.
luxe engine - something I will try when it’s finally released. As with most similar engines/frameworks, having only a few people working on it is always a disadvantage. It being completely new and using wren as scripting language means there won’t be much outside support for a long time I’m guessing. I also don’t know its 3D capabilities.
https://luxeengine.com/
Flax Engine - a somewhat interesting amalgam of Unity and Unreal. It’s sad they took the centimetre units of Unreal, which made it instantly worse for me. But that’s a nitpick. Last time I tried it I liked it well enough and I will look further into it, especially as it supports C#. Not sure about its future though.
https://flaxengine.com/
Stride Game Engine and Focus Game Engine - the latter is a fork with various improvements of Stride. I list this here because it pops up frequently, and it’s 3D and uses C#. So it’s basically Unity, but not?
https://www.stride3d.net/
https://github.com/phr00t/FocusEngine
Defold - last time I tried it I was not really convinced by it. Mostly because it’s 2D focused, and the Lua scripting, even though I like Lua, made me somewhat miserable. Still, it might be time to look at it again, as it has support from big players now.
https://defold.com/
Heaps.io
Whenever I used Heaps I liked it more than I disliked it. Haxe is a cool language overall. I just don’t know I would use it for more complex 3D stuff, as I hit limitations with It Rains already pretty quickly.
https://heaps.io/
Kha
In the end it wasn’t much different than using Heaps when I did some ray-caster with it a while ago. But as this was like a 2D project, I would have to do more 3D tests first. Apparently it’s fairly cross-platform.
http://kha.tech/
Godot
Everytime I try Godot I’m super stumped by the node system. It seems I just can’t wrap my head around it, or rather my project. At least it supports C# more and more. Maybe with Godot 4 I will try it again, but I must say that waiting so long for a new version makes me a bit wary regarding the future.
https://godotengine.org/
Armory3D
I only did my simple cube puzzle game with it as a test, but everytime I look into it it feels unstable and a bit awkward how the components work together, due to it being imposed on Blender. Its biggest pluses are Haxe, and being cross-platform (theoretically).
https://armory3d.org/
raylib
Even though this is pure C and the 3D capabilities always look a bit sub-par, it might be just fun to do a small 3D puzzle game with it or something.
https://www.raylib.com/
DONE
2022-07-15
SEEN
- I read an article about how Unity and Unreal and so on are shit because they’re, basically, evil megacorps (probably true) and you should make your own engine. I’m all for that, somehow. I just don’t have the time (or rather: interest in it). Anyway, the article talks about using other frameworks instead, like LÖVE, which in the end isn’t that different in my opinion.
https://blood.church/posts/2022-07-14-making-your-own-engine-a-survey-of-the-landscape.html
2022-07-14
SEEN
- Today I learned that Unity’s NavMeshBuilder.UpdateNavMeshDataAsync() wants local bounds, and they need to be at least the size of world units as displayed in the NavMeshSurface (which is VoxelSize multiplied by TileSize). Nobody told me, so this took very long to debug / find out. Also this seems to be only one part of the truth (I guess the position is also quantized), but investigating this more is kind of a waste of time right now.
- Another coding tip: instead of using the distance to the next waypoint, just projecting the vector is more robust and probably more performant. (It might not fit all use cases though, I think.)
https://www.habrador.com/tutorials/math/2-passed-waypoint/
2022-07-12
SEEN
- Interesting Unity tip: while having several GameObjects selected, you can use R(min,max) and L(min,max) in the inspector fields for bulk changing their properties, either randomly or evenly distributed.
https://www.youtube.com/watch?v=pM8HSaIs1Gs
2022-07-11
SEEN
DONE
- I played around with Allegro 4.2 again, and dug out some old C code I wrote over 20 years ago. Ah, the good old times… Anyway, I have to use Allegro 4.2 and not the newest version because this is for a DOS project, and 4.2 is the last version to support DOS. The project itself is very simple, just displaying some paintings by my brother. So I didn’t bother too much with a well-crafted compilation pipeline. I just use the prepared Windows version of Allegro provided by Matthew Carr which compiles DOS executables directly. I test the executables manually in DOSBox. Works well enough for me.
https://www.mrdictionary.net/allegro/
https://www.allegro.cc/manual/4/
2022-07-08
SEEN
- Watched a short video about story writing. Glenn Gers recommends these essential six questions when writing a story: Who is it about? What did they want? Why can't they get it? What did they do about it? Why doesn't that work? How does it end?
https://www.youtube.com/watch?v=uL0atQFZzL8
2022-07-07
SEEN
DONE
- Apart from some simple stuff for Patou - having some portals to instantly teleport to different “islands”, generalising the digging sites for the dog, etc. - I worked a bit on shaders for the floor of the game. So the floor now uses a splat; . A bit hard to explain. In any case I also wrote a tool so I can paint the texture directly on the mesh, because somehow such a tool does not yet exist; which I find extremely strange. At least I could not find one.
2022-07-03
SEEN
DONE
- I changed how the player guides the dog in Patou quite a bit. Instead of directly selecting every “affordance” for the dog the player has to keep the LMB pressed and then it creates a line similar to the throw preview line. This way it’s more obvious how far your command reaches. Now the player pets or mounts the dog with the same key they would use to press buttons or activate other things, somehow this makes sense to me. I’m sure though that things will change again when we have more actions the player can do with the dog.
2022-07-01
SEEN
2022-06-28
SEEN
2022-06-27
SEEN
2022-06-25
DONE
- A small thing, but maybe very important for the gameplay. I added a quick air friction factor to the player in Patou, just so jumping forward isn’t that powerful. This will be relevant for the puzzle situations, but it might make some people mad. We’ll see.
2022-06-23
SEEN
2022-06-22
SEEN
DONE
- I work on and off on the moss shader for Patou, and it has its merits, but overall there are some hard problems like the bending of the normals, and I don’t really know how to solve that. Hopefully I’ll find a way.
https://mstdn.io/web/@ratking/108525364851843127
2022-06-20
DONE
- I tried to create some kind of moss shader for Patou, which places some moss colour only on the top of the object. Though it goes in the right direction, it’s of course a problem that a lot of models don’t have the correct normals for such a shader - they should be smooth everywhere, which would look bad of course with the lighting. So I try to put smoothed normals into UV3, but that only works apparently if I duplicate the mesh. In any case I will probably have to spherize the normals just so it looks even more “natural”.
And we did the very first test of the game on the Switch, i.e. I got the Rewired plugin for correct input. It ran slowly, but somehow faster than I expected. But optimizations will have to take place, a lot.
2022-06-18
SEEN
- Today I read that alpha testing is ill-advised on the Switch, and performance is better if you use alpha blending. Ugh. I’ll have to test this soon-ish …
2022-06-17
DONE
- I tried to create a more robust system for Patou’s “puzzle” elements. So instead of a trigger directly manipulating a moving platform (for example), the designer (mostly me) adds behaviour scripts that listen to these triggers and then do the manipulation. This way intertwined scripts are easier to do, e.g, you might have to press a floor platform and a button to move a platform.
2022-06-14
SEEN
DONE
- Finally, a happy ending for my Tab shortcut problem with bloed. “Mad” on the Unity Discord showed me the solution: a keyboard Event in the editor has *two* KeyDowns - the second one with KeyCode.None. I have to call Use() for that one as well.
Well, after a bit of testing the happy ending actually isn’t happening. There is no KeyCode.None event for Tab in Unity 2021. It works in 2019 (and 2020 probably) though. So, who knows what’s happening here. My hacky solution of emulating a right mouse button click is still valid I guess. - I wanted to fix the sideways moving platform in Patou because it will probably get used in some puzzles and maybe in other instances as well. Kit would move her feet even when standing still on the platform. The first step was giving her a “reference transform”, so the animation would be based on what Kit currently stands on (if needed). And after only more than a day of work (ugh) I fixed the tiny jitters by replacing transform.position with Rigidbody.position (of the character)
2022-06-13
DONE
2022-06-12
DONE
- I have several shortcuts in bloed which I handle by using Event.current inside a method registered to the SceneView.beforeSceneGui callback. One of the shortcuts is the Tab key, to change the rotation of the currently selected bloxel. This works for nearly all the shortcuts; for the Tab key too, as long as I use bloed in Unity lower than 2021. With 2021, the Tab KeyDown event selects the first item in the Scene toolbar (e.g. the Scene search). Which means the next Tab press cycles to the next element and so on. Other shortcuts don't work either as long as something in the toolbar is selected. By the way, pressing Tab actually behaves similarly in Unity 2019/20, but instantly deselects the search toolbar afterwards. So for Unity 2021 I try to mimic this behaviour - when the user presses Tab, I create an Event that fakes a right mouse button click, inside a callback registered to EditorApplication.delayCall. This works - almost. Annoyingly, it has a strange glitch: the bloed cursor moves a few pixels upwards during that fake event. At first it was not clear why - I use the same mouse position from the Tab key press event! After a bit of searching I stumbled upon a forum post describing a similar problem. The very same toolbar is once more to blame. Somehow the mouse position I give the event is not the mouse position that I get. Or something. Anyhow, the proposed solution is scary - getting the toolbar's height, adding it to the position before I feed it to the event. Apparently - as I was told by Mad on the official Unity Discord - there is a better way to completely catch the keyboard events. I do hope they will someday allow me to see this wondrous solution.
https://twitter.com/RatKingsLair/status/1535930053388804096
https://forum.unity.com/threads/mouse-position-in-scene-view.250399/
2022-06-08
DONE
- Kit is now able to throw a box precisely onto a platform (if she’s near enough), as the throw trajectory “snaps” a bit to the centre of the platform. To make sure the box does not leave the box, I remove the forces when it touches the correct platform. Now I have to think about what to do with this - Patou will try to get to the box, catch it, and bring it back to Kit. This is of course not wanted - so I’m thinking about adding little throwable stones for the player that are only there for guiding the dog, and the box is for different things.
2022-06-07
SEEN
DONE
- For Patou I experimented a bit with a shader I call the Whiteness - we want to reproduce the feel of being in a sketch or art work by adding a white blobby outline to the whole screen. It’s harder than I expected, but even in the very ugly version it adds a bit of novelty. I don’t think this one will be finished anytime soon though.
2022-06-01
DONE
- I submitted HOLOCODE. It’s missing a lot of things, especially sound, some story and testing, but at least it has some content and the idea in itself is what I wanted to try out.
This also concludes the 12th Kajam that I hosted. I’m pretty disappointed by the low turnout, and I will definitely not host a Kajam again. The audience is just too small, and the Kajam is thus a niche within a niche.
https://alakajam.com/12th-kajam/1302/holocode/
2022-05-31
SEEN
DONE
- A lot of additions to 256 bits - probably named HOLOCODE from now on - and the deadline for it is today. It’s by far not finished or in the state I think it should be, but I want to submit at least *something* to my own jam.
2022-05-25
SEEN
- I noticed that Visual Studio 2022 would close all tabs whenever I create a new script in Unity - apparently I’m not the only one affected, and thankfully a fix is on the way. Ugh, always such annoyances.
DONE
- I worked a bit on how the camera rig systems in Patou, it looks much nicer now when there’s a switch between dialog and walking - and throwing. A dedicated cam rig for throwing is the first step towards a better throw mechanic in general, to make this less of a hassle in combination with puzzles. It is planned to not directly command the dog to platforms and stuff anymore, but guide him by throwing things. This of course means that the throwing should be much less error-prone, which is why I’m reworking it.
- The memory blocks in 256 bits can now have wrapped selection rectangles.
2022-05-23
SEEN
DONE
- I finally defined a “puzzle” in 256 bits and it opens a door on success. There is so much stuff to do, and it might be too boring for a game, but I think I will be able to submit something at least. Tomorrow I’ll try to layout an “outer world”, but before I actually get to building it I first want to add help screens and a “physical” start button to the holo-world. By the way, in the end my implementation of negative numbers was flawed, so this was fixed as well now.
2022-05-21
DONE
2022-05-19
SEEN
DONE
- Because I somehow felt up to it I made the “ruin trigger” pressure plate activating based on weight (well, kind of) in Patou. I added a function that would find all rigidbodies on top of a collider, so that was the missing thing. Because just checking for forces applied to the pressure plate doesn’t work reliably (as physical bodies can “go to sleep” and then wouldn’t do forces anymore), and just checking everything inside a trigger lets through far too many false positives.
- In 256 bits it’s now possible to manipulate the single nodes - e.g. change the calculation method of the CALC node. The most important part though is the BLOCK node that contains information about which portion of a Bitfield to use. Bitfields basically are data storage, represented by a various amount of bits, and could theoretically be changed outside of the virtual computers. I am still thinking about how to do the ASGN (or COPY) node, because if it uses a DATA OUT connector, then I also need BLOCKs to have an IN connector. I wanted to reserve that for changing the X/Y values.
2022-05-18
DONE
- So I finally decided against using A*PPPro for Patou, at least for now, because I found a way to update the nav mesh without any frame loss. For example, there’s a hidden parameter, named preserveTilesOutsideBounds, which is very useful for updating only a part of the mesh without removing the rest. It’s a shame that the API of the navigation stuff is mostly guesswork, because the underlying tech is powerful enough for our game.
https://forum.unity.com/threads/update-navmesh-at-runtime.475237/
2022-05-16
SEEN
- I watched a YouTube tutorial about dynamically baking navigation meshes in Unity. It feels like this is always connected with a loss in frames, even though it’s done asynchronously. It makes me consider using A* Pathfinding Project Pro again for Patou, but I think I will use a lot of prebaked nav meshes instead, especially as we probably won’t use the Unity terrain anymore. I just don’t want to change the whole nav agent stuff for the dog.
https://www.youtube.com/watch?v=RuoK7w1OIT0
DONE
- A few days ago I created a shader for Patou that would gracefully hide an object that is near the camera (using dither, because transparency always is ripe with problems) - which is of course for the player model, so the player can’t look inside of Kit (always a bit creepy when eyes and teeth float in the air). I now tried the same for the dog - which uses another shader, from the fur asset, so I had to expand that one with an ASE function. Unfortunately the fur seems to ignore the position of the object and is always at 0/0/0, which means I have to take the fragments’ world position, and this just doesn’t look good. I guess I will make another specialised version of the shader function and feed it the world position directly.
2022-05-14
DONE
- I added a big portion of the programming functionality to my Kajam 12 entry (working title is 256 bits). The user can place nodes and connect them via wires. Everything is a bit wonky, but it mostly works - now I have to think of the actual nodes, and what kind of tasks are to be done within the game.
https://mstdn.io/web/@ratking/108302063101553181
2022-05-12
DONE
- Still a bit sick, but I worked on my Kajam 12 entry. My plan is to create a programming game where you have to jump inside the “computers” to solve the puzzles. Right now I have a room with nicely glowing edges everywhere triangles don’t share a normal - this will be the “VR room” look maybe. In any case I’m quite inspired by System Shock and System Shock 2 and maybe a bit by Wreck-It Ralph. The glowing edges are a side effect only - I actually need them to check collisions for some wires.
2022-05-09
SEEN
- Pressed the two analog sticks by accident and suddenly a debug menu popped up in Unity. Why the hell didn’t I know about this?
2022-05-08
PLAN
- The Kajam ends this month, and I’d really like to make an entry too. For now I’m planning to make a simple fantasy console / esoteric node-based programming language. The part that interests me right now is the visualisation of the “internal memory”, as a simple bitmap square.
DONE
- As planned, yesterday we showcased Patou at the Lange Nacht der Computerspiele. It was somewhat strange to get back to in-person events with sometimes dozens of people in the same room, but most of the time it was a good experience. People loved riding the dog, and overall the game prototype worked smoothly. There were some actual game stopping bugs though, one where the dialog of the troll would stop working, and one where the player character gets stuck forever.
2022-05-04
DONE
- After we streamed a bit of Dungeon Keeper, one of my favourite games, I noticed that I never uploaded one of my better jam games, DANGEON!, anywhere. So now here it is, in all its glory. Still proud of it.
https://ratking.itch.io/dangeon - I’m finally *somewhat* content with how the character controllers function in Patou. There are still some issues with the spine animator plugin that I’d like to see fixed (the back feet are often dangling in the air), so I contacted the developer about this. Maybe it will improve in the near future. Overall we’re now preparing the prototype, as outdated as it is, to showcase it at the next small exhibition this weekend, at the Die Lange Nacht der Computerspiele (Long Night of Computer Games) in Leipzig.
- Totally forgot to mention that TRI: Of Friendship and Madness, our non-smash hit from 2014, finally also has Simplified Chinese localisation - thanks to EchoriverTranslators, who did it for free basically. Crazy stuff.
http://tri-game.com
https://twitter.com/ertranslators
2022-05-02
SEEN
2022-04-29
DONE
- A lot of work went into actually simplifying the character controllers of Patou. I looked at Horse Animset Pro, and while it is far more complete than my own solutions, and of course works much better in most aspects, again I decided not to use it. Mostly because it seems to force things on me that I didn’t like. In any case the Walker character is now mostly where I’d like it, but the Rider controller needs more love.
I also finally wrote a janky little tool to combine and unify all the grass detail prefabs of all the terrain chunks - this is only needed for the prototype because we won’t use terrains anymore later on.
2022-04-25
SEEN