Mid-Ocean Trenches

Drawing mid-ocean trenches is largely complete, as well as rendering the direction of the lava flow on the world map. I’ve begun to dabble in fonts, as well. Next up comes simulating the actual lava flow, and displaying the resulting terrain in time steps (I’ve yet to determine how many years each time step will be, but it is likely to be between 10,000 and 1,000,000).

 

Lines of Best Fit

I’ve learned how to perform multi-linear regression using Apache Commons Math3, to create polynomial lines of best fit for orders 1 (linear) through 6, in just over one-tenth of a second. This was a critical piece to being able to actually transform drawings of pixels on screen into meaningful entities to use in equations – and it’s very accurate, and very fast.

formulas

I used data from the NHANES 3 surveys for age and hand length (in centimeters) for ages 8 through 16. This is part of the data I’ll use to calculate the size of people’s hands, which affect everything from what size gloves they’ll be able to wear, to the measurement of their Thumb Crotch Length (TCL):

TCL.png

It turns out that your TCL is directly related to the ‘ideal’ diameter of anything you grip, affecting your maximum voluntary grip force. In other words, depending on the size of your hand, there’s a definite, mathematical way to figure out just how wide the hilt of that blade needs to be in order for you to most efficiently cleave through your enemies – or just how thick the rope tied to their corpses should be to make it easiest for you to drag them, with a maximum of efficiency and a minimum of discomfort and fatigue.

Tonight was a great success. Next step: calculate R2 (ranges from no fit at 0.0 to perfect fit at 1.0) for these formulas, to see just how well the lines themselves do fit the data, and be able to choose the best one for the best situation. Mid-Ocean Ridges, you’re fast approaching.

Loader, Main Menu Progress

I’ve succeeded in having the loader fetch posts from this WordPress, store them on disk, and display them in the proper order. If posts are missing (even out of order) they are downloaded and re-displayed in the proper order, simply by clicking an update button. Any posts that are found on disk are loaded from there first.

loader v1

The main menu has a sequence of six shots of a Swiss mountain range and small farmstead with two houses; each shot says on the screen for 15 seconds, before fading out as the next shot fades in, over the same length of time. Players are now able to enter some preliminary information for the creation of a world: the world size, and the axial tilt of the planet itself (which is what drives seasons and much of the weather, since it affects how much solar energy is absorbed/reflected by the surface). Easy presets (such as ‘Earth’) will be offered on this screen in the future and further options are nailed down.

main menu v1

The next screen is where I’ll let user draw (or randomly generate) their mid-ocean trenches, whose regularly flowing lava will be the engines of plate tectonics over tens to hundreds of thousands of years at a time, per ‘tick’. In order to determine the direction part of the angular velocity of such lava flows, each time a user draws a line without lifting up the mouse, a line of best fit will be calculated for those points and stored. At any given point on the line, the lava will flow in eight general directions: tangent, inverse tangent, and two lines halfway in-between each of these. This means if a line is perfectly vertical or horizontal at a point, the lava will flow perfectly into the eight surrounding pixels / points on the map.