Saturday, 22 October 2011

Update: Bezier curves

I have just updated the Bezier curves demo.
--> http://madflame991.blogspot.com/p/bezier-curves.html

It's now prettier and the control points are easier to adjust.

Wednesday, 12 October 2011

Penrose polygons


Number of sides:

Tuesday, 11 October 2011

Cellular automata in Minecraft

Besides being on of the best games I've ever played, Minecraft, is also a superbe resource for learning how game development works. First of all, the game is still in development - you get to see with each update what elements are added and how bugs appear. You don't have this privilege with most games out there - you don't get to see how an idea evolves into a great game. You can also read the full version history on the official wiki to see what were the very first steps in developing this wonderful game.

In this post I want to underline some cellular automata-like behaviour that can be observed in the Minecraft universe.

Cellular automata
The simplest example I can give is how grass spreads. A block of dirt will have grass grow on it if one of its neighbours has grass on it (some lighting conditions must also be met).
In other words the rule needed to describe this as a cellular automata looks like this:
Dirt -> Grass if at least one of the neighbouring blocks are Grass and light conditions are met

Water
There are 2 types of water blocks: sources and flowing. Flowing water comes in 7 levels or so, and can't be picked up with a bucket (water sources can).
Rules (roughly):
Air/Water -> Water, Flowing of level Max(neighbours)-1
Air/Water -> Water, Source if it has at least 2 neighbours who are Water Sources themselvs
Air -> Water, Flowing, if the block above is water

Water will spread on a flat surface, if there are no gaps in the way. Otherwise it will be drawn to the nearest gaps. Gap seaching only occurs when placing a water source. Notice, in the screenshots below, the uneven spread of water due to gaps.

 

Lava
It behaves mostly like water except it spreads slower and the rule regarding Sources doesn't apply - you can't create infinite lava pools.
Lava, Source -> Obsidian if the above block is Water
Lava, Flowing -> Stone if one of the neighbouring blocks is Water



Light
Propagates just like water on a flat surface except it's in three dimensions.
Realistic shadows wouldn't have blended with the overall blocky aspect of the game and it would have required a more powerful GPU.


Below is a demo showing how light could have been implemented using cellular automata. Click on the canvas to add and remove obstacles.


Redstone circuits
The signal in a restone circuit propagates just like water on a flat surface.

Rules:
Redstone -> Redstone, powered of level Max(neighbours)-1
Repeater, inactive -> Repeater, active, level 2 if its input is powered
Repeater, active, level 2 -> Repeater, active, level 1
Repeater, active, level 1 -> Repeater, inactive
Redstone, unpowered -> Redstone, powered if there is a neighbouring Repeater, level 1 or another source

Redstone signal propagates from one elevation to another only if the block above the lower redstone is transparent.
 

Crops
Crops have a very simple set of rules. The rate of growth is influenced by light level and irrigation.
Rules:
Seed -> Crops, level 1
Crops, level 1 -> Crops, level 2
...
Crops, level 6 -> Crops, level 7
Crops, level 7 -> Crops, fully grown

Cacti
Placed cactus block is "Cactus, level 1"
Rules:
Air -> Cactus, level 2, if the block below is Cactus, level 1
Air -> Cactus, level 3, if the block below is Cactus, level 2
Air -> Cactus, level 4, if the block below is Cactus, level 3

Trees
The decaying of leaves behaves much like grass: Leaves -> Air if there is no Wood block around.
Currently, trees grow in minecraft instantly. It would be much nicer to see them growing gradually. With enough rules the growing of trees could be simulated using cellular auomata.
Sample rules:
Sapling -> Trunk, level 1
Air -> Trunk, level 2 if the block below is Trunk, level 1
Air -> Trunk, level 3 if the block below is Trunk, level 2
Air -> Branch, level 1 if there is a neighbouring Trunk, level 3 block
Air -> Branch, level 2 if there is a neighbouring Branch, level 1 block
Air -> Leaves if there is a neighbouring Branch, level 2 block
Leaves -> Branch, level 2 if there is a neighbouring Branch, level 1 block

Minecarts
Minecart mechanics could be simulated (up to a certain extent) using an altered version of Wireworld. Minecarts would be electrons and the track would be the conductor. Additional rules may be needed to prevent the minecart from splitting like electrons do when the track splits.
Minecarts could also be implemented as turmites. The closest thing to a turmite is the snow golem because it leaves a trail of snow wherever it goes. If it had changed its behaviour based on whether it stood on snow or not it would have been a fully capable turmite.
Every minecart knows its direction and energy level.

The rules for a turmite-minecart would look like this:
on ground: decrease energy by 5
on horizontal tracks: decrease energy by 1
on ascending tracks: decrease energy by 4
on descending tracks: increase energy by 3
on cornering tracks: adjust direction, descrease energy by 1
on booster: increase energy by 10

in all cases advance if there is enough energy left.

Tuesday, 27 September 2011

2 Updates

L-system generator [link]
+ optimized a bit
+ turtle commands are simpler to write
+ turtle now has variables
+ added more examples

