Dev Blog

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

Overview (115 Entries)

Entry 36 - River Surface Mesh, Lua API Changes & Shell Skin - March 27, 2016

River Water Surface
Generating a simple water surface mesh for the river is not a big deal. This is the result of my first attempt (which is a ~70 line C# class):
IMG:https://stuff.unrealsoftware.de/pics/s3dev/mapgen/rivergen10_pre.jpg

> click to enlarge


This mesh is only based on the river points which are calculated by the random terrain generator. A more sophisticated approach would be to actually check the terrain heights to make sure that the river has neither gaps inside the river bed nor overflows outside the river bed.
Moreover it probably makes a lot of sense to split the river into multiple meshes for long rivers so the engine doesn't have to deal with the entire river all the time even though only small parts are visible.

Lua API
Stranded III will make heavy use of Lua scripts (as already mentioned in previous blog entries). This also includes the entire user interface which is 100% scripted in Lua.

I worked on the Lua API to make it more object oriented. It previously worked like:
1
2
3
4
sprite = s3sprite.create(image, x, y)
s3sprite.setColor(sprite, {255, 0, 0})
s3sprite.setRotation(sprite, math.random(360))
s3sprite.setSize(sprite, 3, 3)


Now you can do the same thing with a bit less code:
1
2
3
4
sprite = s3sprite.create(image, x, y)
sprite.setColor({255, 0, 0})
sprite.setRotation(math.random(360))
sprite.setSize(3, 3)


Don't confuse s3sprite (Stranded III sprite module/library) and sprite (variable containing an actual sprite instance) here!
The difference is that you now call methods directly on the instance instead of passing it in as first parameter. This may not seem like a huge change but it makes scripts cleaner, shorter and easier to read.

Unfortunately I already wrote a few Lua scripts for Stranded III so I had to change over 600 function calls for this API change...

Shell
In the last dev blog I showed a little video where I modeled a shell. I continued working on the shell and recorded a video of me drawing the skin. People who subscribed to Unreal Software's YouTube channel probably already saw it because I uploaded it some days ago:
> Click to watch on YouTube!

This is the model with texture:
IMG:https://stuff.unrealsoftware.de/pics/s3dev/models/shell_pre.jpg

> click to enlarge


The shell model would actually be a good candidate for a bump map. I drew the shading on separate layers in Photoshop so I could easily create a bump map from it. It would probably only need some small adjustments. I didn't give that a try yet though.

Disqus

blog comments powered by Disqus