Skip to main content

Posts

Showing posts with the label simulations

Metaballs Revisited

The new visual identity of my work place (and the re-ignition of an old lava lamp) made me think of the good old metaballs from the Amiga demo-scene of yonder and how it has been a while since I have implemented them from scratch. This time I wanted to play around with Python and numpy to see what that could bring. But first, what are metaballs?  It's, for example, this: Wikipedia defines them as: In computer graphics, metaballs are organic-looking n-dimensional isosurfaces, characterised by their ability to meld together when in close proximity to create single, contiguous objects. https://en.wikipedia.org/wiki/Metaballs As cool as multidimensional metaballs are, we'll stick to 2D ones in this post. The algorithm The algorithm behind them is quite straightforward -- in their simplest form. Basically for each pixel in each frame, or buffer, you add up the influence of each metaball in the simulation and then cut off below a certain threshold and normalize what’s left. The...

Crafting an artificial opponent for Fjordar

Fjordar is an epic, tactical strategy game for 1 to 4 players, set during the Norwegian Civil War. The game begins in the year 1130, when the old king Sigurd Jorsalfar dies. Each player begins the game as one of Sigurd's heirs or one of the other influential people in Norway at the time, who is vying for power in the vacuum left by the old king's death. – Fjordar, BGG A while back, after a lengthy exchange on ideas around this topic, the designer of Fjordar, Frode Brændø, asked me if I would be interested in helping out with designing a solitaire variant for this upcoming game. Of course I would! Here are some brief notes on some from the design process. Idea We wanted to make an artificial opponent based the following criteria: Non-fiddlyness Running the opponent should not lead to a lot of overhead for the player. Readability The player should to some extent be able to read the artificial player enough to predict future actions and react to them. Keep ga...