Announcement

Collapse
No announcement yet.

PBcards..

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PBcards..

    Got bored, so wrote a little Patience card game tonight. Tested some
    of the freeware DLL's available, like QCARD.DLL, etc, but didn't like
    their size, among other things, so did it my way instead.

    Used RLE compressed bitmaps for the cards/card backs in resource. Works
    fine in Win95/98, but have heard of trouble in NT. So, before I post the
    code for this one, I have zipped up the exe only, and was wondering if
    someone with NT/Win2000 could download and test it? Anyone is of course
    welcome to download and test, but mostly intrerested in how/if it works
    in NT/2K.

    Address: http://www.tolken99.com/pb/pbcards.zip (45 KB)

    Using RLE instead of BMP in resource took down size from 240 to 130KB,
    this being total, stand-alone program size. Do I love PB..?

    The game is simple, just click on matching pairs to place them in discard
    pile and fill up board by clicking on deck. Think this patience goes under
    the name "the idiot", which sort of feels very suitable in my case..

    Options dialog included, where you can change card backs and a few other
    things. Setting are stored in ini file, in program's folder. No "Las Vegas"
    mode implemented yet, but will add some clever point system to it later on.
    This is first, crappy attempt to write a card game. So much fun to do it,
    I'll probably write many more in a near future..


    ------------------

  • #2
    Looks good and works on Win98 SE.
    I for one, have reported troubles with RLE bitmaps in these forums.
    The bad news is that it only happens on a few NT's
    So a single test on NT does not mean that RLE is okay.
    Example:
    One old NT with no service packs was OK.
    A newer with service packs (don't remember number) failed.

    To be sure, I would store the data in my own compressed format.

    ------------------
    Best Regards
    Peter Scheutz

    [This message has been edited by Peter Scheutz (edited August 11, 2001).]
    Best Regards
    Peter Scheutz

    Comment


    • #3
      Borje --

      It works fine on my NT4 and 2000 systems.

      As I recall, Windows 95 and certain Service Packs of Windows NT have problems with Run Length Encoded bitmaps. If they are not already, those cards would look good as 16-color bitmaps, which would probably result in smaller files than using RLE. In fact most of the black cards could be monochrome bitmaps. They'd be tiny!

      -- Eric

      ------------------
      Perfect Sync Development Tools
      Perfect Sync Web Site
      Contact Us: mailto:[email protected][email protected]</A>

      [This message has been edited by Eric Pearson (edited August 11, 2001).]
      "Not my circus, not my monkeys."

      Comment


      • #4
        Works fine on Win2K and NT4/SP6 for me. Is it actually winnable? Best score with just a few tries was 13 pairs remaining.

        ------------------
        Lance
        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        Lance
        mailto:[email protected]

        Comment


        • #5
          hi Borje, works on my Win 2K sp2 pro machine.
          Could the screen be maximisable for the end of game show since it's not as impressive in a small window !

          Adrian

          ------------------

          Comment


          • #6
            Thanks for testing, fellows. Hm yes, it is winnable, alright. Looks
            easy from start but..

            They actually are 16-color bitmaps saved them as "Windows RLE", which
            cut total size from 187 to 92 KB. RLE encoding works best on large,
            empty areas, so card faces shrunk most. Had idea of building cards
            via small "symbol-only" bitmaps instead, but got lazy. Small enough
            as it is.

            I used a custom control as cards. Will experiment a bit and try another
            approach. Like I said, most 3-party DLL's use memDC's instead, which
            makes click-detect a bit harder to code, but drag&drop easier/faster.
            Will post code when I'm done experimenting.

            BTW, there's a "developer's cheat" built-in to it. Press Ctrl+Shift
            and click on New game button to start bouncing cards procedure. That
            one was last thing I did, so enabled easy test of code. Just playing
            around, and imitated MS Solitaire's bonus screen in lack of own idea.
            Will come up with something else later on.


            ------------------

            Comment


            • #7
              Borje --

              If you want to send the raw bitmaps to [email protected] I will convert the black non-face cards to 1-bit bitmaps for you.

              -- Eric


              ------------------
              Perfect Sync Development Tools
              Perfect Sync Web Site
              Contact Us: mailto:[email protected][email protected]</A>
              "Not my circus, not my monkeys."

              Comment


              • #8
                Worked/looked fine on my NT4 box Borje! Btw, that exe compressed down to a ridiculously small 43008 bytes with UPX
                I can't believe you just "got bored" and pulled that out, it'd take me light years


                ------------------
                -

                Comment


                • #9
                  Borje -

                  Nice, clean and nimble! Tested on 5 machines that happened to be up:

                  - Win2K/SP2: Played one game all the way to end of deck: a win
                  - NT4/SP6a: Played one game through half of deck: an EASY win
                  - Win95/OSR2: Played three games, blocked early on: NO wins
                  - Win98: Played three games, blocked early on: NO wins
                  - Win95/OSR2: Played three games, blocked early on: NO wins

                  See the pattern? Conspiracy Theory Alert: MS paid you to make it un-winnable on 16-bit based OSs!

                  Oh, no rendering problems on any of those OS's

                  The first thing I do when setting up a new OS is strip the games out. I'm a procrastinator by trade hence cannot have games at my disposal or I'd never get anything done. So gee, thanks. I really needed this...
                  Steve

                  ------------------

                  Comment


                  • #10
                    Wayne, probably sounded better than it was - I mostly converted training
                    code I once wrote in VB3. Mostly a matter of adjusting things to PB and
                    use API instead of VB graphic routines. Think writing small games is among
                    the best schools, so I sometimes do this just to learn new tricks.

                    Eric, thanks for the offer, but for now I'll use the RLE files "as is",
                    since they seem to work fine.

                    Steve - I'm sorry. Only comfort is - I haven't got much useful done since
                    yesterday either (but I have had a lot of fun.. Will clean up and comment
                    code for source forum as soon as I can. Too bad you discovered our evil plot.
                    Bill wanted me to only make it winnable in XP, but the US supreme court told
                    me to include at least NT and Win2K in the winning teams too..


                    ------------------

                    Comment


                    • #11
                      Borje,

                      I recall reading someplace that there are a deck of cards(bitmaps) you can
                      get from the already installed DLL's someplace on 95/98 (probably 2000/NT too).
                      I'll do some digging to see where I dreamed this up...

                      Added Later...
                      http://www.mvps.org/vb/hardcore/html/dealmein.htm

                      Regards,
                      Jules



                      [This message has been edited by Jules Marchildon (edited August 11, 2001).]

                      Comment

                      Working...
                      X