Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - [Coding competition 2021] Snepzhen Solitaire by JoppyFurr

Reply to topic

Rate this entry!

1 (Terrible) 0% 0%
2 0% 0%
3 0% 0%
4 0% 0%
5 7% 7%
6 15% 15%
7 46% 46%
8 23% 23%
9 7% 7%
10 (Excellent) 0% 0%
This poll has expired.
Author Message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14793
  • Location: London
Reply with quote
[Coding competition 2021] Snepzhen Solitaire by JoppyFurr
Post Posted: Sat Mar 27, 2021 7:17 am
https://www.smspower.org/Homebrew/SnepzhenSolitaire-SMS



Quote
This is a clone of the solitaire game within Shenzhen I/O.

There are three types of card:

1. Number card - Get these up into the top-right three slots.
-> In the main playing area, numbered cards stack in alternating colours with decreasing value
-> In the top-right, numbered cards stack in the same colour with increasing value starting at '1'
-> A single card can be temporarily stored in each of the top-left three slots (if unused)

2. Dragon cards (claws, paws, & hoofs) - Get these up into the top-left three slots
-> Dragon cards cannot be placed on any other card, even another dragon card of the same kind
-> A single dragon card can be temporarily stored in each of the top-left three slots (if unused)
-> If four of a single kind are at the top of their stacks, a button can move all four into one of the top-left three slots (if a slot is free, or already contains a card of the same kind)

3. Snep card (flower card in the original game)
-> This is a 'free' card, it can be moved to the top-middle slot
-> Artwork is TODO, currently a gray 'tail'

You win when all cards have been moved to the top.

Controls:
D-pad: Move the cursor to select a different card / slot / button
Button 1 (when holding cards): Place the cards currently held.
Button 1 (when not holding cards): Pick up the cards or press the dragon button under the cursor.
Button 2 (when holding cards): Return the cards back to where they were picked up from.
Button 2 (when not holding cards): Auto-move the card under the cursor to one of the top-right slots if possible.

Work still to do:
-> Title screen
-> Card artwork improvements
-> Animation for when the game has been won
-> Options menu (change background colour, cursor design, etc)
-> Animation when moving cards with button 2 or the dragon buttons.
-> Sound effects

Changelog:
r1: Fixup for real H/W + Animation for dealing / cancelling
r0: Initial release
  View user's profile Send private message Visit poster's website
Revo
  • Guest
Reply with quote
Post Posted: Sat Mar 27, 2021 9:12 pm
 
  • Joined: 11 Mar 2018
  • Posts: 80
  • Location: New Zealand
Reply with quote
Update to r3
Post Posted: Sun Mar 28, 2021 12:11 pm
A new build, r3, of Snepzhen Solitaire is now available:

  • Card-dropping animation when the game is won
  • Cards now animate (slide) when using the dragon buttons
  • RNG fixup, to reduce the chance of being dealt the same game twice



Work still to do:
    -> Title screen
    -> Card artwork improvements
    -> Options (change background colour, cursor design, etc)
    -> Sound effects

Changelog:
    r3: Animation for winning, dragon buttons. RNG improvement.
    r2: Animation when auto-placing cards with button 2 + code tidyup
    r1: Fixup for real H/W + Animation for dealing, cancelling
    r0: Initial release



  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3893
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Mar 30, 2021 8:41 pm
Interesting solitaire... I still have to learn how to play it properly but it's a matter of time, as with all card solitaires. Nice card animations, reusing VRAM tiles for both cards on the table and for sprites is a good idea.

Question: why did you write your own SRAM access functions instead of simply using the devkitSMS provided ones? Is there anything you didn't like with those?
  View user's profile Send private message Visit poster's website
  • Joined: 11 Mar 2018
  • Posts: 80
  • Location: New Zealand
Reply with quote
Post Posted: Tue Mar 30, 2021 9:53 pm
sverx wrote

Question: why did you write your own SRAM access functions instead of simply using the devkitSMS provided ones? Is there anything you didn't like with those?


I didn't actually realize that devkitSMS already had SRAM access functions. I must have had a typo when I first went searching, as I didn't get any results. I do see them now though, and will likely switch to using them in the next update.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3893
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Mar 30, 2021 10:24 pm
JoppyFurr wrote
I didn't actually realize that devkitSMS already had SRAM access functions. [...] I do see them now though, and will likely switch to using them in the next update.


