Solitaire

Use this forum to share and discuss Uzebox games and demos.
User avatar
uze6666
Site Admin
Posts: 4812
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Solitaire

Post by uze6666 »

May have a bug with the mouse. I'm using speed=5. Moving up is much faster than moving down which makes it harder to control. Left and right are the same speed.
User avatar
D3thAdd3r
Posts: 3293
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Solitaire

Post by D3thAdd3r »

Excellent thanks, I think it should be ok then since there are no big additions planned and it's already running Uzenet code about as heavy as the final version will be. P2 mouse and whatever small details there may be and of course Uzenet stuff needs to be finished then I'll call it final and release the code. Only so many bells and whistles you can put into a solitaire/klondike game. Essentially the only considerable piece of work left is getting Uzem to support ESP8266 accurately and fast which I am mentally blocked on right now after 2 1/2 failed systems for UART.

Problem with UART has been that it wont work accurately since it can't tell how far apart separate commands were(and real hardware puts up a fuss if you do AT+CIPSEND..AT+CIPSEND too fast, so code running on the emulator wouldn't work in real hardware). For things past high scores, we need to use "unvarnished mode" where you just spit stuff on the UART and it makes a packet every 20ms and sends it automatically. Yet again, another thing that gets quite complicated to make work realistically since I have the core in a separate thread for speed. I have some ideas to split time critical parts back into the main thread and other stuff outside in the hopes of speed, but I just got back to it and already need a mental break.

EDIT - oh yes seems I forgot to add cursor speed to calculation for down, I'll throw an updated version in the main post. Thanks for finding that instead of someone pointing it out years later ;)
User avatar
uze6666
Site Admin
Posts: 4812
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Solitaire

Post by uze6666 »

*Bump* Are you done with this game? There's no rom attached to the first post...
User avatar
D3thAdd3r
Posts: 3293
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Solitaire

Post by D3thAdd3r »

Kind of drifted away from my mind but it's basically done and I should finish it. I decided I'm not going to add any more features because I can't think of anything that's warranted. More music requires SD streaming to be finished, and that's not going to happen until I copy CunningFellow's methods for speed reasons; so that's for a later game. I'd be absolutely happy to have 1 less unfinished project by the end of this weekend :D

Uzenet stuff should be working except the high score server isn't done, I'll come back to that after release. All I have is to fix mouse support. I implemented it as an after thought, but the way the kernel is setup is geared towards using the built in functionality. I didn't feel like changing everything over to that so I -DSNES_MOUSE=0 and copied the kernels mouse reading and stripped out stuff I didn't need but the hacks caught up to me and I'm not sure what I broke.
User avatar
D3thAdd3r
Posts: 3293
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Solitaire

Post by D3thAdd3r »

I'd really like to have true random attract modes to this game, was there ever a simple way to add support in Uzem? Could the watchdog timer value just be seeded with time(NULL) and work?
User avatar
uze6666
Site Admin
Posts: 4812
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Solitaire

Post by uze6666 »

Great to hear you'll finish this one! You may not believe it, but I never played solitaire before your port. So I was hooked. :D You were right to not use the kernel's mouse stuff, it's pretty primitive and was just thrown in after Whack-a-mole.

I have to implement the watchdog in uzem, should not be to hard since the overall code is still fresh from the framerate update. As for the true random, we could just add some random value (0-255) to the watchdog counter start value. That should simulate the jitter in a pretty good manner I think.
User avatar
uze6666
Site Admin
Posts: 4812
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Solitaire

Post by uze6666 »

was there ever a simple way to add support in Uzem? Could the watchdog timer value just be seeded with time(NULL) and work?
Yeah it's done! It was pretty easy in fact. The way it works is to so a srand(time(NULL)) when uzem initalizes and then at each WDR reset, the watchdog counter begins with a random value between 0 & 1024.That's it.

Download uzem 1.3.1 and run the demo below. A brand new non-deterministic state each time it's run! :)
Attachments
tutorial.hex
(40.74 KiB) Downloaded 318 times
User avatar
D3thAdd3r
Posts: 3293
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Solitaire

Post by D3thAdd3r »

uze6666 wrote: Uzem 1.3.1 was published to teh main post. Two main new features:
-Added feature to capture/playback controller buttons
-Implemented the watchdog timer to support the true random generator
Niiiice work chief! You actually read my mind as Tool Assisted Speedruns(like this one) have made me want such a feature in Uzem lately.
User avatar
D3thAdd3r
Posts: 3293
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Solitaire

Post by D3thAdd3r »

Added true random support and updated the wiki to reflect GetTrueRandomSeed() as I think the name has changed once or twice and don't want anyone to get confused like I did! It is very cool to have a different attract mode every time. Obviously that means I have worked at least 5 minutes on Solitaire lately :)

I'm going to take another stab at re-implementing the mouse tonight. The reason it's hard to do what seems simple is because the hacks I did and somehow I can't get it back working at all. If nothing else I might just call it released and wait until there is proper PS/2 mouse support and go back to add that to Uzesweeper as well. It would be nice to have a more generic approach to the mouse at least.

A random idea for me was to rearrange the stack positions, change the rules to limit moves to stack availability, deal the whole deck to the table, and implement 4 spots for swapping. Basically it might be fairly easy to make a whole other game out of this: Free Cell. I don't generally care for card games by any means, but Solitaire and FreeCell I think are both fun. I wouldn't do any new music, and I would have to disable the AI attract modes for that game. Making AI that works for that does not seem trivial at all.
User avatar
uze6666
Site Admin
Posts: 4812
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Solitaire

Post by uze6666 »

Yay progress! That's good news. Happy you're happy with the true number generator. :)

As for the PS2 mouse...well let's say it fairly low priority. I still have a ton on my bench. I have received the rotary encoders but time lacks. Wish someone else could work on it.
Post Reply