vendredi 29 mars 2019

January 18Th: Stop SOPA Day

Minecraft has become the latest site pledging to go dark for 24 hours on January 18th in protest against the Stop Online Piracy Act (SOPA) & Protect IP Act (PIPA) currently making their way through the US legislature. Notch tweeted the following message a few hours ago:
Decided. We'll silently take down http://minecraft.net and http://mojang.com on the 18th in protest of SOPA.
A number of sites are planning to shut down in order to protest the new law, which is supposedly designed to thwart copyright violations and pirating. Similar hairbrained schemes crop up now and then and need to be smacked back down with great force, Whack-a-Mole-style.

I have little confidence in our government's ability to do almost anything right that doesn't involve really cool weapons, and the idea of opening the technological infrastructure of the entire internet to their meddling is sheer madness. Standford Law Review has a good summary of the problems with the law, and the Wiki entry also fills in some details. SOPA/PIPA is yet another bone thrown to the toxic mix of trial lawyers, lobbyists, and media conglomerates, and will only serve to cripple the continued growth of the internet and stifle free speech. 
 

Explore Simple Game Algorithms With Color Walk: Part 3

In this series we are taking a look at different game algorithms using the simple game Color Walk as a sandbox for exploration and discovery. The last post showed how to implement one of the simplest algorithms I could think of, round-robin, and how to develop some tooling around the game so that we can quickly run through multiple iterations in a batch mode and see statistics on the run. This post will start exploring some more algorithms, and we'll start needing to think about how to improve the algorithms so they aren't so naive.

Adding the Second Algorithm


The first thing we need to do to add a second algorithm into the mix is add an ability to change the algorithm type, both within the UI and in the code when running the solver. The UI addition is easy. All we need to do is replace the "Round Robin" text with a <select> tag that includes the <option> tags for each algorithm choice we'll support. Right now that will be "Round Robin" and "Random Choice," since a random algorithm will be another simple algorithm that will be quick to implement. I also gave the <select> tag an ID of solver_type, so it can easily be accessed from the code.

The code changes are a little more extensive than the UI. We'll start with adding an event handler to update the solver state when the algorithm changes. For that addition we can add this code to the Solver.init() function:
      $('#solver_type').change(function () {
switch (this.value) {
case 'roundrobin':
that.solverType = that.roundRobin;
break;
case 'random':
that.solverType = that.randomChoice;
break;
default:
that.solverType = that.roundRobin;
break;
}

game_moves = [];
seed = 1;
makeBlocks();
});
This code adds a change event handler to the #solver_type select box, and sets the Solver.solverType property to the function we want to use for the algorithm chosen. This is one of the lovely features of JavaScript (as opposed to C++). Passing functions around is easy because they are first-class citizens in the language. No need for special syntax here, and when we want to call the algorithm we've chosen, it will be as simple as that.solverType(). To finish off the handler, we need to restart the game board by setting the seed back to its starting value and recreating the blocks on the board. We also need to clear out the game_moves so that the statistics get calculated for one algorithm at a time.

