GLBasic Competition: Board games

Previous topic - Next topic

ynbniar

Quote from: Ian Price on 2009-Nov-01
What game is that ynbniar? I don't recognise it from that image.

Well Ian, that's just a wee map editor I decided to write to help me create the board environment.

The game itself is from the 70s...I'll post more updates as I go...

erico

thanks all advices,

sure for computer players, AI coding will be interesting too.
The hide-card problem, which almost made me change game, was more or less solved by an idea of playing through instant messengers with some trust and similar to the real game.

Hey ynbniar,

nice screen there, I don't recognize the game either, but it is tempting! show more
I have a shoot here too, backstage visual. it's alive

[attachment deleted by admin]

erico

finally the engine is complete and the game is alive, I have doubts about the gfx and art in general, go for realistic? pixel? hints anyone? I will post a layout here of an idea... if nothing better comes by, it may have to do.

[attachment deleted by admin]

Ian Price

Wow! Looks great. What game is it though?

[EDIT] NM - Solaris, judging by your pic above.
I came. I saw. I played.

erico

Solaris or Captain Future, it will also have more colors. I would also like to try to keep the background alive too with little things happening so it gives more life as well as sound... anyway i'm in doubt this layout is ok, pixel art would also be fine...any idea references someone? next step should be AI and net play.

Redostrike

Woot that looks nice.

I really like this comp.

Maybe i do something to i have an idea, but time => not to much.

Maybe keep things simple. I'll see if i can get some coding done.

erico

yep nice comp, got me into trying glbasic.
Go ahead lay some code! I think a board game is, some of them, easy to make. Now AI seems more difficult.
What game do you have in mind redostrike?
I made another possible gfx for solaris, this one seems to be final, I'm now back into the AI.
Cheers

[attachment deleted by admin]

Redostrike

#52
I'm going for a simple YathZee game. Although checking the hold dices math is going to be a pain (i've been thinking about it for a few days now). Anyways i will figure it out if not i'm posting some help later on. This is what i got so far.

GUI does not look that great still gonna turn stuff around later i think (if i have some time).

I got a mini-mode game, and a full game planed love to get a 2 player mode also but due to time (school and stuff) i think thats going to be added after the comp.

[attachment deleted by admin]

erico

looks nice, I heard yathzee before but I don't know the rules (dices are not famous in brazil),
hey if you need some gfx for that count me in, rendering dices are fun.

I don't know what you mean by 'hold dices math' since I don't know the game rules, I will look into it and see if I can come up with any idea.

I guess what is important is for the game to be fun, keep up!
school and stuff can always wait for a little hehe, just joking

FutureCow

Quote from: Redostrike on 2009-Dec-01
I'm going for a simple YathZee game. Although checking the hold dices math is going to be a pain (i've been thinking about it for a few days now). Anyways i will figure it out if not i'm posting some help later on. This is what i got so far.

GUI does not look that great still gonna turn stuff around later i think (if i have some time).

I got a mini-mode game, and a full game planed love to get a 2 player mode also but due to time (school and stuff) i think thats going to be added after the comp.

If you're a Facebook user, have a look at the game Yacht which is their Yahtzee game. It's been done really well and may give you some ideas for layout, animations etc.

I've had a quick think about the dice combinations and I've figured out how I would do it. Feel free to yell if you'd like a hand / any suggestions.

Hatonastick

Yacht is an old dice game and it is similar in form to some other dice games (including Poker Dice and some game from Puerto Rico) although no-one really knows where it started -- it depends on where you get your information from as to where it started ie. don't rely upon Wikipedia.  Yahtzee though is essentially a commercialized variant of Yacht and currently a trademark of Hasbro.

Anyway was one of my favorite board/card/dice games as a kid.  I don't think Mousetrap counted as a board game.  Was more of a toy than anything else. :)

FutureCow

Sure Mousetrap is a board game! I'll trap anyone's mouse who tries to suggest otherwise!  >:D

Ian Price

Mousetrap is indeed a board game - without the board the game wouldn't be possible. The pieces attach to it and the mice race around it.
I came. I saw. I played.

Redostrike

#58
Quote from: FutureCow on 2009-Dec-01
I've had a quick think about the dice combinations and I've figured out how I would do it. Feel free to yell if you'd like a hand / any suggestions.