Here's the wiki section for that, and that page links to an example usage on this very forum :)
  View user's profile Send private message Visit poster's website
  • Joined: 11 Mar 2018
  • Posts: 80
  • Location: New Zealand
Reply with quote
Update to r4
Post Posted: Thu Apr 01, 2021 1:25 pm
A new build, r4, of Snepzhen Solitaire is now available:

  • When first starting, a card-based menu is now shown
  • The background colour scheme can be changed
  • The mouse cursor can be changed



Work still to do:
    -> Card artwork improvements
    -> Sound effects?

Changelog:
    r4: Menu, choice of background colours and cursors. devkitSMS SRAM access.
    r3: Animation for winning, dragon buttons. RNG improvement.
    r2: Animation when auto-placing cards with button 2 + code tidyup
    r1: Fixup for real H/W + Animation for dealing, cancelling
    r0: Initial release


snepzhen_blue.png (2.47 KB)
Screenshot - Blue background
snepzhen_blue.png
snepzhen_silver_cursor.png (2.46 KB)
Screenshot - Silver cursor
snepzhen_silver_cursor.png

  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2015
  • Posts: 67
  • Location: Japan
Reply with quote
Post Posted: Sat Apr 03, 2021 5:20 am
Works very well. I have played a few games but I have yet to win. Is it always possible to win? If not, out of 10 sessions, how many can I expect to finish?