We should also set an initial value for the solverType so that it's ready to go when the page loads, and we can stick that near the bottom of Solver, after the definition of the algorithms:
  function Solver() {
// ...

this.roundRobin = function() {
// ...
}

this.solverType = this.roundRobin;
Now we need to call this new solverType() function instead of the roundRobin() function in the click handler for the interactive mode control:
      this.solver = $('<div>', {
id: 'solver',
class: 'control btn',
style: 'background-color:' + colors[this.index]
}).on('click', function (e) {
that.solverType();
}).appendTo('#solver_container');
And we need to make sure to also call it in the run() function:
    this.run = function _run() {
that.solverType();

// ...
}
At this point the round-robin algorithm should work again, if it is selected, but the random choice algorithm will not work because we haven't defined it, yet. That task is simple enough:
    this.randomChoice = function() {
controls[this.index].updateGameBoard();
this.index = randomInt(0, controls.length - 1);
this.solver.css('background-color', colors[this.index]);
}
We merely had to replace the index update code in roundRobin() with some new code that gets a random index. It should be obvious that future algorithms will follow this same structure, so we should be able to pull out the first and last lines of this function into its own function that can be shared between all of the algorithms. Let's make a new function called runAlgorithm() that updates the game board, calls the currently configured algorithm, and updates the color of the solver control button:
    this.runAlgorithm = function() {
controls[this.index].updateGameBoard();
this.solverType();
this.solver.css('background-color', colors[this.index]);
}

this.roundRobin = function() {
this.index = (this.index + 1) % controls.length;
}

this.randomChoice = function() {
this.index = randomInt(0, controls.length - 1);
}
This change simplifies each of the algorithm functions. We also need to remember to change the two solverType() calls to be runAlgorithm() calls. Now we have things nicely cleaned up and adding future algorithms should be easy, at least from the standpoint of adding in the scaffolding of each new algorithm. Some of the algorithm code itself could still be challenging.

Notice how this architecture came about naturally. I didn't spend a lot of time trying to plan out the perfect set of functions ahead of time. I added things incrementally, and as optimization and organizational changes became obvious, I did them. Too much planning and design runs the risk of architecting the code into a dead end, making it difficult to add new features to a code base that has become too complicated with twists and turns that form a maze of objects and function calls. I much prefer taking a path of least resistance, paying attention to where the code is leading, and making incremental improvements that organize and support the code for the problem it is attempting to solve.

Some programmers may balk at the use of a switch statement to decide which algorithm to use, but it's not as bad as it seems. Switch statements get cumbersome when there are multiple switch statements operating on similar objects with similar structure strewn throughout the code. These switch statements all have to be updated whenever another item is added to the list of possible cases. If you ever find yourself updating multiple switch statements when adding a new option or feature, that's the time to think about how to reorganize that code into a class hierarchy so that most of the switch statements can be eliminated. Most of the time, you'll still need one switch to create the objects from the correct classes, but one should be enough. I don't expect to need more than this one switch statement for the different types of algorithms, so I think it's fine.

Getting back to this new random choice algorithm, let's see how it performs:

Color walk 100 iterations of random choice

Wow, that is much worse than round-robin was. The average number of moves is 30 moves higher than round-robin, and the standard deviation is twice as big. Here's a comparison of the two algorithms:

Round RobinRandom Choice
Min 37 60
Mean 48.3 80.2
Max 62 115
Stdev 4.5 10.5

It's also apparent when watching the algorithm run that it behaves differently. It sometimes appears to get stuck, pausing for a moment before continuing to clear blocks. It also seems to leave some colors of blocks behind for a while while it clears others. Both of these behaviors are caused by the randomness of the algorithm. It appears to pause when it repeatedly picks the same color more than once, and certain colors will appear to get left behind if the algorithm happens to not pick them for an extended sequence of moves. Not picking one color for a long time may not be much of an issue, but picking the same color multiple times in a row is definitely contributing to this algorithm's poor performance. We should start looking at how to improve that behavior.

Improving Random Choice with Skipping


The immediate problem of picking the same color more than once in a row is fairly easy to solve. We can add a new algorithm type to the drop-down selector with the option value of "random-skip," and then add a case to the switch statement for it:
      $('#solver_type').change(function () {
switch (this.value) {
case 'round-robin':
that.solverType = that.roundRobin;
break;
case 'random':
that.solverType = that.randomChoice;
break;
case 'random-skip':
that.solverType = that.randomChoiceWithSkipping;
break;
default:
that.solverType = that.roundRobin;
break;
}
Then all we have to do to fill in the randomChoiceWithSkipping() function that implements the algorithm is check each random integer that's created for the index, and while the candidate index is the same as the current one, generate a new candidate, like so:
    this.randomChoiceWithSkipping = function() {
i = randomInt(0, controls.length - 1);
while (this.index === i) {
i = randomInt(0, controls.length - 1);
}
this.index = i;
}
This optimization makes a marked improvement in the algorithm's performance:

Color Walk run for 100 iterations with random choice with skipping, first attempt

Everything has improved, with the average number of moves being reduced by 17 moves, and the standard deviation being reduced by nearly 3 moves. However, this is still substantially worse than the round-robin algorithm, and that's likely because of how the random choice algorithm picks colors differently than round-robin. Because it's possible that the next random color that's chosen was the same as one picked in the recent past, it's more likely that the chosen color doesn't remove any more blocks, or at least very few. The round-robin algorithm guarantees that at least the next color will be the least recently picked color, and it's likely that more blocks of that color will be exposed for removal by the time the color comes around again.

We aren't going to consider optimizing the number of blocks removed on each color choice quite yet. That's getting into a different kind of algorithm, but we can look at not picking a color that will not remove any blocks on the current move. That would still be a random algorithm with skipping, and it seems like it would further improve the random choice algorithm. We're kind of going for the most non-wasteful random algorithm we can think of here, while still keeping it as random as possible.

So how do we check that the candidate random color removes at least one block? The current code doesn't lend itself well to this check because the tasks of finding blocks to remove, removing those blocks, and incrementing the move count all happen together in the same base function call. There's no way to easily check for a color without also doing the rest of the work of updating the game board. Luckily, there's a fairly simple way to get what we want by adding a function and threading a conditional parameter through the function calls for updating the blocks. I can imagine that at some point we're going to want to separate out those search and update tasks because later algorithms are going to do a deeper, more complex search of the board, but by then we'll also want to change the data structure for the blocks. That's a bigger change to the code that isn't really necessary, yet, so let's stick with the simple workaround for now.

To implement the simple workaround, we want to create a function that does most of what Control.updateGameBoard() does, except for the updating the game board part. Instead of searching for blocks of a certain color adjacent to grey blocks and removing them, we want to search for blocks of a certain color adjacent to grey blocks and return whether a match was found. To do this check, we can start by updating the algorithm to do what we want it to do, and then fill in the details as we go:
    this.randomChoiceWithSkipping = function() {
do {
this.index = randomInt(0, controls.length - 1);
} while (controls[this.index].checkGameBoard(true) === false);
}
Now instead of checking if the new control index is the same as the last one, we want to check if the game board has a match on the color of the new control index. If it doesn't, we'll pick a new index. That change allows us to simplify the code a bit because we don't have to remember the old index anymore. So what does Control.checkGameBoard() do? It basically does what the start of Control.updateGameBoard() does, but with an extra conditional parameter so that it will know to stop on the first match:
  function Control(color) {
// ...

this.updateGameBoard = function() {
this.checkGameBoard(false);

if (isFinished()) {
game_moves.push(moves + 1);
makeBlocks();
} else {
moves += 1;
}
$('.score').text(moves);
}

this.checkGameBoard = function(only_check) {
var match = false;
var color = this.color;
_.each(blocks, function (block) {
if (block.isDead) {
match = match || getNeighbors(block, color, only_check);
}
});

return match;
}
Because Control.checkGameBoard() does nearly the same thing as the beginning of Control.updateGameBoard(), we can call it from Control.updateGameBoard() as well, but with only_check = false so that the search will run through every block and update the game board as it goes. Within Control.checkGameBoard(), we've added a variable to keep track of if there was a match, and return that value at the end of the function. We also pass the only_check conditional along to getNeighbors() so that we can use it where we're going to need it.

You've probably noticed that this code is a little wasteful in that it does not return on the first match found. It will continue searching through the rest of the grey blocks even after finding a match. While that's probably less efficient, there is a reason for it. I'm still working from the assumption that we're going to want to completely change the method of searching for colors later on because the current method will prove to be too slow. I don't want to do that change until I need to, though, so I'm doing the simplest thing that will work here without changing too much code. It's still fast enough for these simple algorithms, and I have a hunch that if we change things to return immediately on a match, we'll be changing it back in the near future for the greedy algorithm. Let's move on to the changes to getNeighbors():
    function getNeighbors(block, color, only_check) {
// ...

return checkNeighbors(neighbor_positions, color, only_check);
}

function checkNeighbors(positions, color, only_check) {
var match = false;
_.each(positions, function (position) {
var block = blocks[position];
if (block.color == color && !block.isDead) {
if (only_check) {
match = true;
return;
}
block.isDead = true;
$('#block' + position).css('background-color', '#d9d9d9');
getNeighbors(block, color, only_check);
}
});

return match;
}
The only change in getNeighbors() is the call at the end to checkNeighbors() by adding the only_check argument. Most of the real changes are inside checkNeighbors(). We add a variable here to again keep track of whether a match was found or not, and inside the if block that finds a match, if we're returning on the first match, we set the match-tracking variable to true and return. Note that because of how the _.each() function works, this only returns from the current iteration of the loop, bypassing the code that updates the game board, but not returning from checkNeighbors(). The rest of the neighbors are still checked, and any other matches would also return from the loop iteration function before updating the game board. Since we also call getNeighbors() inside this loop, we need to pass along only_check for the other blocks that will be searched. The same argument as before for not changing the code too much applies here, so we just loop through all the neighbors and return whether or not a match was found at the end.

The enhanced skipping should now be working, so let's give it a whirl:

Color Walk with random choice and skipping 100 iterations

Things have improved yet again! Now we're getting pretty close to the performance of round-robin, as we can see in the following table:

Round RobinRandom ChoiceRandom with Skipping
Min 37 60 43
Mean 48.3 80.2 53.1
Max 62 115 64
Stdev 4.5 10.5 4.5

The fact that random choice with skipping is still slightly worse than round-robin probably means that the least-recently-used behavior of round-robin is slightly more optimal than just picking a color at random. This is good. We now have two reasonable baselines for comparing against future algorithms. We do have one more improvement we can make, however.

Improving Round-Robin


Clearly, now that we can skip colors that aren't worth choosing in random choice because they won't remove any blocks, we can do the same thing with round-robin. This is an easy addition, and it should improve round-robin's performance somewhat. To add this algorithm, we can create another menu choice, add it to the switch statement, and add this algorithm code:
    this.roundRobinWithSkipping = function() {
do {
this.index = (this.index + 1) % controls.length;
} while (controls[this.index].checkGameBoard(true) === false);
}
The new algorithm simply checks if the new index has a color match, and if not, it moves on to the next index until it does find a match. How much of an improvement do we get?


Not as much as I was expecting, but it's still an improvement. Let's look at all of the results:

Round RobinRR with SkippingRandom ChoiceRandom with Skipping
Min 37 37 60 43
Mean 48.3 46.9 80.2 53.1
Max 62 59 115 64
Stdev 4.5 4.1 10.5 4.5

We shaved 1.4 moves off of the average, 3 moves off of the max, and 0.4 moves off of the standard deviation, showing that the distribution tightened up somewhat. I'll bet most of the improvement by not picking dead colors in round-robin came from the beginning and the end of games, when there are most likely to be less useful colors to pick from.

Now we should have a good idea of what to expect from future algorithms. A normal game with haphazard choices of colors will result in about 50 moves, if we at least take care to not pick a color that won't remove any blocks. Picking a color that was not picked recently is also generally better than picking a color totally at random. The goal for the rest of the algorithms is to do better than this, much better. We should also start to get an idea of what a reasonable lower bound is for the number of moves in a typical game, and thus, what a well-played game looks like. We'll start down that path next time with the greedy algorithm, and see where that takes us.


Article Index
Part 1: Introduction & Setup
Part 2: Tooling & Round-Robin
Part 3: Random & Skipping
Part 4: The Greedy Algorithm
Part 5: Greedy Look Ahead
Part 6: Heuristics & Hybrids
Part 7: Breadth-First Search
Part 8: Depth-First Search
Part 9: Dijkstra's Algorithm
Part 10: Dijkstra's Hybrids
Part 11: Priority Queues
Part 12: Summary

Ep 26: Big Fun With Little Figures Is Live!

Ep 26: Big Fun with Little Figures
I talk with Howard Whitehouse about Mad Dogs With Guns, his gangster game from Osprey Games. In a separate segment, I talk with Peter Berry of Baccus 6mm to talk about the seeming monopoly of 28mm figures and games in the glossy gaming magazines.

https://soundcloud.com/user-989538417/episode-26-big-fun-with-little-figures

The Veteran Wargamer is brought to you by Kings Hobbies and Games
http://www.Kingshobbiesandgames.com
https://www.facebook.com/Special-Artizan-Service-Miniatures-1791793644366746/

Join the conversation at https://theveteranwargamer.blogspot.com, email theveteranwargamer@gmail.com, Twitter @veteranwargamer

Segment 1
Follow Howard on Facebook
https://www.facebook.com/Howard.Whitehouse.Writer/?ref=br_rs
https://www.facebook.com/Pulp-Action-Library-283960595046814/

Buy Mad Dogs With Guns:
Mad Dogs With Guns - Howard Whitehouse https://ospreypublishing.com/mad-dogs-with-guns
Pulp Action Library - http://www.pulpactionlibrary.com/

Other companies we mentioned:
Copplestone Castings http://www.copplestonecastings.co.uk/list.php?cat=7
Pulp Figures https://pulpfigures.com/products/category/11
Brigade Games http://brigadegames.3dcartstores.com/

Paddy Whacked - T.J. English https://www.amazon.com/Paddy-Whacked-Untold-American-Gangster/dp/0060590033
The Outfit - Gus Russo https://www.amazon.com/Outfit-Gus-Russo/dp/1582342792/
True Detective - Nathan Heller Series - Max Allen Collins https://www.amazon.com/True-Detective-Nathan-Heller-Novels/

Segment 2
Follow Baccus6mm on Facebook - https://www.facebook.com/Baccus6mm/
Joy of Six - https://www.facebook.com/TheJoyofSix/

Peter's Opinion piece - https://www.baccus6mm.com/news/20-09-2017/Historicalgaming-'Thetimestheyareachanging'/

Other companies we mentioned:
Warlord - https://us-store.warlordgames.com/
Perry Miniatures - https://www.perry-miniatures.com/
Games Workshop - https://www.games-workshop.com/en-US/Home
Wargames, Soldiers and Strategy - https://www.karwansaraypublishers.com/wss-mag

Music courtesy bensound.com. Recorded with zencastr.com. Edited with Audacity. Make your town beautiful; get a haircut.

jeudi 28 mars 2019

Fight Night Champions Tips





Fight Night Champion tips and tricks

fight night champion tips tricks cheats
So I have been getting all kinds of requests from people online regarding my Fight Night Champion tips and tricks. I am not exactly what most would call a serious gamer, but I do play Fight Night religiously. I can honestly say that it is the one game that I am really good at. So good in fact that I regularly have to create a new fighter pretty often because people recognize my fighter and will not fight me. Some people even know my ID and won't fight me. A lot of champions also know me and won't fight me either. I actually had a guy tell me straight up one day, "Sorry bro, but I won't fight you cuz I don't want to lose my belt". My last fighter actually had me sitting at a record of 243 wins and only 8 losses. Out of those 8 losses only 2
Read Now »

Like A Book Made To Play: The Immersive Experience Of “Here They Lie”

Here They Lie is a Playstation 4 game signed by Tangentlemen and Santa Monica Studio. The game transports you to a terrifying parallel world from which you cannot escape. Inside this bizarre place, it's necessary to explore a nightmarish city inhabited by malevolent creatures. In this experience, the point of view is first-person and you can only use an old flashlight as a weapon.



In the whole gaming narrative you must wrestle with life or death moral choices to uncover the mystery of the woman in yellow (a kind of Ariadne that guides you through the city maze and corridors inside buildings). There are two ways to play Here They Lie: classic version or using VR glasses (which enhances the immersion in the story). Check the mysterious trailer below:



Despite the beautiful graphics and soundtrack, Here They Lie caught my attention through the perfect balance between narrative and gameplay. You only run from the monsters; inside this dark dimension, you are only a voyeur, observing a scenario of pain and blasphemous acts. The only thing you really do is walking around the huge city capturing hints to discover what is happening. Where's the fun in it? I think Here They Lie is the kind of experience that brings literature features to play.

For me, having played Here They Lie from the beginning to the end was like reading a book written with a Kafkanian and Lovecraftian touch. The situation is too absurd but, with the suspension of disbelief, you can accept that this strange world makes sense. The story grabs your attention and curiosity leads you to find the answer for some questions like: How did I get here? Who is the woman in the golden dress? What are the creatures with animal heads? Why did it happen to me?



Games like this one lead us to the multiple possibilities that we can experience today in the gaming market. We still have "triple A" first-person shooters with zombies but on the other hand, a huge universe to explore fantasy in a different way. We are leaving a privileged ambient of ludic possibilities. To play different games like this one is to create a richer repertoire for classes, gaming projects or gaming discussions.

Let's play!

#GoGamers

Autunno / Autumn

ITALIANO
Scendon le gocce della prima pioggia
che sui selciato ancor timida batte,
mentre settembre lietamente sfoggia
l'ardore delle sue bacche scarlatte.
E le foglie chiacchierine
parlano dell'autunno che ritorna
e che sotto la pioggia fine fine
di pampini e di bacche agile s'adorna. 
(MARINO MORETTI - "La prima pioggia").


ENGLISH
A touch of cold in the Autumn night—
I walked abroad,
And saw the ruddy moon lean over a hedge
Like a red-faced farmer.
I did not stop to speak, but nodded,
And round about were the wistful stars
With white faces like town children.
( T.E. HULME "Autumn")

mercredi 27 mars 2019

There Are Still A Few Places Open For The Umpire's Course To Be Held At Curro Durbanville.

MSSA umpires (in their stylish orange shirts) manning the score-boards.
One of the most important aspects of a well run championship is the consistency and standard of umpiring.

Umpiring affects every aspect of a championship, and since Mind Sports South Africa (MSSA) is highly cognisant of such, MSSA shall be holding a number of umpires' courses during 2019.

Such umpiring courses around the country shall ensure that umpires are certified and are fully aware of their duties and responsibilities in all the disciplines (Board gaming, Esports, Wargames).

It is important to also note that MSSA will only consider Registered Players who are certified as National Umpires for upward advancement apropos being recommended for training as an international referee by International Esports Federation (IESF).

Also, MSSA expects registered players who again intend to stand for team selection to 'put back', by becoming umpires. This way a culture of 'giving' is created, and a transference of knowledge is enabled.

The first such course shall be done as follows:

Date: 2 March 2019
Time: 9H00 - 18H00
Cost: R600.00 per Registered Player if not a National Squad member, R400.00 per Registered Player if a member of a National Squad.
Venue: Curro Durbanville, 1 Memento Drive, Sonstraal Heights, Durbanville, 7550
RSVP: 24 February 2019

The cost will include morning and afternoon tea, and lunch.

The course shall include:
* Ethics
* Background to MSSA's systems
* Roles of the different umpires
* Entry
* Basic rules to the games
* Pairings
* Data capturing of results
* How results are further used

At the end, a test will be given, and those that pass will be accredited as umpires.

Any Registered Player who is 18 or older may register for such course through their member club.

For additional information, please contact mindsportscorrespondence@gmail.com

Also read: