Day 3-4: I’m Good

Made salads, cooked meats, made an omelet, loafed another loaf (with cocoa powder and some sweetener) and I’m feeling pretty good. If a bit tired.


Posted in Life, Me by with no comments yet.

My Keto Almond Bread Recipe

Speaking of bread, here’s what I use. Disclosure: This is the original I used.

These amounts are 150% of original capacity because it fits me better.

Values

Taste: Addicting, considering.

Serving: 1 Loaf; Calories: 123kcal; Carbohydrates: 5g; Protein: 4g; Fat: 10g; Fiber: 3g; Net Carbs: 2g;

Work time: 15-20 minutes

Prep

  1. Cup, ½ cup, ⅛ cup, ½ tbsp, ½ tsp
  2. Big bowl, fork

Ingredients

  • 3 cup Almond Flour
  • ⅜ cup Psyllium husk powder
  • ⅜ cup coconut shavings
  • 1½ tbsp baking powder
  • ½ tsp salt
  • 6 large Eggs (beaten)
  • ⅜ cup Coconut oil (measured solid, then melted)
  • 1½ cup Warm water

Directions

  1. Mix all the dry ingredients in a large bowl
  2. Start oven on 180 degrees
  3. Add the eggs and melted coconut oil and mix them in
  4. Then add the warm water and mix well to avoid air bubbles
  5. Pour the batter into the bread mold
  6. Bake for 55 minutes (a toothpick should come out clean and the top should be hard).
  7. Let it cool completely (about 10-15 minutes).

Posted in Mixing by with no comments yet.

Day 2: I’m Bad

I had a piece of cake and an ice cream cone. I’m slightly ashamed of myself. But only slightly. It was Happy Thursday at work. They just bring in a lot of good food to eat together. I couldn’t help it!

But I skipped dinner. Back to salads and meat for the weekend. I also need to make more bread.


Posted in Life, Me by with no comments yet.

Day 1: Somewhat Struggling

First day of trying to go hardcore low-carb again.

Maayan offered me a very good looking pasta yesterday. I took a couple of tomatoes. I made chicken salad for dinner and decided that I’m going to stick to a little meat and mostly vegetables in every meal. At work I mostly nosh peanuts and fruit.

I need to put more olive oil in my salads too.


Posted in Life, Me by with no comments yet.

Hasbro Bought D&D Beyond – Thoughts

I saw this video in my feed and if you’re into D&D and especially DDB, you should check this out.

And here are my thoughts, archived for my convenience.

1. Right now, Foundry is the benchmark, king-of-the-hill of VTTs. Nothing comes close. Not Roll20, not FG, and not what DDB has to offer. And at current rate of development, with both Roll20 and DDB working with small teams and Foundry having a small base team but a ton of community developers, I don’t see anyone able to catch up to that. I’m currently at a point that I truly treat DDB as a convenient, digital, online source… to get my D&D material and that’s it. Pretty much everything else I do on Foundry, and with no added subscriptions. I buy the software, I buy the materials, my players just log in. It’s, as if we have one set of books that everyone share at a single table. The D&D 5E version on Foundry even recently added a better level-up mechanism so I only need to download the content (possible through an amazing community developer) to Foundry and that’s it. Unless WotC decide no one is allowed to use D&D in online tools (which will probably be against their SRD and start a huge outcry) it’s not gonna change.

2. With Demiplane on the field, soon Pathfinder, Vampire, even Marvel’s new game will have the same capabilities as D&D in the online space.

3. In the video game space, a lot of companies get bought because the buyer see the value in them. They see that if they give them more resource and more runway, they can do many great things (that will net more profit in the long run). Those almost never see significant changes in how they run.

4. I see where you’re coming from with the VTT concentration and while other VTTs will doubtless always exist, the monolith is scary. The solace is that while a lot of players just play one system, there’s a significant minority who play many games. So, when one player complains that D&D doesn’t allow X or isn’t clear on Y, someone will surely pop up with “Well, system Z does that” and then the discovery begins. And like you say, the fact that third party products will always exist, if DDB won’t allow them “because they’re only core”, people will shift over.


Posted in Gaming, Role-Playing, Thinking Out Loud by with no comments yet.

Audiobook Narration and AI

