English Stranded III Dev. Blog

101 replies
Goto Page
To the start Previous 1 2 3 4 5 6 Next To the start
11.07.21 09:23:11 pm
Up
DC
Admin
Offline Off
Particle Effects
I've worked on particle effects. Not only the particles themselves but also systems around them. You can now define effects which consist of particles and sounds (both optional - it can also be just sounds or just particles) in Stranded III. These effects can either be specified in other places e.g. the effect that is played if someone steps on or hits a specific material or they can be spawned at will via Lua scripts. The system uses pooling so effects don't have to be re-instantiated all the time (= better performance).

I've also drawn my own particle sprite sheet. The advantage of having multiple sprites in one single texture is that you only need one material for all your particle effects. This reduces rendering overhead if multiple particle effects are visible at the same time. Okay, well.. in reality I need glowing and non-glowing sprites etc. so I have to use different shaders and therefore it's not just one material. Using the sheet improves performance nevertheless.

That's what the sheet looks like right now. There's still enough room for additional effects!
IMG:https://stuff.unrealsoftware.de/pics/s3dev/particlesheet_pre.jpg

> Click for bigger version


I was quite scepticale when I started using Unity's particle system. Before that I was used to entirely programming particle effects on my own. That's how I did it in all my previous games. The advantage of programming particle effects is that you can do whatever you want. There are absolutely no limitations.

Coming from this approach with unlimited possibilities I was sure that the Unity particle system, which uses a (big) set of settings, would limit me and my creativity a lot. Luckily I did not spot any major limitations yet. Kudos Unity! That particle stuff is actually quite nice and allows to create complex effects. The best part is that you can instantly see your changes which massively reduces iteration times. When I programmed particle effects I had to recompile my projects all the time to see what my adjustments look like.

Here are some of the effects I made. Note that these are just first attempts and that I may (or may not) improve them later.
IMG:https://stuff.unrealsoftware.de/pics/s3dev/fire_pre.gif

> Click for bigger version

If you look carefully you can see that the're even bouncing fire sparks with collision (just one visible in this gif)!

IMG:https://stuff.unrealsoftware.de/pics/s3dev/bubbles_pre.gif

> Click for bigger version


Resarch & Recommendation: Subnautica
I started (and finished) playing Subnautica. Of course primarily for research purposes
It has two major things in common with Stranded III:
1. it's a 3D first person survival game
2. it's made with Unity

If you didn't play Subnautica yet I can highly recommend to give it a try. I got it for free on Epic store some time ago but it's also worth the money. It's super fun to explore the world and it doesn't get boring because events and new crafting abilities keep you entertained.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
19.09.21 08:26:26 pm
Up
DC
Admin
Offline Off
Responsive Website
Stranded3.com is now responsive and works better on mobile phones. This is something I planned to do for all my pages this year. It's not 100% finished though and I may change a few things in future.

Equipment Icons
I've drawn new equipment icons which better match the building category icons. That means: doodle style stuff.
IMG:https://stuff.unrealsoftware.de/pics/s3dev/ui/equipment_pre.jpg

> Click for bigger version


Automatically Generated Icons
Items in the game can either use images as icons for the inventory or the game can automatically render icons from the 3D models. Automatic rendering can be adjusted with some definition settings to make the items look better. I now made a simple hacky dialog which helps to find the right definition values:
IMG:https://stuff.unrealsoftware.de/pics/s3dev/ui/iconmenu_pre.jpg

> Click for bigger version


Technical Stuff: IDs & Lua
Stranded III is using string identifiers to make things more mod- and script-friendly. Internally however it's working with integer identifiers and references/pointers because they consume less memory and are processed much faster.
When writing Lua scripts you can now benefit from the best of both of these worlds. You can use string identifiers (which will automatically be converted to the internal identifiers) or you can use the internal identifiers.

This script will get the internal identifier for the "log" entity definition:
Code:
1
log = entityDefinition.get("log")

Retrieving the identifier once and using it multiple times in subsequent script parts will be slightly faster than using the string identifier all the time. That's because each time you're using the string identifier, Stranded III will have to do a hash map lookup (it's actually a C# dictionary). If you get the identifier once and reuse it, there will be only one lookup.

Simple, unoptimized approach (100 hash map lookups):
Code:
1
2
3
for i=1,100 do
     entity.spawnOnGround("log", math.random(-50,50), math.random(-50,50))
end


Optimized approach with cached identifier (1 hash map lookup):
Code:
1
2
3
4
logId = entityDefinition.get("log")
for i=1,100 do
     entity.spawnOnGround(logId, math.random(-50,50), math.random(-50,50))
end


This is a micro optimization though and in allmost all cases it's probably easier to just stick with strings. It's just nice to have the possibility to use less of these slow and nasty strings.
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
To the start Previous 1 2 3 4 5 6 Next To the start