Graph.addPhysics() [link]
+ tweaked it
+ added collisions to boundaries
+ made it look prettier

Sunday, 25 September 2011

Saturday, 17 September 2011

Graph.addPhysics()


I've been wanting for a long long time to make this but never got the chance
It is supposed to draw a graph, but fails to settle down sometimes and starts acting like an ameoba

Edge list



Write one edge per line

Ex:
0 1 (edge between nodes 0 and 1)
1 2 (edge between nodes 1 and 2)
2 0 (edge between nodes 2 and 0)

Sunday, 11 September 2011

Gather 10 keys to escape update

Polished and enhanced version of my LD21 entry --> http://madflame991.blogspot.com/p/gather-10-keys-to-escape-v11.html

Changes:
+ added glasses so you can see into the future
+ added the binary tree of life
+ you can now see your stats
+ tweaked the difficulty
+ your conscience has longer arms


Friday, 2 September 2011

Wiretune World!

Wiretune World! - It's a programming-rhythm-wireworld based game at which I've been working on for the past 3 weeks. As of yet it only features 12 levels, but I will add more soon.

Give it a try!

Jar file --> http://gamejolt.com/freeware/games/wiretune-world/download/6030/

Tuesday, 30 August 2011

Friday, 5 August 2011

Don't trust the cat and what the future holds

Details regarding Don't trust the cat:
+ it's the first game I make that focuses on content and not on gameplay mechanics
+ its engine was made back in 2009, but I never got a story worth making into a game; I finally came up with some random ideas and asked a friend if she could write a story of some sort... and thus was the game born
+ it's most probably the last game I'll make in AutoIt - I'm now focusing on Java and JavaScript
+ it features music from an artist very dear to me, Gillenium

Future plans/projects:
+ I'll be adding some visual mini-demos/experiments to the blog made in JavaScript - probably a fractal or two
+ Pentamino is a game based on the L game by Edward de Bono. It's a very nice game but I haven't found a playable version anywhere
+ "Wireworld emulator" is morphing into a game - yes, a programming game
+ a Robot Unlock update is coming at some point in the future

Friday, 29 July 2011

Update: Tree.dance()

Your browser does not support the canvas element.

Split sequence
Colors
Split angle attenuator [0.7..1.5]
Split angle mul [0.2..0.9] Split angle bias [0.2..0.9]
Length attenuator [0.4..1.2]
Length mul [0..80] Length bias [90..180]

Sunday, 24 July 2011

Robot Unlock Wakthrough

A week ago JayisGames reviewed Robot Unlock. I was pleased to see that most of the comments were positive.  If you got stuck on a particular level you can now consult the walkthrough at the end of the review.
I would  like to thank JayisGames for presenting my game to a larger audience, as I'm not usually that good at publishing and promoting my games.


P.S.
I'm working on another sort-of-programming game. It'll be fun ;)

Saturday, 16 July 2011

Release: Don't trust the cat


Controls: you only need the Arrow Keys, the Spacebar and Esc

I'll be back with more details.

Tuesday, 21 June 2011

3D.engage()

Your browser does not support the canvas element.

Saturday, 2 April 2011

Whir 2 released!!!

Whir 2 is ready to frustrate on http://madflame991.blogspot.com/p/whir-2.html
Short description: (Whir + Robot Unlock + Om Nom Nombers)2 = Whir 2

Rate the game on GameJolt.com

Wednesday, 23 February 2011

Text.grow()


Your browser does not support the canvas element.


Tuesday, 22 February 2011

The new cube


Your browser does not support the canvas element.



Monday, 7 February 2011

Coin: Update

Grab the latest version of Coin from Sourceforge

Changes:
+ some functions have been replaced with operators (makes sense): you now write "var = 10" instead of "move var 10", "i++" instead of "inc i", "sum += num" instead of "add sum num" and "rem = num % 10" instead of "mod rem num 10". Note that you cannot write complex expressions.
+ added keyboard shortcuts to the IDE: F1 - Help, F5 - Run, Ctrl+O - Open script and so on...
+ added two new functions: fwritebs and fwritenl (File Write Blank Space and File Write New Line)
+ fixed some bugs, ironed out the code a bit and corrected typos in the help file

Sunday, 6 February 2011

Bezier curves

See the newer and updated version here --> http://madflame991.blogspot.com/p/bezier-curves.html


Your browser does not support the canvas element.



Bezier 0.6

+ click on an empty zone to spawn a point
+ click on a point to select it and click again to designate its new location
+ doubleclick on a point to delete it

For more information on Bezier curves check:
http://en.wikipedia.org/wiki/B%C3%A9zier_curve
http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/bezier-elev.html

Saturday, 5 February 2011

Rubikon: early playable version

An early playable version of Rubikon has just been uploaded to GameJolt http://gamejolt.com/open-source/games/rpg/rubikon/4483/.

Update: You can play it online here: http://madflame991.blogspot.com/p/test-page_05.html

Keep in mind that this is not the final version. The final version will look better and have an appropriate difficulty curve.