Englisch Stranded III Dev. Blog

84 Antworten
Gehe zu Seite
Zum Anfang Vorherige 1 2 3 4 5 Nächste Zum Anfang
04.11.18 18:52:45
Offline Off
I made a tortoise model!
> Watch Tortoise modelling @ YouTube

There's also a (work in progress) texture already:

Stranded I had a turtle (water), Stranded II a tortoise (land). The plan is to have BOTH in Stranded III! INSANITY!

While searching for animals living in tropical rainforests I came across the Toucan. So I made one for the game.

Actually the list I found contains a lot of nice animals and I'll certainly add some more of those.
I mean.. a poison dart frog?! Imagine catching frogs in order to make poison darts! Awesome!

Even More UI Stuff
I re-created a lot more required missing UI components:

Sliders can be used for settings with small value ranges...

...but also for settings with quite high ranges:

Note that the amount of these little vertical bars adjusts automatically depending on the value range but the maximum is capped at 10 (even amount) / 11 (odd amount). Otherwise I would have to display 101 (0-100) of them in the slider above. That wouldn't be very helpful and it would also look stupid.

Useful when you need to see all possible options at once (yup, the image below is a horrible example!)

Moreover there are now context menus and tooltips!
The combobox mentioned above uses the context menu system internally. In fact it's a simple button which opens a context menu on click and when you press any button in that context menu, the button caption/value is changed to match the clicked entry.
Context menus also support scrolling (in case there are too many entries to fit the screen) and sub menus.
Sub menus are context menu entries with a little arrow which open an additional context menu with new entries when you point at them. Context menus can be nested indefinitely in theory. A sub menu could contain another sub menu and so on. Might be useful for the map editor. Maybe. I don't know yet.

