3D Console Game interface

  • (6 Pages)
  • +
  • « First
  • 4
  • 5
  • 6

85 Replies - 2467 Views - Last Post: 02 June 2017 - 02:18 PM

#76 s23bog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 79
  • Joined: 02-May 17

Re: 3D Console Game interface

Posted 17 May 2017 - 06:44 AM

@modi123_1
Take a look at this output and tell me what you think. The "files" along which the pawns move are the same color. In other words, a pawn on red will move along red until it promotes, unless it captures, in which case it would move over to the green "file".

The colors change according to whose turn it is. In the first picture, playerZ (Zulu) is to move. In the second, Yankee is to move, and in the third, Xray is to move.

After selecting from the first axis (the axis of the player to move), the colors will shift to the next axis, and the player will select from that axis. Then, the colors shift again, and the player will select from the last axis. If the selected space is one of the player's pieces, then the player will be informed as to the piece type and its possible moves.

I am thinking of leaving the pieces like they are. Essentially, it is like having non-uniformed pieces. Players will have to pay attention to figure out what is what.

For the object of the game, I am thinking that the typical "checkmate" your opponent objective is out. The objective for this game is to get one's king to the center of the playing space (dkr) without being checkmated, or having your king captured.
Was This Post Helpful? 0
  • +
  • -

#77 s23bog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 79
  • Joined: 02-May 17

Re: 3D Console Game interface

Posted 17 May 2017 - 10:29 AM

Here is a quick snapshot of how things will look for the selection of the second and third coordinates.
Was This Post Helpful? 0
  • +
  • -

#78 s23bog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 79
  • Joined: 02-May 17

Re: 3D Console Game interface

Posted 18 May 2017 - 06:48 AM

Keeps saying that I am not allowed to use "that image extension on this board". Is there something that can be done so that I can post images?

Are you beginning to see the cube?
Was This Post Helpful? 0
  • +
  • -

#79 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13401
  • View blog
  • Posts: 53,498
  • Joined: 12-June 08

Re: 3D Console Game interface

Posted 18 May 2017 - 07:02 AM

If you are using a link then you need a valid image extension. .jpg, .png, .gif, etc..
Was This Post Helpful? 0
  • +
  • -

#80 s23bog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 79
  • Joined: 02-May 17

Re: 3D Console Game interface

Posted 18 May 2017 - 09:41 AM

file:///home/scott/Pictures/777chess.png

Posted with the img tag. The url from Google doesn't have the extension.

This post has been edited by s23bog: 18 May 2017 - 09:44 AM

Was This Post Helpful? 0
  • +
  • -

#81 s23bog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 79
  • Joined: 02-May 17

Re: 3D Console Game interface

Posted 18 May 2017 - 09:56 AM

Posted Image

Piece selection and move indication no longer works. I hacked the code all to hell, and am stuck in idle.

Hopefully, you can see a little better how the pawns move. If you look at the bottom left hand pieces of each image, the files along which the pawns move are the same color.
Was This Post Helpful? 0
  • +
  • -

#82 s23bog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 79
  • Joined: 02-May 17

Re: 3D Console Game interface

Posted 18 May 2017 - 12:11 PM

Here is a snippet of code that I am having trouble with. I hope you can see what I am trying to do here. Here is a link to the current source file I am working on, and you can see it in context a bit better.
bool verifyMove (int z, int y, int x) { 
    if (!inBounds (z, y, x)) return false;
    zyx 
    cell *target;
 /*   if ((*target.type) == 0) { //no piece
            moveList.push_back(target);
        } else {  //there is a piece
                    if ((Agent ) != (playingSpace [z] [y] [x].owner)) {
                        moveList.push_back(z * 100 + y * 10 + x);
                    };
                    return false; //encountered a piece, stop looking in this direction
                };

	    moveList.push_back(z * 100 + y * 10 + x);
			moveList.push_back(z * 100 + y * 10 + x);
		    return false; //encountered a piece, stop looking in this direction
*/
}

