Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: Ludi Game in the making C# .net2.0

  1. #11
    Join Date
    Mar 2006
    Posts
    421
    Rep Power
    0

    Default

    Quote Originally Posted by Anthon View Post
    Who's developing this?
    The dude that posted it.
    http://xclusief.mybrute.com
    Militant Reloaded: DFI LanParty UT || Core 2 Duo E6750 + cooled w/ CoolerMaster CM Sphere CPU cooler || Visiontek HD3870 OC 512mb || OCZ Platinum 2x2GB 1066mhz || Kingwin Mach1 800 watt PSU || Sony Bravia 40" widescreen 1080p

  2. #12
    Join Date
    Dec 2002
    Posts
    500
    Rep Power
    0

    Default

    sounds good, im goin have a look at it
    Cultured in Aggression and Koding like a Warrior!!
    “Common sense is instinct. Enough of it is genius.” - George Bernard Shaw.
    "The significant problems we face cannot be solved by the same level of thinking that created them." - Albert Einstein

  3. #13
    Join Date
    Dec 2002
    Posts
    500
    Rep Power
    0

    Default

    An AI would need to know the position of the other player's markers on the board, as well as the position of its markers to make an informed play.

    You should make a simple dll with an interface to interact with the game so we can make our AI against it.

    Code:
    namespace Ludi
    {
    interface IStrategy
    {
       int   PlayerId { get; };
       int[] Play(int[] dice, Player[] players);
    }
    
    class Player
    {
       PlayerMarker[] markers;
       int playerID;
    }
    
    class PlayerMarker
    {
       int cellOnBoard, positionFromStart;
       bool isBorn, isHome;
    }
    }
    Dice would be an array of the faces (2 for a normal game).
    The Play method would return an array (same length as dice) containing the index of the marker to be moved by the amount on each dice face.

    Your game class would assign the playerID to the strategy when it is instantiated. Then a copy of the board's state is sent to the play method after the dice is rolled.
    Cultured in Aggression and Koding like a Warrior!!
    “Common sense is instinct. Enough of it is genius.” - George Bernard Shaw.
    "The significant problems we face cannot be solved by the same level of thinking that created them." - Albert Einstein

  4. #14
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Quote Originally Posted by icymint3 View Post
    An AI would need to know the position of the other player's markers on the board, as well as the position of its markers to make an informed play.

    You should make a simple dll with an interface to interact with the game so we can make our AI against it.

    Code:
    namespace Ludi
    {
    interface IStrategy
    {
       int   PlayerId { get; };
       int[] Play(int[] dice, Player[] players);
    }
    
    class Player
    {
       PlayerMarker[] markers;
       int playerID;
    }
    
    class PlayerMarker
    {
       int cellOnBoard, positionFromStart;
       bool isBorn, isHome;
    }
    }
    Dice would be an array of the faces (2 for a normal game).
    The Play method would return an array (same length as dice) containing the index of the marker to be moved by the amount on each dice face.

    Your game class would assign the playerID to the strategy when it is instantiated. Then a copy of the board's state is sent to the play method after the dice is rolled.
    Thanks, this is very well put.

    I am goig to try an adhoc rush thing with the AI. I will used the first ideas in skew drew post, cause 1) I want to see the game running 2) I have like 1hr of programming time per week on average, some week, none at all. Down the line I pretty it up.
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  5. #15
    Join Date
    Dec 2002
    Posts
    500
    Rep Power
    0

    Default

    obviously there should be some modifications to the code i did

    1. specifically, either making the fields of the 'states' classes public or making public properties for them.

    2. optionally providing a notification mechanism (either as a method in the IStrategy interface or as an event on the Game object)

    Code:
    void NotifyPlay(int[] dice, int[] markersMoved, int playerId, Player[] players);
    /*markersMoved would be the return value from the previous IStrategy.Play*/
    3. you can put all those loose parameters on a board object and pass that around instead.

    Code:
    class LudiBoard
    {
       int[] dice;
       int currentPlayerId;
       Player[] players;
       // List of previousThrows, previous plays, etc
    }
    4. Either provide some methods on the Player, PlayerMarker or a Utility class to do stuff like CanKill(someOther, diceValue), CanMoveTo(diceValue), IsOccupied(boardCell), CanBorn(), etc... we wouldn't want everyone re-coding this in their AI strategy.
    Last edited by icymint3; Aug 28, 2009 at 01:32 AM.
    Cultured in Aggression and Koding like a Warrior!!
    “Common sense is instinct. Enough of it is genius.” - George Bernard Shaw.
    "The significant problems we face cannot be solved by the same level of thinking that created them." - Albert Einstein

  6. #16
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Thanks for EL Support

    I followed the ideas from SkewDrew in earlier post and with the little time I had I added two AI implementation.
    http://www.megaupload.com/?d=OLSV34HW

    Due to time scarcity, I can't bother do the dll and all that.

    I also realised from much earlier, after considerable thought given, that a "weighted method" was much easier to do than the "if else logic" I used before for AI. Same output but different coding.

    Next I will work on the user interface, and some simple animation of the peices, then fix the "move peice" bugs, then improve the AI - Aggression, Caution, (Hasty, etc not implemented yet)

    I will modularize it in the end cause I would want help porting the code to flash, and java
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  7. #17
    Join Date
    Nov 2004
    Posts
    5,192
    Rep Power
    25

    Default

    Like what I see so far. Waiting on the network part to come to fruition so I can test it out.
    Knowing the solution doesn't mean knowing the method. Yet answering correctly and regurgitation are considered "learning" and "knowledge".

  8. #18
    digimon Guest

    Default

    Just tell me when to make a socket server/client fi unuh

  9. #19
    digimon Guest

    Default

    as a matter of fact, a generic one build already. Just have to modifiy it and tek out the complex algo

  10. #20
    Join Date
    Jul 2006
    Posts
    410
    Rep Power
    0

    Default

    how can i run this app? i downloaded it and tried runnin it but sum application error came up

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •