Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 27 Feb 2011
Offline Last Active Feb 23 2015 03:24 PM

#5107752 AI for chess similar games

Posted by Druzil on 07 November 2013 - 03:52 PM

Think about how many options you have available per move (if the board is almost infiinite - then potentially you have almost an infinite amount of options), can those options be limited in some manner - are only a subset of them reasonable to inspect.  If you can answer those questions it may lead you closer to an answer on how to solve it.  For instance an almost infinite amount of viable options instantly rules out adversarial search like minimax/ab-pruning.

#5104915 [Answered] Real numbers (constants) in genetic programming

Posted by Druzil on 27 October 2013 - 07:38 PM

The implementation that I used for genetic programming was representing the program as a tree.  Each node in the the tree had an INode interface with a method 'Evaluate( INode[] params)'

Then I had concrete implementations of nodes for each of the different operators I wanted to represent







and so on...


I also had a literal operator which just returned a bounded value which was generated randomly at instantiation of the tree (through initial creation or mutation)

so at runtime I would create a concrete class through c# IL  e.g.


class literal5 : INode


     INode Execute(INode[] params)


            return 5.0;




hope that helps

#5101122 Need AI Help dealing with trends in Random Numbers

Posted by Druzil on 13 October 2013 - 04:59 PM

using System;
using System.Collections.Generic;
using System.Threading;

public class ColumnPick
    private static readonly Dictionary<int, int> NumberCount = new Dictionary<int, int>();

    public enum Face { Zero = 0, One = 1, Two, Three, Four, Five, Six, Seven, Eight, Nine };

    public static void Main()
        for (int i = 0; i < 10; i++)
            NumberCount[i] = 0;

        const int maxIndex = 15000;
        var rand = new Random();
        int oldHighest = 0;
        for (int i = 0; i < maxIndex; i++)
            int next = rand.Next(0, 10);

            for (int j = 0; j < 10; j++)
                Console.WriteLine("{0}: {1}", Enum.GetName(typeof(Face), j), NumberCount[j]);

            if (NumberCount[next] > oldHighest)
                oldHighest = NumberCount[next];
        Console.Write("Press any key to continue...");

I've simplified the code. Now to find the top x%, just sort the dictionary and take the top x% x 10 number of buckets.

#5097105 Latest trends in procedural quest generation

Posted by Druzil on 26 September 2013 - 04:37 PM

There are a few articles here that might be of interest. http://www.gamesbyangelina.org/  Maybe the Jul 20 one?

#5039300 Negamax Ai for TicTacToe

Posted by Druzil on 04 March 2013 - 08:28 PM

All your conditions are only checking if two adjacent cells containt the same state.  I assume you mean to be checking for lines as you are assigning the max score to this.

So they should be


if ((cells[0] == cells[1] && cells[1] == cells[2]) && (cells[1] != CellState.Empty))
            state = cells[1];


the logical "and" replaces the logical "or"

#5022057 Best practice needed for implementing an AI for a turn-based game

Posted by Druzil on 15 January 2013 - 11:10 PM

Álvaro makes some very good points about architecting your AI.<br /><br />It certainly would be interesting to see how MCTS stacks up to minimax for Hive. Having played Hive, my gut feel is that minmax would still be preferable in this instance because the branching factor is not too large to be prohibitive (something that MCTS tends to handle better), but more importantly Hive can have quite tight tactical lines and I think this is the one area that MCTS can fall down in (one of the reasons MCTS hasn't stood up well to minimax in games like chess and arimaa).

#4985909 Evolutionary Algorithms + Neural Net

Posted by Druzil on 01 October 2012 - 05:38 PM

if you are looking for a NN algorithm that uses evolutionary methods have a look at http://www.cs.ucf.edu/~kstanley/neat.html. There are libraries there for different languages so you can just plug your inputs in if you don't want to implement it yourself.

#4825268 when are genetic algorithms useful?

Posted by Druzil on 19 June 2011 - 05:58 PM

I've seen an AI player for the board game Puerto Rico (written in excel no less) using a GA which is almost unbeatable. It can be found on the Puerto Rico page of BoardGameGeek.

#4823086 AI Framework for .NET?

Posted by Druzil on 14 June 2011 - 01:17 AM

Depends what you want to do....


may have something you are after (eg NN and GAs)