Projects that have specifically been abandoned or considered "dead" get moved here, so people will quit bumping them. If your project has wound up here and it should not be, contact a moderator to have it moved back to the land of the living.

Imagine, if you will... A dice game, built in ZDoom, an FPS engine.

It's called Ten Thousand. Or at least, that's what I know it to be called. It may have other names in other places... There are many variations, but the way I know it is this:

You roll 6 dice, up to 3 times. You can end your turn after any roll if you choose. The idea is to be the first player to get 10,000 points. You cannot go beyond 10,000 and your score must be exact to win. So if you have 9000, and you score 1500 points, you cannot have it because it would put you over 10,000 points.

UPDATE:

So I decided to go back to this and improve it since I was bored recently. I've cleaned up a lot of the code and changed a few things to make it easier for me to add later enhancements. But I'm having an issue with this project and I don't know why it's not working. It has keybinds that are set to puke certain scripts. The KEYCONF lump is correctly set up per the wiki on this, and all the relevent scripts for MAP01 have the net keyword, yet when I test this in multiplayer with my brother, it pops up with a message saying "Player tried to puke script X" which is usually the message displayed when they try to puke a script that does not have the net keyword.

Can anyone take a look at it? I've tried everything I can think of and I have no clue why it won't work...

Official release! Version 1.1 Get it here! <-- The latest official version. Has Notes, and in-game How To Play. Get this one.

In the official release, the notes documents are within the PWAD. These should be read over to ensure people know the rules, how to play, and other useful info. Also, make sure to check the key bindings to ensure that the proper commands are set up.

5 5 5 = 500 points* *(note: one 5 = 50, two 5s = 100, but three 5s = 500, for three of a kind.)

6 6 6 = 600 points

four of a kind = 1000 points (ex: 1 1 1 1, 4 4 4 4) five of a kind = 2000 points (ex: 2 2 2 2 2, 6 6 6 6 6) six of a kind = 3000 points (ex: 5 5 5 5 5 5, 3 3 3 3 3 3) straight 1-6 = 1500 points (ex: 1 2 3 4 5 6) three pairs = 1500 points (ex: 3 3 1 1 6 6, 4 4 2 2 1 1) two triplets = 2500 points (ex: 3 3 3 5 5 5, 1 1 1 6 6 6)

Some other rules: 1. Each player must score a minimum of 500 points in order to "get on board". They will gain no points until they have satisfied this rule. 2. Players must accept all possible points they stop with. (ex: On a player's final roll this turn, they have 5 5 5 3 2 1. This would be worth 600 points total, 5 5 5 = 500, + 1 = 100. If they are at a point in the game where they can only have 500 to reach 10,000, they cannot take this score because they must take the full 600, and that would put them over.)

(There may be others added to this list in time, but at this moment I cannot remember them)

This supports up to 8 players, most likely multiplayer only because at this time, I have no interest in attempting to create adequate AI for this game. Maybe later...

Any comments, questions, or suggestions are welcome.

Last edited by Slasher on Sun Nov 14, 2010 9:54 pm, edited 15 times in total.

Thanks. It's a fairly simple game, it only requires 6 dice and a few players. I find it really fun, so I decided to see if I could make it into a ZDoom project, just to see if it was possible. Looks good so far.

The Components: 1. Build an interface that all players can view at the same time, and yet only one player can manipulate at a time. (Working well, AFAICT)

2. Building a system that monitors the current player's selections, rolls, etc... (This is what I'm currently working on.)

3. A scoring system sophisticated enough to recognize how much players need to win, maximum they can have without going over, what the current dice roll is worth... maybe even a suggestion & advice system.

4. A system for ending player's turns and starting the next player's turn.

5. Everything else...(adding sound effects and aesthetic niceties)

6. Extra stuff. (Anything I want to add, just to really spice it up. Random fun stuff to remind you that you're not just playing a dice game, you're playing a unique ZDoom project.)

Now I'm working on the scoring system...this is going to be tough... I think. I'm using an array called dice[] which represents the 6 values of the dice. My guess is that it's going to require a considerable amount of for loops, checking for all possible outcomes. For example, when checking for a straight (1-6), I have to consider that it could be in any order. Not completely sure how to do that at the moment, but I'm working on it. If anyone knows some useful tips and tricks for getting that done quickly and easily, I'd appreciate it. And you'll be credited.

Damn, this scoring system is very complicated. I think it should be working, but it's not updating my score. The problem may be the score display, though.