Like everything related to AI, with the ability to mimic human-sounding voices coming to the forefront, audiobook narrators now also feel threatened and, while I understand being afraid of something new and misunderstood, I see it mostly as an extension of our existing abilities and doing more with less.

First of all, I’m sad that the first thing I see in that article is “circling the wagons”. You can’t avoid new technology. It’ll come no matter what. Some form of legislation can be made to restrict research and development but if the technology is not immediately or excessively harmful (like nuclear weapons or engineered viruses), a lot of people will work towards it and, as a person affected, what you really should do is find how to adapt and where you fit in in the new order.

Secondly, if we move towards an industry in which voices are largely AI generated, the voice templates will still have to come from somewhere. Those providing the templates will still be a part of the process. They will be licensing their vocal likeness, like you do with a visual likeness. It will be up to them and their agents to make sure the contract benefits them and that they may have some right of refusal on projects that might not align with their views. And those around the narration will still be required. A director will need to make sure the reading is what the client wants, an audio editor will be needed to make sure it flows or to add effects or music, etcetera, etcetera.

I see it a lot like using any other asset in game creation, both in video games and tabletop games in which I have some experience. As a creator trying to save money, I would definitely go to the asset store or find some stock art to put in my product. Both in tabletop publishing as well as on Steam, I’ve seen many products reusing art and, yes, it paints the product in a specific kind of light but I can’t really fault someone for being short on means. Of course, were it to be possible, I would love to commission bespoke art for my product to make it unique and special, the nuances and the input I can have on it would make it better in every way but not everyone can afford it.

The way I see it working is that narrators would license their voice phonemes to the voice generation technology company. Narrators would recieve a flat fee up front for participating. A book publisher who can’t afford to arrange for a bespoke reading would contract the voice generation company. The AI voice should cost less than hiring a narrator in person but said narrator should get a cut of the contract and because the voice would be used in bulk, it would become a larger sum over time. Because the reading is AI generated, the audiobook will be worth less and be sold for less than one made with a bespoke narrator. The end-of-the-line customer would be made to understand that an audiobook voice is AI generated rather than specifically narrated, and it will be up to them whether they are willing to accept it, like buying a soft cover over a hard cover.

In the end, I think that just like ‘zero budget’, one-person productions on YouTube can exist next to hundred million dollar Holywood productions, so can fully voiced audio productions can exist next to AI generated synthetic audiobooks.


Posted in Practice, Thinking Out Loud by with no comments yet.

My Problem With Cryptocurrency: There’s No Room for 1

This is one of my main guidelines when designing mechanics for a game: Whatever underlying system you have, there should be some meaning to the lowest number. It doesn’t mean that you should be able to see a ‘1’ in text, in front of you, during the game, but there should be a meaning to that increment/decrement. Because, going from a 1 to a 2 might be too drastic a change in your system as that’s a 100% difference. But there should be a 3 and 4, or even just 99 and a 100. Because, if there isn’t, you’re probably just inflating numbers to make it look better and haven’t examined your systems deeply enough. And so, while I hate the way Souls-like games do it, the fact that E is lowest rank and the highest is A or S, or that the best upgrade you can get is a +10, makes every little uptick meaningful.

It started to bug me when I played Warcraft III originally. In I & II, characters had double digit HP, some big or hero characters had triple digits. But the upgrades you could make, for weapons or armor for example, were 12 to 13 or something like that. That was a meaningful upgrade. If your knights did 1 more damage per hit, they could take down an enemy in 3 strikes instead of 4 and that really upped your attack group’s survivability as well. Then, in Warcraft III, everyone started having HP in the tens and hundreds of thousands, everyone was hitting for thousands of damage. And for what? It worked basically the same except there were higher numbers. In Starcraft, if you could let that SCV repair a fraction of a second more or let that Zealot’s shield recharge a fraction of a second more, you got a few more hull or shield points and that was important.

I think it’s also the reason why I tend to get bored quickly and stay away from idle games: at the start you have to click ferociously to get one more point but then you upgrade a bit and the numbers grow so big you can’t even refer to them as real numbers anymore. The journey from 1 to 100 is massive. Even from 1,000 to 10,000 is meaningful. But when you’re at 420E39 and you want to get to 69E40, it doesn’t feel like much of a difference.

What does it have to do with Cryptocurrency? The detachment from any real-world value of currency.