(Reminder in case you read all blog entries carefully: Yes, all that fancy UI stuff existed already. It was completely implemented in Lua with a custom Unity 2D system. Now it's using C# and Unity UI!)
3× editiert, zuletzt 04.11.18 19:12:19
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
09.12.18 22:27:13
Offline Off
Health, Hunger, Thirst
I tried many different things to display values like health, hunger and thirst.
Circles, crazy shapes, vertical bars, horizontal bars, numbers...

What did I end up with?
Boring standard bars:

Why so?
There are three reasons:
1. Style: I simply didn't like the look of the other options
2. Consistency: It was like that in Stranded I and II
3. Simplicity: Nearly everybody who ever played a game knows the concept of a health bar. Also probably everybody using a PC knows the concept of a progress bar. So I hope that most people understand quickly how that stuff works.

Boring, right? But hey, it's not thaaaat bad! The bars have a fancy icon and an animated glow effect (fun fact: I use a lot of that glow stuff in my game Carnage Contest - an amazing Worms clone! Check it out!)! So they are still better than the ones in Stranded I and II
The icons are just the first iteration by the way. I may decide to change them later.

Sleeping Issues
Experienced Stranded players may now ask: Health, hunger and thirst. Cool, I know that stuff. But what about fatigue aka tiredness?
Well... I'm really sorry to tell you that but it's gone. Again there are multiple reasons:

1. The concept of sleeping (and not being able to do anything for a long period of time) doesn't work well in multiplayer mode
2. Fatigue did not add much value to the game. It limited you a bit in what you can do per day (as there was no efficient way to get rid of tiredness except for sleeping) but in most cases you just slept every night and you were fine.

Sleeping itself won't be removed completely though.

In singleplayer you can still do it to skip the dark night hours.
Depending on the spot you sleep at (house, fire place...) sleeping can also give you some positive or negative effects (e.g. affect health a bit).
If you decide NOT to sleep for a longer time you will suffer from some negative effects like decreased speed and effectiveness.

In multiplayer you won't have to sleep at all and the person hosting the game will even be able to adjust the day/night cycle with a simple setting so people don't have to play in darkness for long or at all (this really only affects the sun light. It does not make the time go faster or anything).
Maybe I will still allow sleeping though. If I do so you will probably be able to rest for a short time. The game will go on normally during that time and you are vulnerable to attacks and theft but you would also get something in return. That might be some health points or a temporary boost on some values/skills.

More bars
Additionally there can be two bars which will only be displayed when they aren't full: Oxygen and stamina.

Oxygen will be displayed when you're diving. That was also part of Stranded II but the bar popped up in the middle of the screen there. It automatically refills when you can breath again. Another fun fact: It wasn't possible to dive at all in Stranded I! Even the ocean was just shallow water you could wade through. An invisible force pushed you back when you walked too far. Crazy stuff!

Stamina is for running. Yes, you will finally be able to run! Only for a short time and it will be more expensive than going the normal speed (hunger and thirst will be depleted faster) but it might save your life in some situations. Stamina automatically regenerates when you stop running.
I didn't make a final decision about this yet but maybe Stamina will also affect some other actions and/or blocking/fighting. This might be too annoying though. I still have to test and balance this.


Stamina and oxygen could be affected by skills/perks and of course also by consumable items or the equipment your character is wearing. I didn't add items for that yet but it would be cool to have something like that in the game.

Palm Trees
I love palm trees. I think they are beautiful and they remind me of warm temperatures and vacation because you don't see them in nature where I live (in Hamburg, Germany). The problem is that there are sooo many variants! Whenever I see a palm tree assets somewhere (e.g. in other games) I take a closer look and when I like them I decide to make something similar for Stranded III.
This is why I just made another version of the palm tree. Basically new hand-painted palm fronds. the trunk is the same as before.

For comparison: This is one of the other versions I made earlier

What about iterative development?
Some people might remember that beginning of this year I planned to switch to a more iterative development approach (entry 76). I didn't want to only keep adding random models to a totally unfinished game. I even set a deadline for a basic multiplayer alpha. End of this year.

It's December now. Only a few more days are left for this year and you see me still posting random models instead of showing game play. I didn't manage to do what I planned to do. No multiplayer alpha.

No multiplayer alpha yet.
I decided to pretend that there never was that virtual deadline. I'll continue with development because that's what I want to do.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
Offline Off
Random Island Generation Improvements
A long time ago a blogged about random island generation. Here are some of my old blog entries about the topic:
> Random Terrain Generator
> Terrain Generator Continued
> Rivers
> More About Rivers
> Voronoi Powered Rivers, Bezier

I used a complex Voronoi/Delauny library for this and then rasterized the data using a polygon fill algorithm because I need a 2D pixel array for the heightmap.
After doing some more research however I realized that generating a Voronoi diagram directly as a 2D array is quite easy. I even found a site with minimalist Delauny diagram implementations for various programming languages.
No C# implementation there but the approach is so simple that it only took a few minutes to write a working version for Unity in C#. The only problem with the approach presented there (I only looked at the Java version) is that the algorithm is not optmized at all and gets a lot slower with increasing numbers of Voronoi sites.

What it does is extremely simple:
• for each pixel in the array:
     • find the closest Voronoi site by iterating over all sites and saving the shortest one with distance
     • tint the pixel in the color of the site with the shortest distance

There are two problems with the implementation:
• Checking the distance to ALL voronoi sites for each pixel: This makes the algorithm super slow with increasing numbers of sites. The solution for this is to only check the distance of adjacent sites. I'm creating the site points in a grid pattern so I know all the neighbors. This makes it easy to implement this optimization.
• Square root calculation in distance calculation: Calculating a square root is a relatively expensive operation. This operation can simply be removed because we only compare distances and don't need the actual distance. This has no huge impact but still makes a difference.

I solved both of these problems and achieved a fair performance that way.
The best thing however is that this approach is so much easier and requires just like 1% of the amount of code that I had before.

To test my new implementation more easily I made a little separate Unity project which you can try in the browser:
> Try the Web Map Generator
Note that this is just a very basic version which only creates a basic island shape and assigns some random colors. Also it doesn't work perfectly well with non-square map sizes.

Further Optimizations
Another thing I'll change is the resolution I'm using for the random map generation.
I was insane enough to work with a 1x1 m precision for all operations. Now I plan to reduced the base resolution to 4x4 m or maybe even 8x8 m.
Imagine a 256x256 m island. With the current calculation this leads to 256x256 "pixels" which is 65.536 pieces of data (each representing 1x1 m).
With 4x4 m precison the values change a bit: 256 / 4 is 64. 64x64 results in only 4.096 pieces of data. That's only 6.25% of the original data and therefore allows a much faster world generation. With 8x8 m it would be only 1.024 pieces of data.

Of course simply doing just that would make the generated maps blocky and ugly. That's why I will switch back to the 1x1 m precision after generating the basic map layout. I'll then apply simple smoothing algorithms and perlin noise to get more detailed and non-blocky results.

Red Cross
Someone in the comments pointed out that the red cross can be problematic in video games and he's totally right about it.
Therefore I replaced the red cross with a heart - which is a better logo anyway
1× editiert, zuletzt 13.01.19 23:36:27
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
14.04.19 21:32:35
Offline Off
Oops! Exactly 90 days without a dev blog post! I'm still alive!

Nested Prefabs
Basically everyone working with Unity for some time already has been waiting way too long for nested prefabs. Some Unity updates ago this feature has finally been released in a "stable" (non beta) version of Unity.
For Stranded III they are especially useful for UI. I can now make one single slider prefab for instance and re-use it everywhere. When I think the slider looks ugly I can just change the prefab and all sliders in all menus will be changed accordingly.
This did not work with earlier versions because the menus themselves already needed to be prefabs and Unity did not allow to put prefabs into prefabs (in other words: It did not allow to nest prefabs).

To benefit from this change I had to replace all non-prefab objects with prefabs. Some manually and others with the help of some scripts I wrote. This procedure wasn't a lot of fun but now it's done.

Banana Plant
I made a banana plant with hand painted leaves!
Bananas can just be picked and eaten when they are ripe. This makes them an easily accessible food source. Useful for survivors which are not well equipped yet.

> View Banana Plant on Sketchfab

Moreover there's a palisade now. I just modified and copy & pasted the log model to make this one.
Even though there is a version with a window the palisade is only meant to be used as a protection for your camp and not as a wall for buildings.

I plan however to add some more log based building blocks. Some ideas*:
• a gate which can be opened and closed (like in Stranded II)
• ... and maybe a way to close the window in the palisade as well?!
• a wall walk which can be built behind palisades and other walls
• various different parts to build a log house, tree house, towers etc.
• a jetty (yes, again like in Stranded II)

*) Just ideas. I don't promise that all of them will make it into the game.

