Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About mike74

  • Rank
    Advanced Member
  1. mike74


    i'm making a game. it's at when someone runs the game and hits M, it's supposed to pop up a mouse config dialog. it does so on my home PC but not at the library. both systems are windows xp. any ideas why this would be? here's some code: BOOL CALLBACK MouseSensitivityProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG: { HWND sliderhwnd = GetDlgItem(hwndDlg, 203); SendMessage( // returns LRESULT in lResult (HWND) sliderhwnd, // handle to destination control (UINT) TBM_SETRANGE, // message ID (WPARAM) TRUE, // = (WPARAM) (BOOL) fRedraw (LPARAM)MAKELONG (1, 11) // = (LPARAM) MAKELONG (lMinimum, lMaximum) ); SendMessage( (HWND) sliderhwnd, (UINT) TBM_SETTICFREQ, (WPARAM) 1, (LPARAM) 0 ); SendMessage((HWND) sliderhwnd, (UINT) TBM_SETPOS, (WPARAM) TRUE, (LPARAM) mousesensitivity ); return TRUE; } case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: case 207: { HWND sliderhwnd = GetDlgItem(hwndDlg, 203); mousesensitivity = SendMessage((HWND) sliderhwnd, (UINT) TBM_GETPOS, 0, 0); EndDialog(hwndDlg, 10); } return TRUE; case 210: EndDialog(hwndDlg, 2); return TRUE; } } return FALSE; } ... case 'M': { themouse->unacquire(); gamestatetype oldgamestate = gamestate; gamestate = MOUSECONFIG; ShowCursor(TRUE); DialogBox( GetModuleHandle(NULL), MAKEINTRESOURCE(200), hWnd, MouseSensitivityProc); ShowCursor(FALSE); gamestate = oldgamestate; themouse->acquire(); return 0; }
  2. mike74


    i'm having upload problems. can someone from gamedev update my 4e4 entry? it's at
  3. mike74

    wavefront loader

    I made a wavefront OBJ file loader. It's at
  4. mike74


    I made a reversi game at Let me know what you think.
  5. mike74

    normal averaging

    Cool, thanks.
  6. mike74

    normal averaging

    That's for heightfields where the connectedness of triangles is obvious. mike
  7. Let's say you have a vector of triangles and their normals. What's the simplest way to display them using normal averaging (i.e. setting a vertex normal based on the average of the normals of all triangles adjacent to that vertex)? It seems like hash tables might be appropriate, but I'd prefer something simpler. mike
  8. mike74

    ellipsoid normals

    Interesting. So, if you do divide all the y values of a sphere by 2 to make an ellipsoid, it seems that you can just multiply the old sphere normal's y value by 4 and normalize. mike
  9. mike74

    ellipsoid normals

    Let's say I have a sphere, and I distort it into an ellipsoid by dividing the y values by two. What happens to the normals? My intuition tells me they get multiplied by two, but I'm not sure. mike
  10. mike74

    3d torus

    I was just wondering if anyone knows the best way to create a 3d torus from triangles? I'd like something simple that doesn't require complex rotation routines. Thanks. mike
  11. mike74

    othello game

    Interesting. Out of curiosity, what kind of search depth do you think I should be able to get with minimax and alpha-beta for Othello? Right now, it seems I can only go about 6 levels deep (it takes a few seconds to a minute on a 400 mhz machine). I didn't really try to optimize it too much, so I'm just sort of wondering how far from optimal I might be now. mike
  12. mike74


    I'm not sure if that's what people consider Reversi today. I just downloaded a game called Daisy Reversi, and it has the four pieces in the center. It says: The rules of Reversi are fairly simple but lead to a great many combinations and strategic decisions. The game always begins on an empty game board with four pieces in the center square, as shown in the following figure: mike
  13. mike74

    OpenGL circle

    Is there any easy way to draw a circle in OpenGL? I already tried: glPointSize(25.0); glEnable(GL_POINT_SMOOTH); glBegin(GL_POINTS); glVertex2f(0, 0); glEnd(); But, it seems my graphics card limits the radius to about 5 pixels. mike
  14. mike74

    minimax help

    I'm trying to code minimax with alpha-beta for Othello. Unfortunately, I must have done something wrong since the minimax computer usually loses to the random choice computer. Any ideas what's wrong with the following code: Board performgoodblackmove(const Board &b, const int depthleft=5) { vector<int> v = legalmoves(b); if (v.size()==0) {cout << "no moves possible" << endl; return b;} int maxheur = -9999999; int maxmovenum; for (int ctr = 0; ctr < v.size(); ctr++) { Board testboard = makemove(b, v[ctr]); int curheur = min(testboard, -999999, 999999, depthleft-1); if (curheur > maxheur) {maxheur=curheur; maxmovenum=v[ctr];} } return makemove(b, maxmovenum); } int min(const Board &b, int alpha, int beta, int depthleft) { vector<int> v = legalwhitemoves(b); if (!depthleft) return b.heuristic(); for (int ctr = 0; ctr < v.size(); ctr++) { Board testboard = makewhitemove(b, v[ctr]); int curheur = max(testboard, alpha, beta, depthleft-1); if (curheur < beta) beta = curheur; if (beta >= alpha) return alpha; } return beta; } int max(const Board &b, int alpha, int beta, int depthleft) { vector<int> v = legalmoves(b); if (!depthleft) b.heuristic(); for (int ctr = 0; ctr < v.size(); ctr++) { Board testboard = makemove(b, v[ctr]); int curheur = min(testboard, alpha, beta, depthleft-1); if (curheur > alpha) alpha = curheur; if (alpha >= beta) return beta; } return alpha; } Thanks. mike
  15. mike74

    othello game

    So, I should probably multiply the computer values by the grid and then subtract the player values multiplied by the grid? Initially, I was just looking at the computer's squares. mike
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!