int calcMoves(int z, int y, int x) {
    moveList.clear();
    vector <zyx> *sourceMoves = playingSpace [z] [y] [x].moves;
    switch (playingSpace [z] [y] [x].type) {
	case 1: {   //king
		    verifyMove (z - 1, y - 1, x - 1);
		    verifyMove (z - 1, y - 1, x + 1);
		    verifyMove (z - 1, y    , x    );
.....




As you can see, it is all hacked up, and I am trying to figure out what data types to use, and how to use them. I converted my main array to an array of structs that includes a vector of structs that contain coordinates.
calcMoves() sends coordinates to verifyMove(), and several checks are to be done to verify if it is a valid move. If it is valid, then it will push_back onto a pointer to the vector move within the cell struct for the source coordinates.

PS I would appreciate any comments written directly to the source file, if you would prefer to do it that way. It is publicly editable.
Was This Post Helpful? 0
  • +
  • -

#83 s23bog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 79
  • Joined: 02-May 17

Re: 3D Console Game interface

Posted 20 May 2017 - 08:44 AM

Posted Image
Was This Post Helpful? 0
  • +
  • -

#84 s23bog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 79
  • Joined: 02-May 17

Re: 3D Console Game interface

Posted 20 May 2017 - 03:22 PM

Posted Image
Posted Image
Posted Image
Was This Post Helpful? 0
  • +
  • -

#85 s23bog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 79
  • Joined: 02-May 17

Re: 3D Console Game interface

Posted 28 May 2017 - 12:28 PM

I have 48 different views expressed by the following cases in a switch statement. They are all unique and represent different viewing angles of the cube. There are 16 with the red players pieces grouped together, 16 with the green pieces grouped together, and 16 with the blue pieces grouped together. In each of the groupings, there a 4 with the grouping to the top, 4 with the grouping to the right, 4 with the grouping to the left, and 4 with the grouping to the bottom. I have reorganized the cases so that the 16 for each player are together. First the 4 for the top, then for the 4 for the right, then left, then bottom.

Any ideas?

			case  1: z = index3; y = 6-index2; x = index1; break;
			case  2: z = 6-index3; y = 6-index2; x = index1; break;
			case  3: z = index3; y = 6-index1; x = index2; break;
			case  4: z = 6-index3; y = 6-index1; x = index2; break;
			case  5: z = index3; y = 6-index2; x = 6-index1; break;
			case  6: z = 6-index3; y = 6-index2; x = 6-index1; break;
			case  7: z = index3; y = index1; x = index2; break;
			case  8: z = 6-index3; y = index1; x = index2; break;
			case  9: z = index3; y = index2; x = index1; break;
			case 10: z = 6-index3; y = index2; x = index1; break;
			case 11: z = index3; y = 6-index1; x = 6-index2; break;
			case 12: z = 6-index3; y = 6-index1; x = 6-index2; break;
			case 13: z = index3; y = index2; x = 6-index1; break;
			case 14: z = 6-index3; y = index2; x = 6-index1; break;
			case 15: z = index3; y = index1; x = 6-index2; break;
			case 16: z = 6-index3; y = index1; x = 6-index2; break;
			case 17: z = 6-index2; y = index3; x = 6-index1; break;
			case 18: z = 6-index2; y = 6-index3; x = 6-index1; break;
			case 19: z = 6-index1; y = index3; x = 6-index2; break;
			case 20: z = 6-index1; y = 6-index3; x = 6-index2; break;
			case 21: z = 6-index2; y = index3; x = index1; break;
			case 22: z = 6-index2; y = 6-index3; x = index1; break;
			case 23: z = index1; y = index3; x = 6-index2; break;
			case 24: z = index1; y = 6-index3; x = 6-index2; break;
			case 25: z = index2; y = index3; x = 6-index1; break;
			case 26: z = index2; y = 6-index3; x = 6-index1; break;
			case 27: z = 6-index1; y = index3; x = index2; break;
			case 28: z = 6-index1; y = 6-index3; x = index2; break;
			case 29: z = index2; y = index3; x = index1; break;
			case 30: z = index2; y = 6-index3; x = index1; break;
			case 31: z = index1; y = index3; x = index2; break;
			case 32: z = index1; y = 6-index3; x = index2; break;
			case 33: z = index1; y = index2; x = index3; break; 
			case 34: z = index1; y = index2; x = 6-index3; break;
			case 35: z = index2; y = index1; x = index3; break;
			case 36: z = index2; y = index1; x = 6-index3; break;
			case 37: z = 6-index1; y = index2; x = index3; break; 
			case 38: z = 6-index1; y = index2; x = 6-index3; break;
			case 39: z = index2; y = 6-index1; x = index3; break;
			case 40: z = index2; y = 6-index1; x = 6-index3; break;
			case 41: z = index1; y = 6-index2; x = index3; break; 
			case 42: z = index1; y = 6-index2; x = 6-index3; break;
			case 43: z = 6-index2; y = index1; x = index3; break;
			case 44: z = 6-index2; y = index1; x = 6-index3; break;
			case 45: z = 6-index1; y = 6-index2; x = index3; break;  
			case 46: z = 6-index1; y = 6-index2; x = 6-index3; break;
			case 47: z = 6-index2; y = 6-index1; x = index3; break;
			case 48: z = 6-index2; y = 6-index1; x = 6-index3; break;


Was This Post Helpful? 0
  • +
  • -

#86 s23bog  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 79
  • Joined: 02-May 17

Re: 3D Console Game interface

Posted 02 June 2017 - 02:18 PM

Current output showing the 17th (out of 48) rotation of the cube, and the seventh plane of each axis highlighted. The space "gnu" is selected.
Posted Image

Those planes that are lit up also show how pawns would move. The blue pawns stay with the blue axis, the red pawns with the red axis, and the green with the green.

This post has been edited by s23bog: 02 June 2017 - 04:32 PM

Was This Post Helpful? 0
  • +
  • -

  • (6 Pages)
  • +
  • « First
  • 4
  • 5
  • 6