Good tip for the facebook i will check it out later, i'm still thinking about the dice combinations it's something like 5 variables that needs to be checked for a number of things. So i was thinking about for next loops/if endif loops maybe there is a better way to do it. And i also need to find out the right way to check these. Anyways 5 variables there are alot of combinations possible if every one can be 1 trough 6. And then the Yathzee one is the easiest one :).

@erico: As for the school stuff they really can't wait as this is my way to a job, intern is also coming and if i'm good enough then i'm in for a full job. The rules are easy, it's a little like poker (cards) only you roll dice, then choose a few dices to hold (as many as you want) and roll the remaining dice. The aim of the game is to get lots of points as possible. If you get a small street its auto 30 points a big one is 40 points and so forth. For the ones and two's its all diced counted togheter. And the major point getter is a yathzee (if you got it you need to yell it out loud :) ) and thats all dices on the same number. Witch will win you 50 points You get 3 rolls per turn. And you can switch your holded dices around as much as you want. Off course all those points in my game can be wathever i want it to be :).

FutureCow

#59
There's many ways you could attack the problem, my suggestion is below. Feel free to stop reading this post now if you don't want any help yet.  =D

Put the rolled values into an array (say values[0] to values[4]). Loop over the array 6 times counting how many of the dice match the current loop value (ie. count how many 1's, 2's etc you have). Store those values in a results array (lets call it a2) . Figure out what was rolled by doing
Code (glbasic) Select
for OuterLoop=0 to 5
  if a2[OuterLoop]=5
    Yahtzee=1 // you have a yahtzee
  elseif a2[OuterLoop]=4
    4OfAKind=1 // you have a 4 of a kind
  elseif a2[OuterLoop]=3
    3OfAKind=1
    for InnerLoop=0 to 5
      if a2[InnerLoop]=2
         FullHouse=1 // You have a full house
      endif
    next
  elseif a2[OuterLoop]=2
    PairCounter=PairCounter+1
  endif
next
if a2[0]=1 and a2[1]=1 ... and a2[4]=1
  SmallStraight=1
endif
if a2[1]=1 and a2[2]=1 ... and a2[5]=1
  LargeStraight=1
endif



Or, there's the very cool (well I think so :P ) but needlessly complicated and longer binary number storage method.
We have 5 dice, and for each die there are 6 values which it may be. Looking at one die we can store for each value 1-6 whether the die contains that value (=1) or doesn't (=0). I sense some binary arithmetic coming on!  :-*
Take 6 binary bits (representing the dice value of 1 to 6). For whatever value is on the die, set the corresponding binary bit to 1 and leave the rest as 0.

ie. If the dice rolled value =1 then the corresponding binary would be 000001. If dice value=4 then the binary would be 001000. Put the resulting binary values for all 5 die together.

If you had a small straight for example your 5 die's binary equivalent would be
000001  (Value on this dice is 1) 
000010  (Value rolled on this dice is 2)
000100 (3)
001000 (4)
010000 (5)
100000 (6)
Put all those binary bits together and there's 30 binary bits to represent any combination of die rolls. As GLBasic's integer is a 32bit number, you can store any combination of die as 1 integer value.

So roll your die, sort them (the important bit!!!), then store them as a 30 bit binary number.
You can now check your combinations based on the binary comparrisons
Code (glbasic) Select
if bAND(IntegerNumber,1108378656) = small straight
(where 1108378656 is the integer equivalent of the binary number shown above - ie. 000001000010000100001000010000100000)
Code (glbasic) Select
if bAND(IntegerNumber,8659464) = full house (dice rolled 2,2,2,4,4)

It's cool for the geekiness of it , but I'd only use it if you had almost no free memory and therefore had to code based on using as little memory for storage of variables as possible.  It's a pain because you'd have to check EVERY combination - ie. you'd do a bAND for a full house of 2,2,2,1,1  then another for 2,2,2,3,3  then another for 2,2,2,4,4 etc. You'd do 30 individual checks just for full house, not to mention all the other combinations of rolls you can do. There's probably a really cool combination of storing how many of each value were rolled rather than the individual values of each die which would lead to an awesome binary solution. I haven't come up with one yet though. :D

As you can see there's many different ways of solving the problem, but if nothing else hopefully this shows that just because a solution may be cool doesn't mean that you should do it  =D