Dev Blog

Hi, this is the Stranded III development blog (see also Forum Thread, Comment Thread).

Overview (115 Entries)

Entry 58 - Seamless, Pooling & Crafting - October 2, 2016

Okay, I found out what caused the seams in my models. I wrote that script which fixes the rotation of the Blender FBX imports. That rotation fix apparently screwed up the normals. I even wrote a blog post about that script but I forgot about it. dragonking92 posted a useful link to a way more sophisticated importer script which helped me to fix my importer and the seam problem! Thanks a lot!

Sprite Pooling
Pooling is a nice thing to do if you want to reduce garbage and save some time on instantiating. It's pretty easy in Unity: Instead of destroying no longer used game objects, you simply disable them. Then, if you need new ones, you just enable your existing ones instead of instantiating new ones.
I added this to the sprite system in Stranded III but forgot about one very important thing: There are commands in my Lua API to add colliders and rigidbodys to sprites. Of course these stay there when reusing the sprites unless you disable/remove them in the pooling system... which I didn't do.
The results of this mistake look quite hilarious so I made a short video (the little sparks are the sprites which have a rigidbody and physics. They cause the trouble):
> Watch "Pooling Gone Wrong" on YouTube
Luckily this was trivial to fix


> click to enlarge

Inventory And Crafting Menu
My plan was to use the same inventory menu for all item related actions like I did in Stranded I and II. Stranded III is more complex though because you will have a character which can be equipped with clothes etc.
Therefore I decided to have two separate menus: Inventory and crafting. This gives me more space in the interface and allows me to simplify controls.
The inventory will be used to equip and use/eat/throw away items and the the crafting menu will be used to combine items to new ones.

Here's a preview of the new crafting menu:

> click to enlarge

You can select multiple items by simply left-clicking them. Right-clicking deselects all items. Clicking an already selected item also deselects it. The list on the right shows all possible crafting combinations with the selected items. Your crafting skills / perks will have an influence on what you see.
• If you have low crafting skills you'll have to select exactly the right items to see combinations
• If your skills are higher, you will see combinations even if some items are missing or if wrong ones are selected. Only to a certain extent of course.
• Already known combinations will also be displayed in some way... (not implemented yet)

To make the combination win work I extended the listbox component of my Lua scripted GUI. It now allows to pass in custom rendering functions for listbox items. This makes it possible to display complex combination details in the listbox.

The inventory menu has been changed to use tabs instead of a combobox for the different item categories. This reduces the required click count to change the category from 2 to 1! Usability! Hooray!
> Inventory tabs in action


blog comments powered by Disqus