Author Topic: Blackjack  (Read 32394 times)

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Blackjack
« Reply #120 on: June 22, 2020, 09:55:55 am »
@johnno56

I will check out your sounds and assimilate :)

You probably can't hear the jokes from robot voice (Windows only) but check out the jokes.

This is the Dealer (a combination of Steven Wright, Henny Youngman and Pete) who would get tips even from players who lose (well I might be tempted anyway with fake money). Might as well get entertained a little while emptying your fake wallet :)

This is fun to review every 6 months or so:
* Hen Pecked.zip (Filesize: 5.18 KB, Downloads: 105)
« Last Edit: June 22, 2020, 10:01:03 am by bplus »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Blackjack
« Reply #121 on: June 22, 2020, 10:13:59 am »
@johnno56 ambiance 100% better! Thanks and those sound wavs are OK. I picked up a trick when writing text for jokes NOT to spell, punctuate, and space words and letters as you would in a book report to English teacher, it's more like writing lyrics to song, break words up space them out add or change letters for it to sound correctly when spoken and heard.

It is nice idea to have several different phrases for common things Dealer has to communicate.

I wonder if the Dealer might read the Help Screen for first time players or hyperlink snatches of it for regular players who want a refresher say on the special Blackjack or Terms... do it in cartoon bubbles with point going up as if coming from Dealer, I'm thinking in the center of screen over the Logo section. What would a robot version of a cartoon bubble look like?
« Last Edit: June 22, 2020, 10:21:23 am by bplus »

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Blackjack
« Reply #122 on: June 22, 2020, 08:09:48 pm »
Ok. For starters... You are correct. I cannot use your program to 'read' the jokes. SAPI seems to be part of the Windows speech utility. I could run it through 'Wine' but it will crash because of sapi... Oh. Well... The thought was there...

This TTS can be quite addictive... Although today's computers are more powerful, we will still have to be conscious of the fact that, the program may become 'bloated' with sound files... lol

With that being said... My TTS program (by the way... I have added a slightly better 'voice'. I will attach two samples.) can read text files and convert them to 'wav' files. For the 'help', I would convert the 'wav' to 'ogg', to reduce the file size. Other 'help' snippets can probably remain as 'wav'.

Cartoon bubble you say... Hmm... My suggestion would be and '8 bit' look... I will attach a large version as an example. Ideally, a subroutine would be needed to create a bubble to fit the text... I suppose similar to creating 'buttons with different lengths of text....

I will look up some dealer 'comments' and convert them to audio. Could be fun.
* welcome-old.wav (Filesize: 167.81 KB, Downloads: 175)
* welcome-new.wav (Filesize: 107.3 KB, Downloads: 154)
welcome.png
* welcome.png (Filesize: 1.43 KB, Dimensions: 291x229, Views: 166)
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Blackjack
« Reply #123 on: June 22, 2020, 09:46:52 pm »
Thanks Johnno, might be able to draw bubbles like yours shown to the size of text. I was thinking something modern like gases coalescing into text ;-))

Oh I like new welcome.wav, e's got a formal Britash accent about em.
« Last Edit: June 22, 2020, 10:08:14 pm by bplus »

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Blackjack
« Reply #124 on: June 22, 2020, 10:52:14 pm »
'Gases' sounds pretty cool... Can you find an image that looks like your 'gases' bubbles? Post it (them) and I will see if Gimp can do a reproduction...

Yeah... I added the 'mbrola en1' voice... British it is... the US voices were more like English with some other accent thrown in for good measure... lol  I will check out some more voices... At the moment, the British voice, seems to be the better one... I'll keep looking.
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Blackjack
« Reply #125 on: June 22, 2020, 11:01:58 pm »
The gases coalescing thing was my imagination running wild and it would probably not be a still shot image but code.

Oh maybe like this:
https://www.shutterstock.com/image-illustration/glow-swirl-light-effect-circular-lens-525106498