Cool Links
I found a very nice guide in case you're interested in stylized 3D modelling.
It contains a ton of advices and common mistakes that should be avoided.
> Stylized 3D Production Guide

There are also many other interesting and useful game dev articles on 80.lv!
So if you're interested in this topic you should definitely take a look!
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
Offline Off
Unity 2019 & Lightweight Render Pipeline
Sooo... I upgraded from Unity 2018 to the lately released Unity 2019 and of course all my materials looked and behaved differently afterwards. Fun.
I took that as an opportunity to also switch to the Lightweight Render Pipeline! Maybe it makes rendering a bit faster!?
This step of course resulted in... more broken stuff.
I had to fix most materials manually. There's an "automatic" conversion but it didn't do a good job even though I only used original materials provided by Unity. More fun.
Afterwards I noticed that the LWRP (Lightweight Render Pipeline) isn't good at z-sorting alpha stuff:

I have to admit though that the LWRP makes the game look much more like Stranded II (which had comparable z-fighting issues)
What you can't see in that Gif is that the terrain material exploded as well which made the entire terrain become invisible.

Another issue I experienced: OnPostRender doesn't work anymore with LWRP (or in fact any scripted render pipeline).
That's not even mentioned in the OnPostRender documentation though. Thanks Unity!
This broke my little real time debug stuff rendering library (I'm using Unity's low level graphics API for that).
I found out how to fix this but it requires some more changes.

