In this section you can check out what I'm currently working in, practically in real time.
If some of this seems cryptic it's because the logs seen here come directly from my personal productivity tool prio, and are really just "notes to self".
Nevertheless, if you are interested in what I'm currently working on, this space will certainly be updated FAR more often than the news section.
06:10:19 sandblox CLOCK: 0.2 days (04:07 hours)
06:00:58 sandblox LOG
Basics of colored lighting in there, could really use some optimization on the mesh side of things as there is redundant sampling going on in the filtering.
06:00:24 sandblox TASK: material / colored lighting
04:51:24 sandblox LOG
Quite happy with the fact that a "dumb" light spreading algorithm works so well. There are artifacts at edges (light can't spread between chunks), but I'll leave that for now and see what happens.
04:47:07 sandblox TASK: fix edges cases for light spreading
04:25:02 sandblox TASK: light spreading
00:03:36 sandblox LOG
Really getting into the whole idea of world generation functions, lots of room for fun experimentation here, and it is all so much easier than doing things manually. A whole different paradigm really..
20:27:06 sandblox CLOCK: 0.1 days (02:17 hours)
19:57:39 sandblox TASK: build InfBloxChunk via direct access to model::BloxChunk instead of via model::Blox::cell() calls
19:25:45 sandblox TASK: remove sunlight occlusion cache
18:53:03 sandblox TASK: cache lighting information in BloxCell
17:17:55 sandblox CLOCK: 0.2 days (04:17 hours)
17:13:53 sandblox LOG
Incrementally "fixing" the side flag caches does indeed work, right not kind of hacked in there as the data is supposed to be constant from the calling context...
16:05:40 sandblox LOG
Of course all the best ideas come after bedtime, probably because I tend to work for several hours straight right before trying to get to sleep.
One insight, now successfully implemented, was that "side flags", i.e. what faces are adjacent to air / water for each BlockCell (the datasize has doubled, material and sideflags per cell...) could be cached once the BloxChunk was built.
This is kind of intricate, as calculating the edge cases in x and z requires the adjacent BloxChunks in each direction, which in turn recurses forever. What I did instead was only calculate only the "internal" side flags (x,z > 0 && x,z < BloxChunk::ASPECT_XZ - 1), which only requires data from the current BloxChunk, and mark the edge cases as "invalid".
When it comes time to build the mesh (InfBloxChunk) for a given BloxChunk, I simply check the value of the side flags for each cell. If valid I use that value, and if invalid I calculate them on the fly (currently not storing them).
This has the effect, as before, of forcing the adjacent BloxChunks into existence, but in the case it doesn't recurse forever, as we are only drawing a fix number of InfBloxChunks.
I can probably set this up to also cache the calculation of the side flags that were invalid, thereby incrementally "fixing" all the invalid values as I go.
15:57:38 sandblox TASK: caching of sideflags in BloxCell
23:06:58 sandblox CLOCK: 0.3 days (06:19 hours)
17:33:50 sandblox TASK: optimize bwf1
17:33:45 sandblox TASK: stl map tests
16:13:59 sandblox CLOCK: 0.1 days (03:16 hours)
15:11:58 sandblox TASK: faster bloxchunk lookup view
17:57:33 sandblox CLOCK: 00:19 hours
15:42:10 sandblox CLOCK: 00:20 hours
03:54:27 sandblox CLOCK: 0.4 days (08:49 hours)
03:54:22 sandblox LOG
Lots of work on various world functions today, very good progress on both procedural cities as well as terrain (with epic caves).
23:46:01 sandblox TASK: experiment with a one level cache of the latest BloxChunk
23:14:25 sandblox LOG
Implemented a 2d map (a binary tree of binary trees) for the Model side BloxChunk lookup. This helps performance enormously, which in retrospect is obvious as all data access requires such a lookup.
Will experiment with some extra caching here to see if that helps even more.
23:09:46 sandblox TASK: faster bloxchunk lookup model
16:03:02 sandblox LOG
Got rid of the Vector constructors that convert between internal types (int to float, etc). This of course had repercussions across the entire codebase, and I am fixing things as required.
The main reason for this is the previously posted "magic" for converting from world space to local Blox space. There were some implicit errors as a result of:
(int)1.5 = 1
(int)0.5 = 0
(int)-0.5 = 0
(int)-1.5 = -1
What I needed (for Sandblox) was for numbers to be converted like this:
1.5 -> 1
0.5 -> 0
-0.5 -> -1
-1.5 -> -2
This got me thinking that maybe there are lots of other programs that implicitly depend on that kind of conversion, but since it's not just a simple cast things might get wonky. Hence the disabling of automatic / implicit float to int conversions, and a manual inspection of each case.
15:59:01 sandblox CLOCK: 0.1 days (02:07 hours)
23:18:51 sandblox LOG
The secret of the Blox:
static const int locIdXZ(const int aXZ)
if(aXZ < 0)
idXZ = (aXZ + 1) / BloxChunk::ASPECT_XZ - 1;
idXZ = aXZ / BloxChunk::ASPECT_XZ;
static const int locLocalXZ(const int aXZ)
if(aXZ < 0)
localXZ = BloxChunk::ASPECT_XZ - 1 - ((-aXZ - 1) % BloxChunk::ASPECT_XZ);
localXZ = aXZ % BloxChunk::ASPECT_XZ;
assert(localXZ >= 0 && localXZ < BloxChunk::ASPECT_XZ);
23:18:03 sandblox CLOCK: 0.1 days (01:19 hours)
21:34:51 sandblox CLOCK: 00:16 hours
16:35:26 sandblox CLOCK: 0.1 days (02:47 hours)
15:53:35 sandblox TASK: fix id and local coordinates for blox
20:46:47 sandblox CLOCK: 0.3 days (08:13 hours)
17:37:03 eco LOG
Label support, as well as some tasty stats.
18:47:11 sandblox CLOCK: 01:04 hours
16:43:32 ace TASK: cover image for official soundtrack
15:37:17 sandblox CLOCK: 0.1 days (01:52 hours)
19:33:06 sandblox LOG
Refactoring of the inf stuff today, as I had realized that I could reuse the basic framework for any number of chunk styles (heightfield, marching tetrahedrons, grids, etc).
Once the InfHeightField was done, I did InfDelic, which is a psychedelic infinite marching tetrahedron world. Surprisingly enough I got it to run / build in realtime, even without pre-caching all the noise stuff that is going on.
19:31:08 sandblox CLOCK: 0.3 days (07:44 hours)