Poker Hand Comparison Tool
Armelline
Member, PRO Posts: 5,370
Okay, so inspired by the epic, daunting task that @Fajlajp has set out for himself, I figured I'd kill some time this weekend in the mental exercise of creating a functioning poker hand comparison tool in GameSalad.
This is something easy to do in just about any programming language that has arrays, but was a real challenge in GameSalad. The fact that it wasn't attached to an actual poker game made it even more challenging!
There are numerous additions GameSalad could make to the creator that would trivialise this task. Sortable arrays, the ability to return an attribute from a max() or min() rather than just the attribute's value, loops (I didn't use any nightly behaviours, so I don't know how robust the new loops are).
I'm pretty pleased with the result, and I've been playing with it all day and haven't managed to trip it up yet. I think the suit sorting is working now too, but not 100% on that.
Take a look! Updated the video to an EVEN MORE BORING ONE!
I don't really know what to do with it now. As far as I know, this is the first time this has been done in GameSalad (identifying poker hands has been done, but I can't find any examples of comparing poker hands).
This is something easy to do in just about any programming language that has arrays, but was a real challenge in GameSalad. The fact that it wasn't attached to an actual poker game made it even more challenging!
There are numerous additions GameSalad could make to the creator that would trivialise this task. Sortable arrays, the ability to return an attribute from a max() or min() rather than just the attribute's value, loops (I didn't use any nightly behaviours, so I don't know how robust the new loops are).
I'm pretty pleased with the result, and I've been playing with it all day and haven't managed to trip it up yet. I think the suit sorting is working now too, but not 100% on that.
Take a look! Updated the video to an EVEN MORE BORING ONE!
I don't really know what to do with it now. As far as I know, this is the first time this has been done in GameSalad (identifying poker hands has been done, but I can't find any examples of comparing poker hands).
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Comments
What to do with it? Well, I'd say either post the project file here and/or in the Spare Code thread or sell it as a template on GSHelper or DeepBlueApps.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Before trying to sell it as a template I'd want at least one guru to take a look at it, check if I've made any really stupid mistakes - like missing that condition in the video - or completely missed a flaw in my logic.
Selling it as a template is definitely something I'd consider though.
The logic to do this in GameSalad - in the end - is actually very simple. It's just a matter of breaking it down into steps until every hand becomes a series of simple comparisons.
I sent it to Fajlajp and it looks like he'll probably be able to incorporate it into his game without too much trouble!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
I'd be happy to look over the template for you but I'm a bit swamped at the moment so I'd probably have to wait a week or so to do it. Let me know via PM.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I'll try to stick the sort into the spare code thread tonight. It literally is just a series of max(x,y) repeated x times, though, nothing particularly interesting!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
A solid example always beats any arm waiving (referring to my speculations in the other thread).
I'm sure this would make a fine addition to the templates for sale on ghelper.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
@RThurman, I think you had some very interesting ideas, but I tried to avoid maths and root my solution in staggered logic instead. I suspect that properly implemented, your idea could end up more efficient.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
http://www.deepbluemarket.com/product/poker-hand-calculator-and-comparison/
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
Darren.