Here's the old, nasty confusing code. I don't recommend you look at this, unless you're into self-torture...

Script 9 (void) { Print(s:"Determining your score."); int i=0; int j=0; int x=1;

for(x=1;x < 7;x++) //checks for each possible dice value { for(i=0;i<6;i++) //checks for each dice { if(dice[i]==x) //checks if each dice is equal to certain number { equal_amount[i]++; //if current dice is equal to current number, adds 1, determining amount of dice = certain number } Delay(1); } Delay(1); } Print(s:"Got this far 1"); j=0; int y; int z;

for(j=0;j<6;j++) //checks each amount of dice equal to each number { if(equal_amount[j]==6) //if amount of (dice = certain number) = this many, set score. { score[current_turn]=3000; } else if(equal_amount[j]==5) { if(j != 0) //if (5 of a kind) is not 1s, check for extra 1 { i=0; for(i=0;i<6;i++) //switch through the dice { if(dice[i]==1) //are any dice = 1? { score[current_turn]=2100; } Delay(1); } } else if(j != 4) //if (5 of a kind) is not 5s, check for extra 5 { i=0; for(i=0;i<6;i++) //switch through the dice { if(dice[i]==5) //are any dice = 5? { score[current_turn]=2050; } Delay(1); } } else //no extra 1s or 5s { score[current_turn]=2000; } } else if(equal_amount[j]==4) { if(j != 0 && j != 4) //if (4 of a kind) is not 1s or 5s, check for extra 1s or 5s { i=0; y=0; for(i=0;i<6;i++) //switch through the dice { if(dice[i]==1) //are any dice = 1? { y++; //how many? 1 or 2... } Delay(1); }

i=0; z=0; for(i=0;i<6;i++) //switch through the dice { if(dice[i]==5) //are any dice = 5? { z++; //how many? 1 or 2... } Delay(1); } score[current_turn]=1000+(100*y)+(50*z); } else if(j != 0) //if (4 of a kind) is not 1s, check for extra 1s { i=0; y=0; for(i=0;i<6;i++) //switch through the dice { if(dice[i]==1) //are any dice = 1? { y++; //how many? 1 or 2... } Delay(1); } score[current_turn]=1000+(100*y); } else if(j != 4) //if (4 of a kind) is not 5s, check for extra 5s { i=0; y=0; for(i=0;i<6;i++) //switch through the dice { if(dice[i]==5) //are any dice = 5? { y++; //how many? 1 or 2... } Delay(1); } score[current_turn]=1000+(50*y); } else //no extra 1s or 5s { score[current_turn]=1000; } } else if(equal_amount[j]==3) { int flag=0; i=0; for(i=0;i<6;i++) { if(equal_amount[j]==equal_amount[i] && j != i) { score[current_turn]=2500; flag=1; } Delay(1); }

if(flag != 1) { if(j != 0 && j != 4) //if (3 of a kind) is not 1s or 5s, check for 1s and 5s { i=0; y=0; for(i=0;i<6;i++) //switch through the dice { if(dice[i]==1) //are any dice = 1? { y++; //how many? 1 or 2... if 3, we screwed up above... } Delay(1); }

i=0; z=0; for(i=0;i<6;i++) //switch through the dice { if(dice[i]==5) //are any dice = 5? { z++; //how many? 1 or 2... if 3, we screwed up above... } Delay(1); } score[current_turn]=((j+1)*100)+(100*y)+(50*z); } if(j != 0) //if (3 of a kind) is not 1s, check for 1s { i=0; y=0; for(i=0;i<6;i++) //switch through the dice { if(dice[i]==1) //are any dice = 1? { y++; //how many? 1 or 2... if 3, we screwed up above... } Delay(1); } score[current_turn]=((j+1)*100)+(100*y); } if(j==0) //if (3 of a kind) is 1s, check for 5s { i=0; y=0; for(i=0;i<6;i++) //switch through the dice { if(dice[i]==5) //are any dice = 5? { y++; //how many? 1 or 2... if 3, we screwed up above... } Delay(1); } score[current_turn]=300+(50*y); } else { score[current_turn]=100*(j+1); } } } } Print(s:"Got to the end"); }

Ok, here is the newer, more simple and efficient code (not quite complete yet, still working on it)

Script 9 (void) { Print(s:"Determining your score."); int i=0; int j=0; int x=1;

i=0; for(i=0;i<6;i++) { equal_amount[i]=0; }

i=0; for(i=0;i<6;i++) { Print(d:dice[i]); }

i=0; for(x=1;x < 7;x++) //checks for each possible dice value { i=0; for(i=0;i<6;i++) //checks for each dice { if(dice[i]==x) //checks if each dice is equal to certain number { equal_amount[j]++; //if current dice is equal to current number, adds 1, determining amount of dice = certain number } Delay(1); } j++; Delay(1); } Print(s:"Got this far 1");

for(j=0;j<6;j++) //checks each amount of dice equal to each number { if(equal_amount[j]==6) //if amount of (dice = certain number) = this many, set score. { GiveActorInventory(900+current_turn,"Points",3000); //score[current_turn]=3000; ACS_Terminate(9,1); //scoreflag=1; } else if(equal_amount[j]==5) { if(j != 0) //if (5 of a kind) is not 1s, check for extra 1 { GiveActorInventory(900+current_turn,"Points",2000+(100*equal_amount[0])); ACS_Terminate(9,1); } else if(j != 4) //if (5 of a kind) is not 5s, check for extra 5 { GiveActorInventory(900+current_turn,"Points",2000+(100*equal_amount[4])); ACS_Terminate(9,1); } else //no extra 1s or 5s { GiveActorInventory(900+current_turn,"Points",2000); ACS_Terminate(9,1); } } else if(equal_amount[j]==4) { if(j != 0 && j != 4) //if (4 of a kind) is not 1s or 5s, check for extra 1s or 5s { GiveActorInventory(900+current_turn,"Points",1000+(100*equal_amount[0])+(50*equal_amount[4])); ACS_Terminate(9,1); } else if(j != 0) //if (4 of a kind) is not 1s, check for extra 1s { GiveActorInventory(900+current_turn,"Points",1000+(100*equal_amount[0])); ACS_Terminate(9,1); } else if(j != 4) //if (4 of a kind) is not 5s, check for extra 5s { GiveActorInventory(900+current_turn,"Points",1000+(50*equal_amount[4])); ACS_Terminate(9,1); } else //no extra 1s or 5s { GiveActorInventory(900+current_turn,"Points",1000); ACS_Terminate(9,1); } } else if(equal_amount[j]==3) { int flag=0; i=0; for(i=0;i<6;i++) { if(equal_amount[j]==equal_amount[i] && j != i) { GiveActorInventory(900+current_turn,"Points",2500); //score[current_turn]=2500; ACS_Terminate(9,1); flag=1; } Delay(1); }

if(flag != 1) { if(j != 0 && j != 4) //if (3 of a kind) is not 1s or 5s, check for 1s and 5s { GiveActorInventory(900+current_turn,"Points",((j+1)*100)+(100*equal_amount[0])+(50*equal_amount[4])); ACS_Terminate(9,1); } else if(j != 0) //if (3 of a kind) is not 1s, check for 1s { GiveActorInventory(900+current_turn,"Points",((j+1)*100)+(100*equal_amount[0])); ACS_Terminate(9,1); } else if(j==0) //if (3 of a kind) is 1s, check for 5s { GiveActorInventory(900+current_turn,"Points",300+(50*equal_amount[4])); ACS_Terminate(9,1); } else { GiveActorInventory(900+current_turn,"Points",100*(j+1)); ACS_Terminate(9,1); } } } } Print(s:"Got to the end"); }

Last edited by Slasher on Sun Jun 08, 2008 3:32 am, edited 1 time in total.

hnsolo77 wrote:bah i was oversimplifying it, but as for your code...

i have a headache trying to figure out what it all does..., we need hotwax here stat

Actually, it's no longer going to be as complicated as all that, I found a much cleaner and simpler way to achieve the same goals. Consider that above code deprecated.

My new method often turns 5 or 6 of those lines above into 1 line... Which is much easier to read and understand.

1. The scoring system is complete. A few things may have slipped by, and when I release this for testing, if anyone would let me know of such errors, I'll look into it.

2. The game is playable by 1 player, as I've tested. (It's not very fun that way, though.) I will begin multiplayer testing next.

3. After that will be the sound effects and such, as well as other minor details.

hnsolo77 wrote:yeah im going to have to try this once you have a beta ready

I'm going to release for beta testing right after components 1 - 4 are complete. Since 3 of those and half of the 4th is complete, it shouldn't be too long. Maybe even some time today if I'm lucky.