The point of any currency is to replace the bartering system with something that we can all agree conveys value in an equal system. Which is also why I prefer the Big Mac Index to anything else when comparing the economy of two countries. If I toss you an exchange rate, it won’t really stick in your mind whether it uses Shekels, Pounds, Francs, Yen, or Rubels. But if you know a Big Mac costs you ~4 USD and I tell you it costs me slightly under 20 NIS, you’ve got a better comparison of what things cost in Israel and how strong the dollar is compared to the Shekel.

But what can you buy with one BTC or one ETH? I don’t know. And if you knew yesterday, you’re probably wrong today. You might be able to buy a Big Mac in New Mexico for 0.005 BTC (I don’t really know how much it is) one day but it’ll cost you 0.007 in Istanbul the next day. Because it fluctuates so much, because it has gone so far, it lost 1 in the mirror a long time ago. Because Cryptocurrency is no longer real currency (if it ever was to begin with), it’s a speculative financial product at its best and Pyramid Scam/Pipe Dream at its worst.

And then, you need to factor in “Gas” prices.

When you make a cryptocurrency transaction, it’s not just cash money changing hands. One computer (and usually a computer farm) needs to accept this transaction (and there’s usually a small bidding war for it), then use its power, its electricity cost, its runtime, its pollution, its wear and tear, to process the transaction, write it, and propagate it. And the people who do it want to be compensated for their role in it. At time of writing, this price was fluctuating between 2-5$ depending on where you were checking on which currency. I couldn’t find confirmation but I remember that at one time it was 200$. Meaning, that is the added cost for each time you want to transfer cryptocurrency. So, if you want to make a 1$ transaction, you’re actually paying 6 times as much for the privilege, another few dollars just gone. Then, why would you make a transaction lower than, say, a hundred dollars, where the gas price is worth the amount your sending?

Which is exactly where we lose the meaning of 1 and where we get away from something that is usable by everyone. If you can’t buy a loaf of bread or a dozen eggs with it, it’s not usable by everyone. It’s not currency anymore, it’s detached from real world value, it’s a speculative tool for the rich and/or stupid. And since it’s not tangible, not even an abstract representation of value (like a stock that gives you partial ownership of something), it’s useless in the real world.

And NFTs are built on the same concept, just one level more abstract (and ridiculous). While there are established places where you can convert your cryptocurrency into real money and vice versa (and the transaction is probably always in the changer’s favor), for an NFT to be valuable, you have to convince someone else to pay you for it. And since it’s a just a reciept that points to a URL online that you can access freely anyway, what does it really matter that you “own” it? That is why you get stories like these of people selling themselves their own NFTs to drive up the prices. By the way, It’s called a “wash trading scam”, and it was very prevalent in stock trading until it was outlawed.

That’s it. Rant over. But if you want to know more, I highly recommend this video by Folding Ideas. It is long (over 2 hours) but he goes in very deep on Cryptocurrency and NFTs and it’s the best explanation of the whole thing that I’ve seen so far.

Over here is a shorter video (only 30 minutes) by Christopher Natsuume that explains my all of this is bad for the gaming sphere and why any game that builds NFTs into its scheme is just going to be a bad game that hurts its players.

And I want to add another thing after the rant on NFTs in video games: No company in their right mind will want to allow you to take something they made, their intellectual property, and do with it what you want in another company’s game without benefitting from it. So, if they want to keep it in-house, they have their own servers, their own code, they don’t need NFTs. We’ve seen it done before. And if two companies would like to participate in a scheme like this for a specific reason… something like, I don’t know… cross-promotion, then that is also something that is already being done (Fall Guys and Shovel Knight are the biggest examples that come to mind) and doesn’t need NFTs.


Posted in Life by with no comments yet.

Useful C# Features (or “Cool Things You Didn’t Know You Could Use in Unity”)

1. Tuples & Discards!

Tuples is something more dynamic languages like JavaScript have been holding over the more static languages for a while. It allows you to do more with less action (higher level ones, that is). While tuples have existed in C# before as a class of their own, they are now getting a proper implementation. It basically makes a complex variable/object without having to predefine it using a class or a struct.

var alphabetStart = (Alpha: "a", Beta: "b");
Console.WriteLine($"{alphabetStart.Alpha}, {alphabetStart.Beta}");

You can even use it to return more than one element from a method(!!!). Unfortunately, the Unity editor doesn’t support handling those kinds of returns yet but they are still useful inside your scripts.

