I'm back, babeh!

I'm back, babeh!

I went through a bit of a period of searching for myself. It happens now and then, usually brought on by depression. That feeling that nothing I will do really matters and a need to find a way to make something that will change the world for the better. It gets really cloudy and I start chasing my tail trying to figure out what I should be doing.

First off I may drop Golang in favor of just going straight to Rust. I will probably finish the course I have on Go just to have it done and not have wasted the money. Ten bucks is a week's worth of dinners, man. I think Rust will be more suited to all the stuff I would want to do with both it and Go, it also has all the features I like from Go (Chiefly that concurrency model and the built in testing).

Anyway, I will be continuing work on the Philosopher prototype. I hope to have the prototype released by the end of next week and be on to the next one.

First off, I locked the sprite rotation of the pets in a simpler way than I did the Enemies. I wont be changing the way it works on the enemies because I want to get the feeding system in today and hopefully at least one more pet. Besides, it ain't broke, don't fix it. This is just a prototype with a focus on learning the engine and the fact that I solved the problem of sprite rotation more elegantly for the pet says I am certainly learning. It'll be a point of comparison.

On to the feeding system, press the button, open a UI, select an item, UI closes and pet eats item. Simple enough, I think. How hard could it be? Cut to 3 hours later when I am dousing myself in gasoline sitting in the road trying to get a match to strike.

No more disappearing by turning.

To the UI!

Slapdash work, if I do say so myself =D

Let's get some lunch cooking (Woke up late, having a hard time sleeping lately.) and start on the UI, which as far as I am concerned should just be some buttons with pictures and a number in the corner displaying how much of the item the player has in their inventory. I should really make some icons for this stuff but you know... I bought some assets on Itch.io (like my sprite base) and I would like to use them. Should be some suitable sprites in the mass of pixels I have acquired. (Love them sales and bundles, never know what you might find.)

I could use all that time I spent training my pixel art skills but I will be doing that for the pets, armors and weapons... so in the interest of saving time it is time to raid the itch folder!

That was quick, Cheers to Finalbossblues! I got quite a selection here to work with and make this go quicker.

Now to make the buttons. Also gotta change inventory code a bit to show images as well. Nothing a switch statement can't handle. Just have to rename the icons I choose to the same as the item name (so I can keep it DRY, yes?) and get some references to the buggers.

Got that all done and ready to go. Next I will eat, then make the feeding UI and system. I almost started to rewrite the inventory to use the icons but remembered I am trying to get all the systems in, then if I have time I will polish it up. Lunch.

Named and ready to go.

And now the feedening can be done.

Feeding UI

Feeding a pet an item of the same element increases element exp (In this case Sapphire = Water = Karakasa) and enough exp increases the tier. Different items have different stat exp, like Rubys will give 1 def exp and sapphires give 1 atk.

The feeding is actually quite simple.

    public void SetPet(Pet pet)
    {
        currentPet = pet;
        SetupFeedItems();
    }

    void SetupFeedItems()
    {
        // Set the amounts on the buttons to match the inventory.
        //A loop is easier here.
        foreach (KeyValuePair<string, int> kvp in inventory.playerInventory)
        {
            ChangeFoodItemAmt(kvp.Key);
        }
    }

    void ChangeFoodItemAmt(string item)
    {
        gameObject.transform.Find(item).Find("Amount").GetComponent<Text>().text = inventory.playerInventory[item].ToString();
    }

    public void FeedItemToPet(string foodItem)
    {
        if (inventory.playerInventory.ContainsKey(foodItem) && inventory.playerInventory[foodItem] > 0)
        {
            //Lookup item in DB, feed to pet, remove from inventory.
            Item item = inventory.itemDB.ItemLookup(foodItem);
            inventory.UseItem(foodItem, 1);
            currentPet.FeedPet(item);
            ChangeFoodItemAmt(foodItem);
        }
    }

The pet UI passes the Feeding UI the Pet when you click Feed, then the UI sets itself up with information from the inventory. Setting up buttons with the correct amount text. Then the buttons in the UI all call FeedItemToPet with a string of the Item's name. We check if the player has the item, then we look it up in the item DB and pass it to the pet, reduce the amount in the inventory then update the UI.

The pet consumes the item and performs a few checks to decide what the item will do for the pet's stats based on what's in the ItemDB.

That went easier than expected. On to adding another pet I think?

Fire.

For swapping armor I was going to use Sprite Library and Sprite Resolver. But it was not to be, I am unlikely to trust anything marked "Experimental" in Unity, given my past with it. So I will have to create all the animations and animators for each armor. While I could have paperdolled it on I would still have the same problem as far as I can tell. If anyone has any better solutions I would be happy to hear 'em but for now this is how I will be doing it.

I might spend some time after dinner working on getting the armor and weapon added in. I might not. Probably will, though.

Got them animations... sort of made.

12 animations just for this simple controller. To think I almost had 8 directions of movement animation.
It's more Reddish. Look at the DBG32 pallette and you will see why I did this.
As compared to Karakasa Armor.

Still need a weapon in all 4 directions, probably do that and a couple more pets on monday. I want at least enough pets for all the items I added to the ItemDB.

Anyway, it's 8pm now so I am checking out mentally and should probably rest.

Cheers.