Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: ACagliano on February 03, 2016, 09:54:03 pm

Title: Yahtzee, Axe edition RC 1
Post by: ACagliano on February 03, 2016, 09:54:03 pm
Here I have enclosed the source file and executable file for the Yahtzee game. Current untraceable bugs:

1. Saferam L1 not clearing after a Fill(), a looped zero, and other means of zero-ing the data
2. I believe small straight and full house still glitch, and i need to be able to reset the game to test those again, so see 1. haha
Title: Re: Yahtzee, Axe edition bugs
Post by: Dudeman313 on February 04, 2016, 08:43:58 am
I wish I could test this, but I only have a CE now. Could it and Project Slender be ported?
Title: Re: Yahtzee, Axe edition bugs
Post by: Runer112 on February 04, 2016, 08:48:29 am
Here I have enclosed the source file and executable file for the Yahtzee game. Current untraceable bugs:

1. Saferam L1 not clearing after a Fill(), a looped zero, and other means of zero-ing the data

I stepped through both instances of Fill(L1,...) in a debugger, and both are behaving correctly. If there's any unexpected data there after this, you must be putting it there. :P
Title: Re: Yahtzee, Axe edition bugs
Post by: ACagliano on February 04, 2016, 12:29:49 pm
I wish I could test this, but I only have a CE now. Could it and Project Slender be ported?

Slender is on hold, since right now I only have time for small projects. I'll be continuing it hopefully in about a month-ish. For those reason, I've opened Slender access to the community. The info to access the repo is below:

Code: [Select]
Server Name: acagliano.no-ip.biz
User: git
Password: tiCalcDevs
Path to game source: /home/git/repos/slender1.git
Supported commands: Anything related to git, and scp.

And sure it can be ported, I just don't know the language, nor do I have the CE so I'd need to have someone who does fork it.

* In related news (slender fan film) *
Spoiler For Spoiler:
there is a Slender fan film in production, headed by me and a few friends who either like making movies or like horror. I created a funding campaign at http://gofundme.com/slender-origins if anyone is interested in donating. Also, anyone who wants to help in other ways like ideas/set ideas or even joining (NY area) can PM me.

Here I have enclosed the source file and executable file for the Yahtzee game. Current untraceable bugs:

1. Saferam L1 not clearing after a Fill(), a looped zero, and other means of zero-ing the data

I stepped through both instances of Fill(L1,...) in a debugger, and both are behaving correctly. If there's any unexpected data there after this, you must be putting it there. :P

That was my fear, which will make this way harder. Only thing I can think of is the CONTINUE label somehow being executed. I'll look when I get home from work later, but if in the meantime, you or anyone sees anything that could cause that, do poke me :)
Title: Re: Yahtzee, Axe edition RC 1
Post by: ACagliano on February 05, 2016, 05:59:27 pm
Here is RC 1 of the Yahtzee Axe game. Please test and report any bugs/GUI glitches found here
Title: Re: Yahtzee, Axe edition RC 1
Post by: chickendude on February 06, 2016, 09:34:52 pm
Why are you using GetKey? Also, i'd either disable interrupts or turn off the run indicator (_RunIndicOff or resetting the bit in indicFlags).

What are the keys? I get to the screen where you have the five boxes, but there are no die or anything. I can select the boxes using the f1-f5 keys, but nothing else. The game screen looks a bit plain, but it's a nice start :) I played Yahtzee a ton in school, i believe this was the game i used to play, perhaps you could use it for some inspiration:
http://www.ticalc.org/archives/files/fileinfo/191/19190.html
Title: Re: Yahtzee, Axe edition RC 1
Post by: ACagliano on February 06, 2016, 09:54:09 pm
Why are you using GetKey? Also, i'd either disable interrupts or turn off the run indicator (_RunIndicOff or resetting the bit in indicFlags).

What are the keys? I get to the screen where you have the five boxes, but there are no die or anything. I can select the boxes using the f1-f5 keys, but nothing else. The game screen looks a bit plain, but it's a nice start :) I played Yahtzee a ton in school, i believe this was the game i used to play, perhaps you could use it for some inspiration:
http://www.ticalc.org/archives/files/fileinfo/191/19190.html

The keys are as follows:

[Math] - roll
Left/Right - cycle combos
Enter - score combo
Mode - show help
Clear - quit

And what would you recommend I use other than getKey? I used that bc it waits for a key, which saves me a loop.

