Posts

Showing posts from December, 2020

Scroll for yourself

Image
Many of the apps we are enticed to use have a feature of scrolling down a feed. It's an almost mindless activity which due to the intermittent variable rewards principle is addictive in nature. It is now a well known fact thanks to documentaries like the social dilemma on netflix that these feeds are engineered to captivate you attention. There is a phrase that I like “ If you are not paying for it then you are the product ” which applies to these free services we use every day. Facebook’s consumers are not the people who scroll down their news feeds for hours at a time, the consumers are the advertisers who pay facebook to promote their posts and place the adverts. What those consumers are paying for is the attention of the mindless scrollers (myself included). I turn to mindless scrolling when my mind is particularly weak, when I’m too tired to do anything useful. When it isn’t the right time of the day to just have another coffee so as to do...

THREE.js: minecraft in a weekend

Image
I have been enjoying exploring the ideas behind procedural worlds and in a previous post even showed a simple voxel renderer based in THREE.js which would load chunks when the camera got close enough to the edge. That was based on the great tutorial here which explains how to create a voxel-based mesh in THREE.js such that it doesn’t use all of the machine’s resources for the smallest of worlds. I found that to be an invaluable source of information and continually referenced back to that throughout the weekend. Looking back at my git logs for this project to be able to type this up, I have no intention of this post being a tutorial in itself, my progress was as follows: Walking around rather than observer view Sideways collision detection - not walking through the map Changing to a system where there was a sensible grass - sand - water height system Adding trees Another optimisation for terrain generation in addit...

A failed attempt at yielding rivers from gradient noise

Image
From the jsfiddle here I have done a previous post on gradient noise , explaining my realisation at why the equations involved are what they are. Hydronics are notoriously challenging in procedural landscapes because very few realistic ontogenetic algorithms exist. The solutions employed by the likes of dwarf fortress is to run calculations based on a path at different levels of detail down from the mountains to the oceans. Given that gradient, noise is so-called because it makes use of gradients and from the simplicity with which beaches can be generated I wondered if a simple -1/a trick would yield path perpendicular to the beaches - a river? The reasoning behind -1/a is that if you have a gradient on a graph, say “a” from a line ax+b, if you want a perpendicular line, then the gradient will be (-1/a). Following this reasoning, and the fact that we have the gradient at each point, I attempted to calculate the negative inverse of the gradient, which ended up being fiendishly complicat...

The computer should be working harder

Image
 Computers are cheap, well compared to developers anyway. The developers time is expensive, this is why although computational power has expanded exponentially, the user experience of simple programs like the word processor has stayed relatively the same. What windows xp managed to do on a 300mHz chip was quite astounding. Nowadays you will not get away without using a 1GHz chip and if you don’t have multiple cores and giggs of ram forget about being able to run a word processor. I’m editing this post in google docs, and this helps make my point. When you used ms word on windows 95 or xp the word processor was written in C. The elements were optimised to run on x86 32bit processor. That took a lot of effort, the memory had to be managed by the developers as is the case in C. You had to malloc some memory into existence for only the time you needed it and you needed to make sure you unallocated it as soon as it was no longer needed. 128mb of ram is not much to work with after all, n...

Popular posts from this blog

Structural engineering with cardboard

The twelve fold way

Greedy meshing in javascript