Discards are those underscores you see in the example below. It allows you to deconstruct a tuple and discard the data you don’t want, only keeping what you actually need in its own named variable.

using System;

public class Example
{
    public string NewYorkCityName
    {
        get
        {
            var (_, name, _) = QueryCityData("New York City");
            return name;
        }
    }

    private static (string name, int pop, double size) QueryCityData(string name)
    {
        if (name == "New York City")
        { return (name, 8175133, 468.48); }

        return ("", 0, 0);
    }
}

2. Pattern Matching!

Pattern matching allows you to test a runtime type in an if or switch statement and then convert it to that specific type all in a single statement!

if (input is int count)
{ sum += count; }

It also increases the power of switch, allowing you to do a lot more with less and create much more complex testing blocks.

public static int SumPositiveNumbers(IEnumerable<object> sequence)
{
    int sum = 0;
    foreach (var i in sequence)
    {
        switch (i)
        {
            case 0: break;
            case IEnumerable<int> childSequence:
            {
                foreach(var item in childSequence)
                { sum += (item > 0) ? item : 0; }
                break;
            }
            case int n when n > 0: sum += n; break;
            case null: throw new NullReferenceException("Null found in sequence");
            default: throw new InvalidOperationException("Unrecognized type");
        }
    }
    return sum;
}

3. Local functions

Local functions is currently one of my favorite features in C#. You could already create functions inside functions by assigning a block into an Action or Func variable but now you can just define an anonymous function and not worry about what returns or not returns a value or where exactly you defined which variable. So, if you need a complex block or calling the same function multiple times but you don’t want it available outside, Local Functions are here for you.