Overall this is a massively frustrating experience and I wish back the good old days of Blitz3D - the engine I used for Stranded I and II.
Blitz3D was very limited but straightforward. The API was super simple, super clean and things just worked the way you expected them to work.
All that isn't true for Unity. They shove in tons of new stuff with every update. It feels like they have thousands of different systems for everything you want to do and none of them works flawlessly or is documented properly.

Come on Unity! Stop adding new stuff and making feature breaking changes and start fixing and documenting the existing stuff you have.
You are forcing developers (who want to stay up to date) to waste huge amounts of time with migrating to new systems. That's time they should spend working on gameplay and content.
I'm already very afraid of the new input system and the next entirely new UI system. This is going to be a huge mess!

Maybe I should stick to making 2D games or give Godot a try.

Item stacking is nearly as much fun as updating Unity. Earlier I decided that "real" item stacking (merging equal items and just giving them a count value) is too complicated. Instead there should only be visual stacking which would mean that items are displayed as stacks but when you click at a stack you see all of the individual items with their attributes.

(missed a "1x" there but you get the idea)

Visual-only-stacks are cool and maybe I will keep this in the game but there's a technical problem with this: Tiny items that you get in big numbers and which all have equal attributes. Think of ammunition.
These would consume a lot of memory and take a lot of network traffic to sync. It's only a theoretical problem at this point but it feels horribly wasteful and I don't want to handle things that way.
My old "solution" to this was to simply declare that all items are very precious in Stranded III and that it rarely happens that you have a big amount of the same item type.
This is not a real solution at all and it limits the game a lot.

So I thought about stacking again and came up with something.
Stacking entirely equal items is relatively trivial. But how to handle items which have different attributes? E.g. one item burns and the other one doesn't. Should both be stacked and then both burn? Or none burns? Or they can't be stacked because the fire makes them different?

Or what about sizes and weights? Can 3 rocks with different sizes become a single rock stack with a little counter saying it is actually 3? Should they get the average size then? Wouldn't that allow people to modify items by letting them stack in smart ways?

For most cases the answer is: If items have different attributes they can't be stacked. The attributes are different for reasons and should stay the way they are.
In some cases however an attribute might not be important for inventory items at all. We could just remove it or take the minimum/maximum/average to allow stacking anyway.
For example an internal attribute which is used to store a state which is only relevant for items outside your inventory. This shouldn't prevent stacking.

Because of this you will be able to define different crazy merging strategies for each attribute:
• The default behavior will be that stacking won't work if the stack candidates have different values for an attribute.
• You could also just tell the game to remove the attribute during stacking (ignoring the values)
• Or tell it to not stack at all as soon as the attribute is present on at least one stack candidate (ignoring the values as well)
• And if you're completely crazy you keep the attribute but you calculate the minimum/maximum/average value across all stack candidates
• Aaand if you think the previous thing wasn't insane enough you could also let people implement methods in Lua to allow them handling the stacking logic their own way

Whenever a new item is stored somewhere (e.g. in your inventory) Stranded III will run a pairwise check for all items of that type and try to stack them by checking all their attributes and the merging strategies of these attributes.
When stacks are found the new attribute values for each stack are calculated. Depending on the merging strategy attributes can be discarded or recalculated based on attributes of the related stack candidates. Rocket science!
4× editiert, zuletzt 22.05.19 23:28:23
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
Zum Anfang Vorherige 1 2 3 4 5 Nächste Zum Anfang