ps: I do agree the score/combo section of the interface could be a bit...nicer.
Title: Re: Yahtzee, Axe edition RC 1
Post by: chickendude on February 07, 2016, 10:08:56 pm
I would just use a loop with _GetCSC, in asm:
waitKey:
bcall(_GetCSC)
or a
jr z,waitKey

I tested the game again and it seems to work pretty well, it'd be nice to be able to see all the sets at once. Also, when you pick your points after rolling, the dice aren't rolled again, you can choose to hold dice from the previous roll. I'm not sure what exactly happened, but i held dice until i eventually got a Yahtzee, and the second time i choose Yahtzee it wouldn't let me roll anymore, all i could do was press enter to get more points (see screenshot). I just tried it again and the same thing happened. Getting two Yahtzees (or maybe getting a Yahtzee after holding all five cards?) prevents you from being able to roll the dice anymore.
Title: Re: Yahtzee, Axe edition RC 1
Post by: ACagliano on February 08, 2016, 10:11:48 am
I would just use a loop with _GetCSC, in asm:
waitKey:
bcall(_GetCSC)
or a
jr z,waitKey

I tested the game again and it seems to work pretty well, it'd be nice to be able to see all the sets at once. Also, when you pick your points after rolling, the dice aren't rolled again, you can choose to hold dice from the previous roll. I'm not sure what exactly happened, but i held dice until i eventually got a Yahtzee, and the second time i choose Yahtzee it wouldn't let me roll anymore, all i could do was press enter to get more points (see screenshot). I just tried it again and the same thing happened. Getting two Yahtzees (or maybe getting a Yahtzee after holding all five cards?) prevents you from being able to roll the dice anymore.

the game is Axe, not asm, so I can't choose. I used getKey^r because it waits for a key, so I save a loop.

The way it works is, if you score more than one Yahtzee, you score again against an additional combo before rolling again.

Lastly, I found the thing with Holding before the first roll myself on a playthrough and fixed it. That was indeed a bug, or moreover an oversight on my part. Thanks. I have improved the UI, but before spending time on it, I wanted to ensure the fundamentals work.

As for seeing all the sets on screen, in the new GUI i might have room for it, but I did want to put some of the key bindings right on the main screen. So I'll ask this here, how many people would vastly prefer all combo's shown on screen? Or would a key list be preferred?
Title: Re: Yahtzee, Axe edition RC 1
Post by: chickendude on February 08, 2016, 12:26:16 pm
By key list do you mean like in the help menu? I think you could leave it as it is ([mode] brings up the help screen) or perhaps add an entry to the main menu or a [mode]=? button on screen. Personally i'd prefer to see all my combos.

And your loop should more or less get turned into that asm code, i'm not familiar with Axe but in your program try pressing [2nd]+[On]. You'll exit your program and the RAM your program occupied won't be freed (a massive RAM leak).

The way it works is, if you score more than one Yahtzee, you score again against an additional combo before rolling again.
You mean the second time around you get the fifty points and then pick another combo? The problem currently is you can just continually choose Yahtzee and get an infinite amount of points, at least until the counter overflows. I think i always just played after the first Yahtzee any others will give you 100 points, but with your way at least prevent the player from chosing another Yahtzee ;)

Btw, i forgot how much i love playing this game :D Please post when you get the new GUI ready!
Title: Re: Yahtzee, Axe edition RC 1
Post by: ACagliano on February 08, 2016, 01:51:30 pm
By key list do you mean like in the help menu? I think you could leave it as it is ([mode] brings up the help screen) or perhaps add an entry to the main menu or a [mode]=? button on screen. Personally i'd prefer to see all my combos.

Ok, I can do that.

And your loop should more or less get turned into that asm code, i'm not familiar with Axe but in your program try pressing [2nd]+[On]. You'll exit your program and the RAM your program occupied won't be freed (a massive RAM leak).

Ah, I was not aware of that happening. Looking in the Axe documentation, I think there is a version of getKey that uses the OS's version (scancode?). I did notice that, in the game, [2nd] and [Alpha] are still active as they normally are (something that's been bugging me, since I like using [2nd] as a primary key). I'll fix that and report back.

The way it works is, if you score more than one Yahtzee, you score again against an additional combo before rolling again.
You mean the second time around you get the fifty points and then pick another combo? The problem currently is you can just continually choose Yahtzee and get an infinite amount of points, at least until the counter overflows. I think i always just played after the first Yahtzee any others will give you 100 points, but with your way at least prevent the player from chosing another Yahtzee ;)

