Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

143 Neutral

About stoneyrich

  • Rank
  1. stoneyrich

    Threading Issues

    BeerNutts I can see you are a pro, but when i said I had no choice meaning considering alot of things I just got some samples codes of similar  implementation and tried to understand the appoach and it did work well for me.    I dont mind sending you my source code and see what i am trying to do or what i have done.    It is actually a Card game with an AI for a final project.
  2. stoneyrich

    Threading Issues

    Definately true as you put it, I do not have a background at all when it comes to threading etc.   I do not have much choice, because of the way I have decided to design my  application (card game). Nevertheless I found a solution the my problem and all seems to work fine.   After this project I will look extensively at how to use threading and more specifically Parallel Programming incase for future needs.   Thanks for your input.
  3. stoneyrich

    Threading Issues

    Please I need help ? I have a main thread to run (ProcessPlayerMoves) void StartGame() { if (mainThread == null) { mainThread = new Thread(new ThreadStart(ProcessPlayerMoves)); mainThread.Name = "My Main Thread"; mainThread.IsBackground = true; mainThread.Start(); } else { } } Then the players method is as follows: private sMove GetMoveForPlayer(Player p) { lastMove = null;   playerThread = new Thread(new ParameterizedThreadStart(p.Move)); playerThread.Name = p.Name; playerThread.Start(game.GameBench);   //Register a listener p.PlayerMoved += new PlayerMovedHandler(player_PlayerMoved);   // lastMove is assigned in the player_PlayerMoved handler while (lastMove == null) ;   // if we get here the player moved   //Unregister the listenter p.PlayerMoved -= player_PlayerMoved;   // Intervel Delay for the main thread  if (chkSimulationDelay.Checked) Thread.Sleep(simulationInterval);   try { playerThread.Join();  } catch (ThreadAbortException tae) { Console.WriteLine(tae.ToString()); } return p.CurrentMove; } During simulation there is no consitentcy, if i want to run say 500 games it just halts at 20 or sometimes 100 or 50. And i do not get an error, the game just stops but the program is still running.
  4. stoneyrich

    Game Loop Implementation on Windows Forms C#

    Thanks Mario,    Well it does answer and gives me a different look at my problem.    But does that mean the main execution loop will be the UI thread,            because as i said ealier i will take picture box click event responses from the UI.   My players will act turn by turn (where will this player turn switch be in the main executioin loop ? ) 
  5. Hi guys,   I need help.    I am designing a two player card game in C#, but i have a problem figuring out the following: The Main Game Loop (UI thread or a sperate thread)  Human Player and AI player should they be on different threads? I am going to run experiments with different pairings at the end of the game development.   my thoughts are below:    MainGameLoop()  {  //player A or B () //display card played () //check the scores () }   AI_Player() { //Constant thread runing to identify if its AI's turn to play. }   HumanPlayer() {    //A click event from the UI form. }  
  6. stoneyrich

    Path node , route path, list algorithm

    thanks @iMalc well i tried my best to really explain it in a way any one could understand. I think it really had to do with time also but i was of the thought someone might have been in such a situation before. @Stroppy Katamari Yes, after trials i noticed some components had loops.
  7. stoneyrich

    flowchart code for tic tac toe

    you could also look at it from this angle. any action to the board as input there must be a corresponding output. input > player x,o makes a move board : response to player input display changes to board output > check for winner , losers or draw This in a game loop can give a fair idea.
  8. stoneyrich

    Path node , route path, list algorithm

    Okay Guys thanks very much i noticed i had over 100 views yet no one came to my rescue. Well i was able to figure it out. in case anyone chanced upon this search and finds a simlar situation this is how i went about it. Using Graphs Representation and BFS & DFS for path or route finding i represented each conn.# or connector.# as a vertices or a node created an undirected edge as a link or a connection to another conn.# object created a graph out of the table Used BFS,DFS to find the paths or route. for now that is the approach i have used and seems to work well
  9. Hi everyone ...i would like your ideas on how to go about this list problem. attached is a sample of the list am trying to work with: I want to achieve a list of possible route like this possible route 1 - 272<309<308>312>48 route 2 - 316<315>319>99 route 3 - 48<1420 < it begins from the left of the node > it end at the right side of the node any help ?
  10. Hi alvaro, Thanks soo much for your response and detailed explanation of my question. I was able to implement the transposition table. and there was an improvement from my previous experiment. Thanks once again...
  11. I am trying to implement a transposition table in my search incorporating zobrist key a brief description - at each position you have 13 different pieces, 1-6 from player 1, 1-6 from player 2, and 0 (empty) that means my zobrist key table will be of size 13 * 25. I filled my table with some random values wit the code below public void intZobristKeys() { Random ranZobristKey; ranZobristKey = new Random(); for (int positon = 0; positon < 325; positon++) { zobrist_table[positon][EMPTY] = ranZobristKey.nextInt(); zobrist_table[positon][PLAYER_ONE] = ranZobristKey.nextInt(); zobrist_table[positon][PLAYER_TWO] = ranZobristKey.nextInt(); } } am stuck where do i move from here as in the link between this and recording the actual moves in the transposition table eg {hashkey, state value, depth} etc any help ?
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!