Friedrich Hanisch's Dev Log
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.)
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.
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
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
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.
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
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. Though I'm satisfied with how much I could get done within a few days.
https://ratrogue.itch.io/ghost-in-the-paint
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() that only was true in rare cases - yet the closure was generated every frame. Gotta be more careful in the future...
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
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 good 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
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 protecte 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.
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.
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
SEEN
- I was a bit bummed today because I learned you have to call C# extension methods via
this.Method() inside the extended class.
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.
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.
SEEN
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".
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 Small Basic to the mix made it a tiny bit more complicated.)
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).
SEEN
DONE
- I added an extendable top bar menu to connected; it's not perfect yet but I might reuse it for Patou.
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 ...
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.
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.
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.
SEEN
- Once again I was stumped that I couldn't see my UI elements in the Scene view, but this tip helped: check that the URP Rendering settings have the UI layer included in the
Transparent Layer Mask. Damn Unity.
https://forum.unity.com/threads/ui-invisible-in-scene-view-but-works-in-gameview-shader.1308900/
- Learned more about attributes from Odin Inspector -
TitleGroup, ButtonGroup, InlineButton, ValueDropdown, PropertyOrder. Feels like these will really increase my productivity.
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/
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.
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.
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.
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
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/
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.
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.
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.
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/
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/
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
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
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/
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
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/
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
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 map. 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.
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.
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.
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
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.
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 ...
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.
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).
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/
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.
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.
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/
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.
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.
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.
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.
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/
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.
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
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.
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?
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.
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
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.
DONE
- Nothing substantial, but I submitted HAQR - Der unsichtbare Raum to the Google PlayStore. It went mostly painless, I just had to find my signature keys' password again. I am sure there will be complaints though, so I don't expect the app to be ready for Die Lange Nacht der Computerspiele (where we will showcase it, in a way). There's still the itch.io download of course.
SEEN
DONE
- I finally submitted bloed to the Unity Asset Store and got an email that it might take up to 33 business days to get back to me. Ugh. At least this is out of my brain now and I can finally do meaningful stuff. Oh, and I changed two small things, so there's also version 1.1.1 up on itch.io.
https://ratking.itch.io/bloed/devlog/369961/bloed-v111
- Once again I changed the base character controller for Patou. I am not happy about that, but I think Easy Character Controller 2 is, after Character Movement Fundamentals and after that my own controller, so far the most robust solution. Of course there are still things I find annoying, but it feels like I can work around them. In any case this is all taking much too long, but will hopefully be a net plus in the end.
DONE
- I updated bloed to version 1.1, with the new Cuboider tool being a great improvement if I may say so. I should finally make a quick introduction video for bloed and be done with it. Overall there is far less interest than I hoped.
https://ratking.itch.io/bloed/devlog/368009/bloed-v11
- The Organize node for connected is coming along and a user could change its text and font size already. The main functionality, using it as a group, will be in focus as soon as I get to implement selecting and deselecting nodes.
DONE
- So for my own test case in Patou I set the
Physics' fixed delta time from 0.02 to 0.015, and this makes the problematic jitter pretty much disappear. I hate this solution, it feels like a random hack, but for now this makes everything smoother anyway - even the dog riding strangeness is looking much better now. But of course this will have to be revisited at some point in the future.
DONE
- I'm still working on and off on the character controller for Patou, and instead of actually getting results I'm still pulling my hair about jittery movement. I really don't know where this comes from, the other CC works quite well without doing much differently. Ugh.
- I added some visualisation of connected Jump nodes, and it works well enough. I also made a more dynamic (and correctly functioning) resizing capability for the Text and Choice nodes. This will also be the basis for the upcoming Organize node (in the old version this was called the Comment node).
- For bloed I want to make a better Cuboider tool - so I changed the current Cuboider to be the standard Bloxer tool and copied stuff from the Copy&Paster to the now new Cuboider. I already can create very big cuboid rooms/blocks this way, but a lot of more polish is needed.
DONE
- The Jump node is back for connected, and I had to make the IN connectors more dynamic for that. Theoretically I now could add more than one IN connector, but for this tool it's not needed. Maybe I can think of something, though. It's always nice to have options.
- Currently I'm also working on new character controllers for Patou, because even if an asset is good overall, it will never satisfy all my needs and will always be awkward to use. And while my controllers were never perfect either, at least I have (more or less) full control over them. So, as usual, I imported my old character controller for Pry and 666 Coins and changed it a bit so it would be usable for a game with third person perspective. Somehow I had to put a lot of work into making sure it doesn't jitter all the time, and I don't really know why it actually jittered - it seems the camera should follow the character in FixedUpdate(), but that feels wrong too. So now I have a lot of smoothing in several places and it mostly works.
Apart from that I thought a lot about how to do the "horse controller", as that's what the dog kind of is in the game. For now I created an extremely simplified version of the normal character controller and let it follow the main controller, like an appendix. This way I have a character that consists of two capsules, defining some length, and so I plan to put the 3D model of the dog into the middle of the two. I am eager to see if this works, but I am sure it won't look great out of the box. And there's also the question how to do the whole ordeal for the dog when it's just a follower, i.e. a nav mesh agent. I think I will just do the same for that and accept 95% of the strange edge cases that this will produce.
DONE
- Did some small stuff for 666 Coins - changed the fog from linear to radial, added an introductory text to the tournament, and the flying enemy is saveable now. The latter needed some rework, especially as the enemy's path referenced the path nodes - which can, on load, not exist. Instead it uses the raw positions now, and while there might be problems with blocked nodes, those should be very seldom.
DONE
- I fixed some issues in bloed, but I should wait for G.P. or someone else to check it for new bugs I might have added. In any case I really should do a short video, showcasing what bloed can do, and submit it to the Asset Store. I don't expect any sales though.
- Made a short video of the Switch node of connected. It has a white text colour now, and moreover it's 95% functional - the only thing missing is the individual mirroring of the OUT connectors.
https://twitter.com/RatKingsLair/status/1509428866422616064
DONE
- (connected) An annoying visual glitch with layout groups not updating instantly, leading to OUT connectors being at the wrong position for one frame at least, could be solved by this thread. I just had to make sure I am actually calling
LayoutRebuilder.ForceRebuildLayoutImmediate() for the correct parent, and in LateUpdate().
https://forum.unity.com/threads/force-immediate-layout-update.372630/
SEEN
- Never heard of the
[Delay] attribute before, might be useful at some point, when there's more stuff to calculate in OnValidate(). But it really should be the standard behaviour anyway... What a coincidence, it's something I had to think about yesterday when I made the Switch node for connected.
https://twitter.com/BinaryImpactG/status/1506229641933213696
SEEN
DONE
- The Switch node for connected is quite a challenge, because it needs a lot of special things. For example, the "random" switch has several labels that indicate which probability each case has (based on the value entered by the user). Those labels have to be updated anytime that value was changed. This isn't super easy with Small Basic, so once again I had to put scripts inside strings. As usual, it's a bit awkward, but it works quite okay, and as an alternative it's always possible somehow to create a subroutine.
DONE
- Last week I created and finished the Hand of Fate, the new enemy for 666 Coins - a floating hand that would punch the player when it notices them. When it roams through the dungeon or chases the player it also takes closed doors into account, which is nice. I could improve my pathfinding algorithm quite a bit, so in the end I gave the new enemy type the "approved" stamp and was eager to see it in the Tournament Edition of the game.
Except this was just a wet dream - voxel tested the enemy over the night (or rather his day) and noticed such severe performance flaws with the pathfinding algorithm that I did the best/worst thing possible and removed the enemy before uploading the game to itch/Alakajam.
Then, over the weekend, while having no access to Unity, I tried to improve the pathfinding blind, with no compiler. Before that I actually did some deep profiling and noticed that using my Position3 structs would create some (memory) garbage, and iterating over the whole list of open nodes every time to find the one with the lowest F is also a bad idea. So the first, simple yet very effective step was adding an integer index to each node and using that instead of the position when putting them into the hash maps. Then I wanted to get rid of iterating over the nodes by inserting the nodes into a linked list at the right position from the start. Turns out LinkedList<> also generates a ton of garbage because it actually creates a LinkedListNode<> for each entry. In the end I replaced it with my own simple linked list implementation, using the pathfinding nodes directly. The final result is that I don't even have to use coroutines (which I planned to do) for creating the paths - generating them is super quick now. But what a weekend that was.
https://alakajam.com/post/1642/666-coins-tournament-edition
SEEN
DONE
- There were some really jarring visual glitches since I switched Patou from BIRP to URP - mainly bright white spots flashing whenever the dog was in the view. After some checking and testing I could determine that the error was happening due to the Fluffy fur shader somehow producing negative colours sometimes, which produced bad results with the bloom effect of URP. So I added a
Max node to the shader of Fluffy (via ASE), and told the developer.
- I streamed 666 Coins a bit, mainly the development of a flying enemy type. I didn't get very far, but at least there's a box that finds a path between two random points and flies along that path. It looks very awkward, as this is inside a grid, but I guess it's better than nothing. It ignores doors, which should not be that hard to implement, and I still don't know what attack pattern the enemy should perform whenever they see the player and are near enough to them. I also need to improve the pathfinding algorithm as it does some very stupid things.
DONE
- The last 3 days I mostly worked on a new HAQR adventure, Der unsichtbare Raum, as there will be some kind of exhibition at our office building. We show High Five Romance Race and maybe Mondar's Dungeon, not because they're our best projects, but they are pretty easy to showcase and Patou isn't ready yet for a long time. In any case, Der unsichtbare Raum is using the old HAQR code base but extended, and the story is a more fun adventure overall if I may say so. Again it was just fun to write the logic in Small Basic.
https://ratking.itch.io/haqr-unsichtbar
DONE
- I took the first steps to convert Patou's Unity project from the Built-In Render Pipeline (BIRP) to the Universal Render Pipeline (URP), the latter being stable now, allegedly. So far there are some strange things happening to the terrain, and the process made me notice that the Nature Renderer plugin we use doesn't actually support Unity 2021, and the version that supports needs a subscription. Blergh. I want to reduce Patou's complexity anyway, this might be the incentive to get rid of some of those "nice to have" features that only bloat the thing. Overall we still need to think about if and how we want to plan for Switch support, because the terrains are going to cost us.
- Version 1.0 of bloed is up on itch.io. I took some liberties with the version number I guess, but I didn't want it to be a 0.x when I actually put it on the asset store. (Still need a video for that.)
https://ratking.itch.io/bloed/devlog/358183/bloed-v10
DONE
- Several small things were done for 666 Coins' Tournament version, mostly to distract me from the biggest TODO: flying enemies. But well, now the walker enemies teleport the player back to a place they came from instead of just a random position. (This was done via breadcrumbs.) The floating mask enemy only shoots when it sees the player. Tables give the player a special crouch height so they can hide beneath them. Rats walk up and down steps much nicer now. The Tournament does not save the game state anymore.
DONE
- I added a "prize detector" (actually it detects the Jamician statue) to 666 Coins. While the most important part is missing (respawning of the prize), this means it's kind of ready for being part of the Alakajam Tournament. There is a lot of other stuff missing though.
- Progress on connected is very slow, but steady. It's now possible for a node to have more than one out connector - dynamically. It will become "fun" as soon as undo/redo is involved I'm sure, especially with more than one node. Next steps: being able to delete nodes and connections, and adding more node types, especially condition and "set variable".
DONE
- And more bloed stuff. A frantic bug hunt, mostly consisting of writing a method that would search and fix inconsistencies in the bloxel chunks. In the end it was a
!= that should have been a ==. Of course. To be more specific, the problem was that chunks would get deleted when they didn't have a meshes - which should only happen when they also don't have any bloxel data anymore.
DONE
- I worked a bit on the internals and bloed can now be used with the URP, and probably HDRP too. The main difference is that for the markers and the cursor I don't use materials in the Resources folder anymore but generate them on the fly. So now they're in all render pipelines visible. I'm mostly waiting for a bug report by G.P. before uploading a new update. Their problem sounds horrible to me. I remember having missing bloxels/faces before, and I truly hoped I fixed it. If I remember correctly, there was inconsistent information with shared bloxels at the border of chunks.
https://itch.io/t/1980162/issue-with-missing-bloxels
SEEN
- A note to myself when I have problems with Rewired: check if the
Map Categories are actually assigned to the Player. That is all.
DONE
- As the resizable nodes in the new connected interface are a bit of a hassle I decided to concentrate on new multi-line text input fields that can't be resized (for now) and instead use a modal input field where you enter the text and then type enter to apply the changes.
- We're part of our office building's showcase, and we will prepare Highfive Romance Race again. But also a new game story based on HaQR, and here I hope we can do it in time - and somewhat tastefully. I wrote down a small story with a safe and ghosts.
DONE
- Team COOLFRIENDS had a meeting and we concluded that while we still want to work on the 666 Coins and make it a proper game, our next goal should be adding some stuff and submit it to the Alakajam Tournament. There we could garner some feedback maybe, and some players. Shortly before the meeting I also finished creating the rat enemies I was working on by just modifying their behaviour a bit - they now have a cooldown when they hurt the player, and after a few seconds they would attack again. They're just so cute!
- I sent a bug report to Unity because of the annoyances I had with TMPro text input fields. This whole ordeal (who knows when those bugs get fixed) made me rethink how I want to have text input in connected. I should change it so that longer texts will open their own window when being edited, just so I don't have the hassle with resizable nodes anymore.
- I did some refactoring for connected, the old IMGUI version mostly, and now it uses short identifiers (three letters, e.g. "cho" for Choice nodes or "swi" for Switch nodes) instead of indices. All this for later use, when I make the whole system more configurable. It's a bit messy, but in the end nobody will care, apart from me.
- Did some first careful tests with bloed and URP. It mostly works, although I had to change the bloxel material manually (not a big deal though). There are lots of errors though when doing automatic lightmapping, as the tool doesn't create secondary UV coordinates every time a bloxel was added or removed. The most annoying problem for now is that all the gizmos are not shown though, probably because they try to create a material for the BIRP instead for the URP.
Also I learned that the automatic unwrapper creates overlapping UVs for my meshes, so I changed the packMargin value to 0.1f - not sure if this is a good value, but it fixes the problem.
https://docs.unity3d.com/2019.3/Documentation/ScriptReference/UnwrapParam.html
SEEN
DONE
- As Patou should be localisable too, I put a tiny bit of work into the localisation stuff from my game jam base code and moved it to its own repository; it's now called "simple localisation helpers" (slh).
https://github.com/ratkingsminion/slh
SEEN
- I talked in the IndieArena Discord a bit about Switch and Unity with Oswald and others, and it seems we will have to look for another solution when it comes to the environment in the game. Apparently Unity's terrain system is a killer for the Switch.
DONE
DONE
- Did a "day without glowing rectangles" yesterday, was great.
- Working more on the UGUI version of connected I can now connect nodes (or rather their respective connectors) again - a small but important step. Now I want to find out if it's feasible to use Small Basic as a configuration method for the various node types, it would make extending the functionality a breeze.
- I think I fixed (or rather: circumvented) the problem with the T-junctions in bloed that would lead to broken geometry with clipped bloxels affected by noise. I tried to identify these cases and just remove them from the noise. Because fixing T-junctions is an extremely hard problem, so this was the saner solution.
https://ratking.itch.io/bloed/devlog/351908/bloed-v08
DONE
- Today is some kind of deadline for Patou's prototype, and apart from some jittering still existing it looks good. At least I don't think the animations are the culprit any more. The worst thing though is that everything will have to be replaced for the final game, from art to code. Work went into more sounds, new nav meshes, some monolog for finding the dog, a ghost scene of memories ... Well, it will make sense later.
In any case I somehow have a really hard time memorising that a higher value of the DefaultExecutionOrder means that it's executed later, not earlier.
DONE
- Lots of small stuff is now done for Patou and more to come, as the deadline for the prototype looms. I think I solved the laggy movement mostly, but when riding there are still problems - but in this case maybe the animation is actually to blame. Sounds were added, a sun, a dialog for the bridge troll, a start screen, and so on.
SEEN
DONE
- (Patou) For the bridge troll's trash heap of toys I wanted to bake some 3D toys into a simple cone-shaped mesh in Blender, or rather its texture. After a lot of experiments it succeeded. The main problem was that Blender doesn't use the GPU for baking in a lot of cases, and so the process was painfully slow most of the time.
DONE
- The look of Patou's prototype level is somewhat done now, at least in my department. It looks pretty, probably because we mostly used assets from elsewhere. Still, building a bigger environment takes a lot of time, it's good being aware of this for the future. What's missing for the submission on Thursday? Let's see - sounds in any case. Particles (mostly wind), and some sun. A big pile of trash, for the troll. Some kind of dialogue between Kit and the troll. Paul's music. Adjusting colours of the sky, the light, the post-effects, the fog. An "end scene" for when you complete the ruin's puzzle. It would also be great if finding the puzzle would be a bit more involved than pressing just a key; and also if I could solve at least some of the animation glitches.
DONE
- (connected) I found out how to use the meshes with UGUI, so I could draw a bezier curve with it already.
- Patou's prototype level is coming along. I placed a lot of trees and rocks, only missing is all the rest. I definitely have to write down all the things that need to be remade once we can start the real production - which is "everything". I plan to have some kind of "director" that would control Patou and the protagonist whenever needed, especially in cut-scenes, and als rework the character controllers.
SEEN
DONE
- While working on Patou I found out today that changing a skybox, or rather its colours, does not update the ambient lighting in the scene in Unity. One has to call
DynamicGI.UpdateEnvironment() whenever the skybox is changed. Which is a very expensive method. To mitigate this, maybe caching the values from RenderSettings.ambientProbe could help.
https://docs.unity3d.com/ScriptReference/RenderSettings-ambientProbe.html
- The UGUI version of connected needs, of course, some splines to connect the nodes to each other. Unfortunately there is no out-of-the-box solution, apparently, for such curves in UGUI. I guess I have to write my own stuff (again). I will base it on this simple polygon tool - apparently UGUI has their own kind of meshes to render them.
https://github.com/CiaccoDavide/Unity-UI-Polygon
DONE
- I did some more tests with UGUI and resizable and draggable nodes for connected, and it works better than expected. I will probably go this road further.
- For Patou I created a more or less "real" puzzle situation in a memory ruin. It's not yet finished, and the size is not good (much too small), but it's a good start that makes me kind of hopeful.
DONE
- After experimenting with UGUI a bit to check out if it actually is usable for connected's nodes system. It is, I think. I will have to create some nodes before I can say for sure though, as there are already quite a few annoyances, related to TextMesh Pro's text input fields mostly. The main difference to the IMGUI version will probably be that nodes won't resize automatically while typing text, but that might even be a good thing. Or maybe I can somehow do it optionally.
- While working on Patou I noticed today that Unity's navigation mesh surfaces don't automatically stitch together when being used with terrains. Quite a bummer, and there doesn't seem to be a real solution for it. So I will probably change to A* Pathfinding Project Pro as soon as possible next month - even though we don't really need this, as Patou is not a procedurally generated game or anything. But limitations like this make me anxious somehow.
https://forum.unity.com/threads/connecting-chunks-of-navmesh.527039/
PLAN
- I felt defeated today, because while connected is now kind of ready to be released, it really isn't. There are just too many little annoyances and bugs and glitches that don't make it a good candidate to be out in the open. So my thinking is to either abandon the project completely, or try to reuse as much as I can while changing the basic node stuff, or rebuild it completely in another framework. For now I want to go with option 2, because rebuilding it will definitely take too much time. (Besides, I never found a good framework that I want to work with.) Option 1 is, well, utter defeat and not really an option, especially as I think the idea of dynamic dialogs with choices as their own nodes is still good and something I don't see often. I just don't know when I have enough time to dedicate.
DONE
- I tried to add some little rats to 666 Coins. It's really fun to see them running around, not attacking the player - until he or she steals the crown. Then they get quite dangerous. There's still a bit to do before they're really usable as enemies.
SEEN
DONE
- (connected) More and more code was removed, so I'm finally at a point where only the needed stuff is left. Which means I can tackle the first obstacle for a real release: remaking the test dialog. Right now it doesn't even support mouse input, and it's needlessly sophisticated for being a good demonstration dialog screen. So I will probably just write something from scratch.
- The player can now move special blocks back and forth in Patou - although that isn't really the end goal. What we really want is the dog being able to use these, so the logic for that has to follow soon enough.
- We upgraded Patou to the latest Unity 2021 version, and it feels a bit strange. Hopefully this feeling won't last too long.
DONE
- Today I tried to manually move a nav mesh agent - Patou - along with a moving platform, still with Unity's Nav Mesh Components. The end result works somehow, but it has a lot of limitations (which is okay) and feels extremely messy (which is less okay). Right now this is only for platforms moving up and down, so we'll see how this works with platforms moving sideways. I will try that next.
DONE
- (connected) I named the
interface I was talking about IBlackboard, to make it clear that it can actually be used for anything the user wants. I could also remove a lot of unnecessary code, although there's still a lot of left.
- I got around adding a better movement for when Kit is riding Patou. It's far from perfect, but it's a start, which was the most important part. But it showed me that I need a better way to organise the movement types and other things, because it gets quite messy.
DONE
- Moritalk, renamed to connected (at least for now), finally uses JSON instead of Lua to save and load dialogs. I also put it on github, in order to be able to change back stupid changes, because those will happen now that I try to eliminate the rest of Behind Stars from the project. The big question is how to replace the Lua functionality from all the dialog nodes like SetVar and so on - I'm thinking of an
IConnectBrain that users have (or can) implement and that would have a lot of methods like void OnVarSetString(string variable, string value) - I guess I'll see if it's too much early enough.
- I added the "new" Navigation Mesh Components by Unity to Patou, and it was a hassle again. Apparently it's still not possible to add their own package to it, although it might be that Unity 2020 is the problem - I will have to upgrade to 2021 anyway because of a fur tool we want to use. In any case, the dog in the game can now be commanded to walk to a pressure platform and activate it that way, which is nice but still wonky of course. And with the upgraded navigation components early experiments make the way for movable platforms that will transport Kit and Patou around.
DONE
- Fixed some visual bugs in Patou after I noticed that I used the
[DefaultExecutionOrder()] attribute wrong - higher numbers mean this script gets executed after the others. Oops.
- It's a slow process, but as my next task for Moritalk I want to switch the saving and loading of dialogs from Lua to JSON. To not break everything at once, I want to support both until I don't have to anymore.
- I uploaded my simple state-machine code (ssm) to github, and the same with the simple utility-theory based "AI" system (sus). Honestly, I don't know if they're actually good, but working with those made it quicker for me to create more complex systems.
https://github.com/ratkingsminion/ssm
https://github.com/ratkingsminion/sus
SEEN
DONE
- Together with Teresa from Würfelpech e.V. we created a QR-code-based espionage thriller where the player uses their phone to search through a room. Basically it's an escape room, but with less props. HaQR is our entry for the Global Game Jam 2022. Again I used Small Basic for the scripting side, as functionally the game is just another CYOA.
https://ratking.itch.io/haqr
- We finally have the girl and the dog imported into Patou. It looks quite wrong for now - there are errors in the mesh mesh, cloth, animation, etc. - but still, this is a very important step.
SEEN
DONE
- Working on Patou a bit more, and we semi-decided on a puzzle mechanic, which is not the craziest ever done, but at least it's doable and could result in a few fun level situations. Also it's very reusable but still allows experimentation. Furthermore we decided which part we want to make for the prototype, and my current task is to look if I can salvage Behind Star's dialog editor - but so far I mostly stumbled over a bug that I just don't know how to fix ...
DONE
- (bloed) Today I learned that, in a
MonoBehaviour with the ExecuteInEditMode attribute, its OnDestroy() method gets called when just changing the currently edited prefab. Annoyingly, OnDestroy() is the place where I clean up any leftover BloxelLevel meshes. The solution now is to also check if the Delete or the SoftDelete command was called. No idea why it's SoftDelete, but well.
- More bug fixes for bloed, all of them somehow related to prefabs. There were problems unpacking nested
BloxelLevel prefabs, and problems deleting and duplicating BloxelLevels inside prefabs. Those problems should be fixed mostly now, but I am sure I missed something.
SEEN
DONE
- While the riding functionality in Patou isn't really done, the switch from normal player controller and nav mesh agent to a singular rider/mount controller kind of works now. The same with the player leaving their "horse". It's a start, at least.
DONE
- I got a bug report for bloed, claiming that their computer gets warm with bloed active, even in an empty scene. I indeed tested that and noticed that the CPU usage gets pretty high. Seems like calling
SceneView.RepaintAll() every frame is not a good idea. For now I just commented this out, but of course this means there are now problems with rendering/updating some of the editor markers. I will have to look more into this.
DONE
- I updated 666 Coins a bit, now enemies (for now: the walker enemy) hear objects the player throws. The walker just looks into the direction of the objects, but that can already be advantageous. This needs testing though, because it might have some bad effects that I didn't think of. In any case I also fixed a few bugs while working on this.
DONE
- I had to re-think my approach on how to implement riding in Patou. I thought just switching the models around would suffice, but that was very naive of course. Thus I added an additional controller named Rider, and this is what then will use the combination of the kid model and the dog model. In the end I will probably have to create separate models (with animations) too, but for now I'm going to try it like this.
PLAN
- We might participate in this year's Global Game Jam, and I'm a bit excited - this time I want to do a mix of digital and analog game design. I'm mostly inspired by a Lord of the Rings board game which has a companion app that gives out randomly generated side quests. Maybe there are even more interesting things that could be done with this.
SEEN
PLAN
- I need (or rather: want) to have another look at LibTessDotNet, as there have been some updates since I last did that. Currently I use an older version in bloed, and while it is good at creating polygons out of outlines, some of the generated triangles are invalid (i.e. have an area of zero). So I have to combine it with poly2tri, and my current hope is that I can ditch the latter when updating LibTessDotNet. ClipperLib will stay, as it is needed for the Boolean operation of creating the actual difference between two bloxel sides.
It would be interesting if I could/should make the whole bloxel chunk generation more dynamic and robust by calling ClipperLib and LibTessDotNet on the fly. It definitely would create a lot of garbage and make performance a lot worse, is my guess.
https://github.com/speps/LibTessDotNet
https://github.com/greenm01/poly2tri
https://github.com/Voxel8/ClipperLibCs