Well there are different ways of handling the scoring. In some programs I've seen you can score Yahtzee again, and then another combo. In others, you can score another combo and get a 50 point bonus. Both ways accomplish the same result, but I believe the latter might actually be better, require less coding, and be less bug-prone. I'll work on this and post back.

Btw, i forgot how much i love playing this game :D Please post when you get the new GUI ready!

I love it too. I actually had a handheld Yahtzee thing, but it broke, so that's why I made this haha. And will do, ofc. Thanks for the comprehensive bug reports :p
Title: Re: Yahtzee, Axe edition RC 1
Post by: ACagliano on February 08, 2016, 08:29:36 pm
Fixes for everything except the [2nd] + [ON] leak. GUI improvement. I'm waiting for Runer, so I can ask him about some of the other Axe keyscanning options.
Title: Re: Yahtzee, Axe edition RC 1
Post by: Runer112 on February 08, 2016, 09:26:40 pm
And your loop should more or less get turned into that asm code, i'm not familiar with Axe but in your program try pressing [2nd]+[On]. You'll exit your program and the RAM your program occupied won't be freed (a massive RAM leak).

This should not happen, as Axe uses _GetKeyRetOff, which returns kOff rather than actually shutting off the calculator.

However, I agree that it's better to go with a _GetCSC loop in a case like this. Which, in Axe, simply translates to While 1 : EndIf getKey. If interrupt are enabled (which you can do with FnOn), put a Stop in the loop to save battery, too!
Title: Re: Yahtzee, Axe edition RC 1
Post by: ACagliano on February 08, 2016, 09:56:29 pm
Can I then store getKey to a variable? Like 
Code: [Select]
EndIf getKey->G
Title: Re: Yahtzee, Axe edition RC 1
Post by: Runer112 on February 08, 2016, 11:45:41 pm
Can I then store getKey to a variable? Like 
Code: [Select]
EndIf getKey->G

Of course.
Title: Re: Yahtzee, Axe edition RC 1
Post by: ACagliano on February 09, 2016, 10:52:43 am
Ok, update.

- as I believe this version is stable, the b has been removed from the version string
- getKey^r switched to a getCSC loop (getKey)
- roll key changed to [2nd]. Help Screen updated to reflect this.
- Hold on Roll 0 bug fixed
- Multiple Yahtzees changed to a Yahtzee Bonus

Screenshot updated has some graphical glitches I think root in jStified, since they do not occur at all on my calculator. I'll poke Kerm and see what he has to say.
Title: Re: Yahtzee, Axe edition RC 1
Post by: chickendude on February 10, 2016, 06:38:18 am
This version looks much better :)

Here are some suggestions/ideas i've had:
- highlight the combos you've used already (XOR a black square over them) so you can easily see which combos you've already used.
- Replace the 'used' text with the points you scored for that combo
- Perhaps up/down could move the cursor to the other row? If you want things to line up, you can make the USED/score box the same size as the YATZ box.
- A way to see how many points you have in the top row (i believe it's 63 points you need to get the bonus)
- Turn off the run indicator. The hex code for bcall(_RunIndicOff) is EF7045. Axe may have another way to do this.
- It might be better to notify you that you're getting the +35, at first i thought it was a calculation glitch (eg. for 3 6's, it'd show 18+35 or something or have a text or button appear saying "BONUS").
- After selecting a combo, it might be better to clear the dice. Also, a rolling animation would look nice :)

This version is much better, i like the interface, too. Nice work!
Title: Re: Yahtzee, Axe edition RC 1
Post by: ACagliano on February 10, 2016, 10:15:26 am
- highlight the combos you've used already (XOR a black square over them) so you can easily see which combos you've already used.
- Replace the 'used' text with the points you scored for that combo
I could do that.

- Perhaps up/down could move the cursor to the other row? If you want things to line up, you can make the USED/score box the same size as the YATZ box.
I could also do that. Not too concerned about lining up exactly, but we'll see.

- A way to see how many points you have in the top row (i believe it's 63 points you need to get the bonus)
- Turn off the run indicator. The hex code for bcall(_RunIndicOff) is EF7045. Axe may have another way to do this.
- It might be better to notify you that you're getting the +35, at first i thought it was a calculation glitch (eg. for 3 6's, it'd show 18+35 or something or have a text or button appear saying "BONUS").

I could create separate score and bonus boxes. However, currently, a + symbol appears to the far right of the score box when a bonus is being applied.

- After selecting a combo, it might be better to clear the dice. Also, a rolling animation would look nice :)
Sorry, but the program is already 6000 bytes. I wanted smaller, but animations are going to make the program even larger.
Title: Re: Yahtzee, Axe edition RC 1
Post by: ACagliano on February 11, 2016, 08:31:00 pm
Ok, some changes.

