Dig Game - Hide Methods
So as of late I have been working on my first phaser powered game, that so far I just simply call “dig”. I will be hosting it here on github pages for now. If you care to read what it is all about in detail check out the readme at the main branch on github. However for the sake of just this post I would like to write about what I am calling “hide methods”
What is a “hide method”?
The object of the game is to dig a land tile which may or may not contain an amount of in game currency that I call “pebble”. Once you dig a tile, you have the option of digging another tile on the same land stack layer, or drop down to a lower layer.
As you may have guessed a “hide method” is an algorithm that determines the distribution of a given amount of total land stack pebble.
Some thoughts to consider before designing a hide method.
How will the total stack pebble be distributed per stack layer?
How will an amount of layer pebble be distributed to each tile?
What does the design represent, as such what should it be called?
Is the distribution of total stack pebble fair, or well balanced?
Hide method “hello-world” example
So a hide method can be very simple say I just want to place all land stack pebble in tile 0,0 on the surface layer.
Notice that I am using my hideKit API, this comes in handy for making quick work of repetitive tasks involved in the authoring of a hide method.
The hideKit API.
This has lots of helpful little tools that aid in the process of writing a hide method. Such as hideKit.setAmount that as the name suggests it just sets the pebble total, and amount values of a tile. In addition it has other methods such as hideKit.makeOptions that returns an array of tile indexes for a given layer that can be spliced away when distributing an amount of pebble in a layer. I will do my best to keep an up to date list of all hideKit API features in the readme file at the repository
Some thoughts on distribution of available wealth.
As stated the purpose of a hide method is to distribute a total sum of pebble into a given land stack. With the general idea of what prompted the games development in the first place in mind. I have come to think that the main hide method in use should hide pebble in a “many but low, to few but high” dynamic. In other words there should be a lot of loot tiles on the surface layer, but each tile will contain very small amounts of pebble, while the bottom layer will be the opposite of that.
This is what comes to mind when I think of the possible returns of a lateral vs linear approach of personal development. Becoming a “jack of all trades” will likely result in payoff, but in low amounts as you are a jack, not a master. While becoming a master at something might give great payoffs, but it is risky if it turns out that it is something that is not that marketable.
So far I have been developing a hide method that I just simply call “normal1” which holds true to this idea. However It goes without saying that this is just one aspect of the game that I can have a whole lot of fun with.
The normal1 hide method
here it is as it stands in game_dig 2.14.4:
It is not yet battle tested, but so far it does what I want.
I will be writing more hide methods as the game progresses. Hide methods might end up becoming a component of something that might come along in a few minor releases that so far I am calling a ‘game mode’. The way I see it a game mode will have one or more hide methods that are used for that task, along with other components that have to do with game mechanics, and end game scenarios. However that is a whole other can of worms.