private static string GetText(string path, string filename)
{
     string AppendPathSeparator(string filepath)
     { return filepath.EndsWith(@"\") ? filepath : filepath + @"\"; }

     var reader = File.OpenText($"{AppendPathSeparator(path)}{filename}");
     var text = reader.ReadToEnd();
     return text;
}

4. Switch Expressions!

You can now rephrase your Switch blocks into something much nicer and readable.

public static RGBColor FromRainbow(Rainbow colorBand) =>
    colorBand switch
    {
        Rainbow.Red    => new RGBColor(0xFF, 0x00, 0x00),
        Rainbow.Orange => new RGBColor(0xFF, 0x7F, 0x00),
        Rainbow.Yellow => new RGBColor(0xFF, 0xFF, 0x00),
        Rainbow.Green  => new RGBColor(0x00, 0xFF, 0x00),
        Rainbow.Blue   => new RGBColor(0x00, 0x00, 0xFF),
        Rainbow.Indigo => new RGBColor(0x4B, 0x00, 0x82),
        Rainbow.Violet => new RGBColor(0x94, 0x00, 0xD3),
        _              => throw new ArgumentException(message: "invalid enum value", paramName: nameof(colorBand)),
    };

5. Property Patterns

This is another wonderful extension to the switch statement allowing you to switch on a structure and get output depending on its internal properties rather easily.

public static decimal ComputeSalesTax(Address location, decimal salePrice) =>
    location switch
    {
        { State: "WA" } => salePrice * 0.06M,
        { State: "MN" } => salePrice * 0.075M,
        { State: "MI" } => salePrice * 0.05M,
        // other cases removed for brevity...
        _ => 0M
    };

6. Tuple Patterns

This is another cool extension to the switch statement, allowing you to match a case based on individual items inside a tuple breakdown.

public static string RockPaperScissors(string first, string second)
    => (first, second) switch
    {
        ("rock", "paper") => "rock is covered by paper. Paper wins.",
        ("rock", "scissors") => "rock breaks scissors. Rock wins.",
        ("paper", "rock") => "paper covers rock. Paper wins.",
        ("paper", "scissors") => "paper is cut by scissors. Scissors wins.",
        ("scissors", "rock") => "scissors is broken by rock. Rock wins.",
        ("scissors", "paper") => "scissors cuts paper. Scissors wins.",
        (_, _) => "tie"
    };

7. Using Declarations

One of the really nice things in C# over C and C++ is that it is a managed language. Yes, there are performance differences (which Unity has almost 100% taken care of) but it is a huge load of responsibility off the developer. The Using declaration is a great way to take advantage of it. When you need to open a file or create a web request but just for a short time and you want to dispose of it properly… you can go through the whole rigmarole or just enclose the code in a Using block that takes care of everything for you.

static int WriteLinesToFile(IEnumerable<string> lines)
{
    using (var file = new System.IO.StreamWriter("WriteLines2.txt"))
    {
        int skippedLines = 0;
        foreach (string line in lines)
        {
            if (!line.Contains("Second"))
            { file.WriteLine(line); }
            else
            { skippedLines++; }
        }
        return skippedLines;
    } // file is disposed here
}

8. Indices and Ranges

First of all, you can now define a range in C#.

Range phrase = 1..4;

And you can use those numbers or that Range to access a sub-range or a sub-group of another variable. However, be careful because range accessors are beginning inclusive and ending exclusive.

var words = new string[] { "The", "quick", "brown", "fox", "jumped", "over", "the", "lazy", "dog" };

var quickBrownFox = words[1..4]; // "quick", "brown", "fox" and no "jumped"

var lazyDog = words[^2..^0];
 // The from-end index accessor. ^0 is the end and not included
var allWords = words[..]; // contains "The" through "dog".
var firstPhrase = words[..4]; // contains "The" through "fox"
var lastPhrase = words[6..]; // contains "the", "lazy" and "dog"
var text = words[phrase]; // is like quickBrownFox

9. Null Coalescing Assignment

The Null Coalescing Operators are some of my favorite features in new C#. It allows you to check for Nullls and then do things accordingly. The null-coalescing assignment operator checks if the left side is null. If it isn’t, it’s returned. If it is, the right side is assigned to it and then it’s returned. It’s a great way to do lazy resource assignment and/or creation. 

List<int> numbers = null;
int? i = null;

numbers ??= new List<int>();
numbers.Add(i ??= 17);
numbers.Add(i ??= 20);

Console.WriteLine(string.Join(" ", numbers));  // output: 17 17
Console.WriteLine(i);  // output: 17

Posted in IT, Life, Programming by with no comments yet.

News: Average User has no Concept of How Much Game Dev Costs

Recently, some clueless joe on Twitter said he will pay 10,000$ to the person who adds a multiplayer aspect to Zelda: Breath of the Wild. If he was going to donate to a modder who was working on it, that would have been fine but it seems like he was thinking that he could hire someone to do something like that for that kind of money.

Here is a long, detailed response to this which you should read but here’s the summary: 10,000$ would pay for about two work months of the average+ programmer. Also, networking is hard. The hardest networking challenges in gaming usually arise in fighting games because they usually need to be exactly per pixel and per frame accurate and, probably over distances where network traffic takes more time to go back and forth than it takes pro players twitch reflexes to react. You can see how important this is if you go back and read about the network woes of Street Fighter V.

Now, the demands of a PvE, open world, action RPG would probably be a lot less strict but these are still difficult problems. Especially if you’re talking about tacking on something like this onto a game that was definitely not designed for it.

You want a more current example? On the one hand, Battlefield 2042 is out now and it’s buggy as hell. On the other hand, Halo Infinite’s multiplayer is also out and it’s much better. Probably because the team is backed and overseen by a very strict corporate overland. On the other other hand, Halo’s campaign will come out in a week but the Co-Op campaign will only come out in May 2022. MAY!!!

343 Industries have been working on the Halo games for over 10 years! They are backed by one of the biggest corporations in the world! [According to Wikipedia] They are 750 strong! And it’ll take them — yes, assuming they have more going on than just Halo Co-Op — five months from campaign release to co-op campaign release.

And some people think you can just add co-op mode on a massive game for 10,000$.


Posted in Gaming, Less Interesting News, Practice, Programming, Thinking Out Loud by with no comments yet.

Portugal just became nicer to employees

Portugal recently passed a law they fondly call “Right to Rest”.

It contains various measures to help employees have a better work-life balance such as the ability to work remotely when you need to take care of a child or companies contributing to household bills when an employee is working remotely a lot. But the nicest thing about it is indeed the ban on contacting employees after work hours. I’m guessing there is a stipulation about emergencies or people like server administrators and doctors who are supposed to be on call but the fact it’s enshrined in law is just amazing.

Kinda makes me want to move to Portugal. :)


Posted in High-Tech, IT, Less Interesting News, Practice, Thinking Out Loud by with no comments yet.