1. A complete rework the GUI. The High and Low score is moved to the left half of the top of the screen, the combo score and bonus points are moved into an inset in that top roll.

2. The combo listing is moved down, and the selected combo box is inverted. Already used combos are rendered with an X across them. When hovered over, the scored combo for that item is rendered, rather than the point value for the current roll.

3. The last box on the top row now sums the points for the first 6.

4. Die are reset after a roll. Default is a ? symbol. Screenshot and version enclosed.
Title: Re: Yahtzee, Axe edition RC 1
Post by: chickendude on February 19, 2016, 10:52:49 am
Ok, i finally got around to testing this out and this version is great! Here are a couple things i noticed when testing it out:
1. The run indicator. A Google search says DiagnosticOff turns off the run indicator. (DiagnosticOn turns it back on)
2. I think the main menu should also accept 2nd.
3. I wonder if using another key other than Enter to select a combo would make sense? Maybe Alpha. Enter isn't where you normally place your fingers when playing a game and i found i kept mixing Enter and 2nd up for rolling the dice, though usually it's not an issue since the cursor is on the last item you picked anyway.
4. I'm not sure if it's just me or not, but i found a lot of times the dice didn't change or didn't change much. I had the same numbers in the same order. I'm not sure if it's just the PRNG routine or another issue, it was just something i noticed happening often enough to stand out.
5. I'm also not sure if it'd make more sense to jump to the main menu after finishing a round. Putting a high score on the main menu page would be nice, too, as would being able to input your initials or something :)
6. [edit] When getting the bonus for the top row, it seems you can see the points appear in the + square, but after you get the points you can't see that you've gotten it. Maybe you could have a token or something that appears in the blank space in the middle, one token for the top row and an additional token each time you get Yahtzee? (i haven't gotten a Yahtzee yet in this new version).

The dice rolling wouldn't take up much extra space, you just randomly draw a dice sprite (which you've already drawn) a few times over the slots which aren't being held. The question marks after selecting the combo is a nice touch, btw.

Anyway, i think it's great, it feels finished (apart from the run indicator) as is, great work and thanks!

Btw, while playing another game before posting, i just came across this (see attached screenshots). I believe the first screenshot should let me have a small straight (5 4 6 3 -> 3 4 5 6) but it shows up as 0 points. The final roll i got another 3, i'm not sure if it let me have the small straight because of that 3 or because it was the final roll.
Title: Re: Yahtzee, Axe edition RC 1
Post by: ACagliano on July 31, 2016, 04:05:28 pm
Sorry for the reply delay in this. Since my old calculator is broken, link wise, i cannot update this program myself so anyone who wants to can fix or modify anything needing it and repost and add their name to it.

On to the reported bugs/issues:
1. I could have sworn that was actually put in there and had no effect? I can have a look at the source later and update.
2. That is something that could be added, certainly.
3. I thought Enter was a more straightforward key for entering something lol. But if the lot of you agree it should be moved, we can move it.
4. Thats a RNG thing. I forget how I set up the seed. If memory serves, it was simply rand as provided in Axe.
5. Also, doable.
6. I was worried about screen space for a lot of stuff. In the current setup, the points tally next to the selection for the 1-6's is your indicator of whether or not you achieved that bonus. I could toss a character in it. There seems to be room.

Dice rolling: the program was already getting high in size, so i did without animations. I might make a version for the CE that is a little better.

Thanks for the feedback. Happy to finally have a decent, nice looking project out for people to use (i dont exactly count my polynomials program on that list haha)

That last issue is very strange. I thought all kinks with the SS/LS finding algorithm were worked out, but it seems to still be there. I'll look into it and report what i find.
Title: Re: Yahtzee, Axe edition RC 1
Post by: chickendude on August 09, 2016, 07:52:35 am
It's been a while since i played it, but you did a great job :)

I believe there's a (or a couple) IDEs that support AXE which along with an emulator would make a nice developing environment if you wanted to continue working on AXE projects. Not sure if they're available for Mac though. Sorry to hear about your calc's linkport, though.