Try different voices reading the jokes. Might have different players sitting next to you telling them.
« Last Edit: June 22, 2020, 11:08:30 pm by bplus »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Blackjack
« Reply #126 on: June 22, 2020, 11:28:59 pm »
Maybe something like this:
Code: QB64: [Select]
  1. _TITLE "Random light line" 'b+ 2020-01-28 mod 2020-06-22
  2.  
  3. CONST xmax = 1200, ymax = 700
  4. SCREEN _NEWIMAGE(xmax, ymax, 32)
  5. REDIM SHARED x, y, dx, dy, a, da, d, dd, i
  6. resetWand
  7. WHILE _KEYDOWN(27) = 0
  8.     LINE (0, 0)-(xmax, ymax), &H01030003, BF
  9.     IF INKEY$ = " " THEN CLS: resetWand
  10.     wandsi x, y, a, d, 0, i
  11.     x = x + dx
  12.     IF x < 0 THEN x = 10: dx = -dx
  13.     IF x > xmax THEN x = xmax - 10: dx = -dx
  14.     y = y + dy
  15.     IF y < 0 THEN y = 10: dy = -dy
  16.     IF y > ymax THEN y = ymax - 10: dy = -dy
  17.     a = a + da
  18.     d = d + dd
  19.     IF d < 20 THEN d = 20: dd = -dd
  20.     IF d > 200 THEN d = 200: dd = -dd
  21.     i = i + 1
  22.     _DISPLAY
  23.     '_LIMIT 200
  24.  
  25. SUB resetWand
  26.     wandsi 0, 0, 0, 0, 1, 0 'this sets a coloring for wand  used in drawing the pointer inside the mouse
  27.     x = RND * xmax: y = RND * ymax: dx = RND * 2 - 1: dy = RND * 2 - 1: a = RND * _PI(2): da = _PI(2 / 720): d = 50 + RND * 50: dd = RND * 2 - 1
  28.  
  29. 'draw a colorful line from point x, y, at radianAngle for a distance and use new <> 0 to reset colors
  30. SUB wandsi (x1 AS SINGLE, y1 AS SINGLE, radianAngle AS SINGLE, distance AS SINGLE, new AS INTEGER, startIdx AS INTEGER)
  31.     STATIC r AS SINGLE, g AS SINGLE, b AS SINGLE 'hold present color settings until
  32.     IF new <> 0 THEN r = RND * RND * .5: g = RND * RND * .5: b = RND * RND * .5 'new is true
  33.     DIM dx AS SINGLE, dy AS SINGLE, i AS INTEGER, x AS SINGLE, y AS SINGLE
  34.     dx = COS(radianAngle): dy = SIN(radianAngle)
  35.     FOR i = 0 TO distance
  36.         x = x1 + i * dx: y = y1 + i * dy
  37.         LINE (x, y)-STEP(0, 0), _RGB32(127 + 127 * SIN(r * (i + startIdx)), 127 + 127 * SIN(g * (i + startIdx)), 127 + 127 * SIN(b * (i + startIdx)), 50), BF
  38.     NEXT
  39.  
  40.  
  41.  

Random light lines.PNG
* Random light lines.PNG (Filesize: 1.21 MB, Dimensions: 1202x726, Views: 168)
« Last Edit: June 22, 2020, 11:33:58 pm by bplus »

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Blackjack
« Reply #127 on: June 23, 2020, 02:29:10 am »
"Glow swirl light effect. Circular lens flare. Abstract rotational lines. Power energy element. Luminous sci-fi. Shining neon lights cosmic abstract frame. Magic round frame. Swirl trail effect" is quite a mouthful of a description.... My Gimp skills are not up to that level yet... But it is quite good... I would definitely be interested in a tutorial that could produce such an effect....

"Different voices" sounds like a great idea... but I'm not sure if people will be able to cope with 2+ other "robots" having conversations.... lol  So far, the voices that I have found, are all fairly similar...

The TTS that I am using is call 'espeak' and will run on Linux, Mac, Risc an Windows (requires SAPI5) and is free. (http://espeak.sourceforge.net/download.html)  On my system I can run espeak from the command line or through a GTK gui call Gespeaker. Gespeaker will require python2.7  The sound is not pretty (as you have heard) but can be fun to tinker with...

Your 'Random Light Line' reminds me of the old Win95/98 'Mystify' screen save... but better looking ;)
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Blackjack
« Reply #128 on: June 23, 2020, 02:13:12 pm »
Quote
Your 'Random Light Line' reminds me of the old Win95/98 'Mystify' screen save... but better looking ;)

I forgot to mention how applying alpha to the drawing killed the heck out of the speed.

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Blackjack
« Reply #129 on: June 23, 2020, 04:05:54 pm »
Curious. How does "step" work in line 42? I don't normally come across the use of 'step' in a 'line' command. How could this be re-coded to produce the same effect without the use of 'step'?

LINE (x, y)-STEP(0, 0), _RGB32(127 + 127 * SIN(r * (i + startIdx)), 127 + 127 * SIN(g * (i + startIdx)), 127 + 127 * SIN(b * (i + startIdx)), 50), BF
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Blackjack
« Reply #130 on: June 23, 2020, 04:16:32 pm »
STEP means from last graphic coordinate used STEP(step x, step y)

so (100,100)-STEP(25, -50) = (100, 100)-(125, 50)

In the line you show the STEP(0,0) is effectively just drawing points like PSET. I think it was Steve who said LINE was optimized for that compared to PSET.
« Last Edit: June 23, 2020, 04:19:58 pm by bplus »

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Blackjack
« Reply #131 on: June 23, 2020, 05:42:31 pm »
So... Step draws a line 'relative' to the origin point of the first two parameters? Cool...
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Blackjack
« Reply #132 on: June 23, 2020, 07:14:31 pm »
Yes relative and yes cool, you don't have to add the step size to x and the step size to y... to get the Absolute coordinates at the endpoint of a line, let the code do the math ;-)

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Blackjack
« Reply #133 on: June 28, 2020, 06:00:34 am »
@johnno56

How are the sound files for English accented dealer coming? Maybe forget the jokes??


I guess I better get back to the coalescing text bubble maker, myself.

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Blackjack
« Reply #134 on: June 28, 2020, 08:13:59 am »
I still haven't found a better voice for my TTS. We may have to use the 'English' voice or do it 'old school' and just use 'bubbles'. I'll keep looking...
Logic is the beginning of wisdom.