One thing I would really like is playing it with a Megamouse! (I can share the work-in-progress input "library" I have developed for my sms-a-sketch entry if you'd like. It also supports the Sports pad and Graphics board)
  View user's profile Send private message Visit poster's website
  • Joined: 11 Mar 2018
  • Posts: 80
  • Location: New Zealand
Reply with quote
Post Posted: Sat Apr 03, 2021 10:35 am
raphnet wrote
Works very well. I have played a few games but I have yet to win. Is it always possible to win? If not, out of 10 sessions, how many can I expect to finish?

No, like regular Klondike solitaire it is not always possible to win. It can also be hard to predict when a move you make might make it impossible to win (eg, filling one of the top-left spaces with one card when finishing required the space to be saved for a different card).

I haven't kept any exact statistics, but I manage to complete around half of the games I properly start. Sometimes I'll abandon and try for a new deal before moving the first card if the start doesn't look possible.

raphnet wrote

One thing I would really like is playing it with a Megamouse! (I can share the work-in-progress input "library" I have developed for my sms-a-sketch entry if you'd like. It also supports the Sports pad and Graphics board)


While I don't think I'll find time to do that at the moment, it sounds like it could be a fun way to extend the game in the future :3
  View user's profile Send private message Visit poster's website
  • Joined: 11 Mar 2018
  • Posts: 80
  • Location: New Zealand
Reply with quote
Update to r5
Post Posted: Sat Apr 03, 2021 12:39 pm
A new build, r5, of Snepzhen Solitaire is now available:

  • Bug fix - Disable button 2 on the dragon buttons.
  • Bug fix - Exclude off-screen sprites from the sprite list.



Work still to do:
    -> Card artwork improvements
    -> Sound effects?

Changelog:
    r5: Bug fixes for sprite wrap-around and dragon buttons.
    r4: Menu, choice of background colours and cursors. devkitSMS SRAM access.
    r3: Animation for winning, dragon buttons. RNG improvement.
    r2: Animation when auto-placing cards with button 2 + code tidyup
    r1: Fixup for real H/W + Animation for dealing, cancelling
    r0: Initial release



  View user's profile Send private message Visit poster's website
  • Joined: 12 Oct 2015
  • Posts: 194
  • Location: Ireland
Reply with quote
Post Posted: Mon Apr 05, 2021 10:54 am
sverx wrote
Here's the wiki section for that, and that page links to an example usage on this very forum :)

Not sure if this helps but here is a code sample that uses the devkitSMS SRAM access functions also.
  View user's profile Send private message Visit poster's website
  • Joined: 22 Oct 2017
  • Posts: 17
Reply with quote
game gear port
Post Posted: Mon Nov 14, 2022 9:47 am
I'm trying to port this lovely piece of homebrew to gamegear
https://github.com/Strugglemeat/shenzhen-solitaire-gamegear for the code

I've reduced the card height by 16px but I want to keep them the same width, so I need to move the 'camera' around. I've set up an offsetX variable for all of the SMS_loadTileMapArea calls to be offset, but I can't get it to work properly with the left/right buttons.

if anyone wants to take a look and give me some tips, I'd be greatly appreciative!
shen-preview.png (23.16 KB)
preview image
shen-preview.png
shenzhen_solitaire.gg.zip (6.79 KB)
WIP ROM

  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3893
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Mon Nov 14, 2022 9:55 am
Wainstop wrote
I want to keep them the same width, so I need to move the 'camera' around. I've set up an offsetX variable for all of the SMS_loadTileMapArea calls to be offset, but I can't get it to work properly with the left/right buttons.


You could use the hardware scroll register, without modifying the SMS_loadTileMapArea calls at all. When you move left, scroll the BG to the right and vice versa. See SMS_setBGScrollX.
  View user's profile Send private message Visit poster's website
  • Joined: 22 Oct 2017
  • Posts: 17
Reply with quote
Post Posted: Mon Nov 14, 2022 12:53 pm
that's an awesome idea! thanks, I'll try it

edit: got it working, just need to fix the position of the cursor
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3893
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Nov 15, 2022 10:01 am
Wainstop wrote
that's an awesome idea! thanks, I'll try it

edit: got it working, just need to fix the position of the cursor


sure, of course you have to 'compensate' for the BG offset, but that's pretty easy.
  View user's profile Send private message Visit poster's website
  • Joined: 22 Oct 2017
  • Posts: 17
Reply with quote
Post Posted: Tue Nov 15, 2022 12:03 pm
thanks again for your help! here's a mostly fixed and done game gear port (attached)
shenzhen_solitaire.gg.zip (7.02 KB)
nearly finished game gear port

  View user's profile Send private message
  • Joined: 11 Mar 2018
  • Posts: 80
  • Location: New Zealand
Reply with quote
Update 23.06
Post Posted: Thu Jun 08, 2023 1:30 pm
It's been a couple of years, but I've picked this back up and have made some improvements:

* Dragon cards now flash when they are available
* More table colour scheme options
* Pixel-art snow leopard face card
* The cursor can now be moved between the foundations and tableau using dpad up/down instead of having to use left/right to wrap-around

ROM and source are included as an attachment
snepzhen_solitaire_23_06.zip (74.1 KB)
Snepzhen Solitaire, 2023-06

  View user's profile Send private message Visit poster's website
  • Joined: 11 Mar 2018
  • Posts: 80
  • Location: New Zealand
Reply with quote
Update 24.05
Post Posted: Sun May 26, 2024 10:18 am
Another round of improvements for Snepzhen Solitaire:

New features:
- Abandon the current game and deal a new game by pressing the console's reset button (soft reset)
- Settings (cursor and table colour scheme) are now saved to SRAM

Cursor navigation changes:
- Wrap-around at left and right no-longer alternates between the top/bottom of the screen
- When placing cards, the cursor no-longer jumps to the top of the stack

Bug fixes:
- Fixup the cancel animation to prevent the cursor disappearing for a frame
- Fixup the bottom corner of the card sprite thickness
- Fixup picking multiple cards from the foundation after navigating with the up key from the tableau
SnepzhenSolitaire-SMS-24.05.zip (76.11 KB)
Snepzhen Solitaire 24.05

  View user's profile Send private message Visit poster's website
  • Joined: 22 Oct 2017
  • Posts: 17
Reply with quote
Post Posted: Fri Jun 21, 2024 3:01 am
thanks for the updates. this is one of my most played games.
  View user's profile Send private message
  • Joined: 11 Mar 2018
  • Posts: 80
  • Location: New Zealand
Reply with quote
Post Posted: Fri Jun 21, 2024 3:46 am
Wainstop wrote
thanks for the updates. this is one of my most played games.


Glad to hear it's being played :3
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3893
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Jun 21, 2024 12:06 pm
Wainstop wrote
thanks again for your help! here's a mostly fixed and done game gear port (attached)


I just created a page for your version: https://www.smspower.org/Homebrew/SnepzhenSolitaire-GG

Could you post a few screenshot at native resolution and a description to fit in the page?
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!