RPTools.net

Discussion and Support

Skip to content

It is currently Sat Oct 21, 2017 12:48 pm 






Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3729
Location: MD
 Post subject: Re: Use Real Dice Rolls?
PostPosted: Mon Apr 24, 2017 10:04 am 
Btw, here is some source code for java based facial recognition software: http://www.advancedsourcecode.com/javaface.asp

After watching the linked youtube video, I think it would be pretty easy to try and use this for "dice" recognition. I don't know what recognition methods it's using (faces are, after all, different than dice)... but it would be a good place to start. Start with a D6 and take baseline top-down pictures of the dice to set the "Select the Image to be Recognized" images. Then take a bunch of random shots of D6 dice from above and with varying orientations and angles... and see how well the program handles the recognition.

If it works really well... you might have something to build on.

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5410
 Post subject: Re: Use Real Dice Rolls?
PostPosted: Mon Apr 24, 2017 11:22 am 
pirklbauer31 wrote:
That's why I asked if it was possible to combine using real dice with RPTools



If you build a java class which can "read" dice, in whatever way you decided to build such an application, then we can easily help you plug in the actual results for SIMPLE dice rolls. Regardless of how you actual "read" the dice rolls:

  • bluetooth dice, which I would assume would be very expensive
  • camera software that turns the dice into a number
  • some form of magic I am unaware of

THEN once that's done, we can deal with how maptool is "notified" that there is dice rolled to deal with.

If for some reason, you don't want to do java, well, then thing get a bit more complicated, but not overely so. In this case, I would have MapTool configured with a webservice. This is where things get tricky since you really HAVE to decide ahead of time something. Will you tell MapTool someone is about to rolls some dice, then read the results from the external application, and plug into MapTool

OR

Will you roll the dice first manually and THEN tell Dicetool the result/go get the result.

Either way is acceptable.

Honestly, the more I think about it, the more I think that MapTool hosting a webservice call and/or(ie for either way) a web service client would be best and then it could be fairly extensible to other applications with a correct API without the external application needing to know anything about MapTool's internals.

One issue with your thought process would be: what happens with various game mechanics? Example:

Shadowrun's variable dice pool. Does it default to count successes, does it default to just summing all the dice, what?

D&D 5e's Advantage/Disadvantge. In that system you have modifiers to either roll d20 twice and take the higher or d20 twice and take the lower depending upon the situation. Would you be required to roll BOTH at the same time so MapTool could somehow know to apply only one of the two possible results(this could be accomplished with quickly and easily with a variable to say if high/low is used), but what happens if the person only rolls a SINGLE d20.

The thing is, the simple cases really are simple. But as with game systems, thinks break down from simple once you have to start dealing with the changes from one game system to another.

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5410
 Post subject: Re: Use Real Dice Rolls?
PostPosted: Mon Apr 24, 2017 11:24 am 
Full Bleed wrote:
Btw, here is some source code for java based facial recognition software: http://www.advancedsourcecode.com/javaface.asp

After watching the linked youtube video, I think it would be pretty easy to try and use this for "dice" recognition. I don't know what recognition methods it's using (faces are, after all, different than dice)... but it would be a good place to start. Start with a D6 and take baseline top-down pictures of the dice to set the "Select the Image to be Recognized" images. Then take a bunch of random shots of D6 dice from above and with varying orientations and angles... and see how well the program handles the recognition.

If it works really well... you might have something to build on.


And if this was supposed to be more than a project test, in order to make the reader software fairly good, you would have to also handle testing with various fonts on dice and 6 sided dice with pips vs actual numbers.

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
 Offline
Kobold
 
Joined: Sat Apr 22, 2017 6:16 pm
Posts: 9
 Post subject: Re: Use Real Dice Rolls?
PostPosted: Mon Apr 24, 2017 11:43 am 
jfrazierjr wrote:
pirklbauer31 wrote:
That's why I asked if it was possible to combine using real dice with RPTools



If you build a java class which can "read" dice, in whatever way you decided to build such an application, then we can easily help you plug in the actual results for SIMPLE dice rolls. Regardless of how you actual "read" the dice rolls:

  • bluetooth dice, which I would assume would be very expensive
  • camera software that turns the dice into a number
  • some form of magic I am unaware of

THEN once that's done, we can deal with how maptool is "notified" that there is dice rolled to deal with.

If for some reason, you don't want to do java, well, then thing get a bit more complicated, but not overely so. In this case, I would have MapTool configured with a webservice. This is where things get tricky since you really HAVE to decide ahead of time something. Will you tell MapTool someone is about to rolls some dice, then read the results from the external application, and plug into MapTool

OR

Will you roll the dice first manually and THEN tell Dicetool the result/go get the result.

Either way is acceptable.


  • I guess the image recognition part would be the best approach for getting the dice values.
  • Programming in Java is fine for me
  • I thought of first manually rolling the dice, then getting the result

The thing is, since I'm working on this semester-project alone and therefore I have limited time to do it, I was looking for already existing applications so I don't have to write that from scratch.
I'll probably focus on DnD since that's the game I play and know a bit about.
My Prof. also said, that a Proof of concept (The concept being: "Play DnD digitally, but still use real dice so you don't completely lose all physical aspect) as a result of
the project will be enough.
While searching for existing applications to play DnD i found Roll20 first(which turned out to not be the thing i was looking for) and RPTools.
Since RPTools seems to be OpenSource, I hoped to be able to use that for my project.

I hope what I wrote makes at least some kind of sense now.

Btw: Thanks for all the replies so far!


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1684
Location: Chicagoland
 Post subject: Re: Use Real Dice Rolls?
PostPosted: Mon Apr 24, 2017 12:47 pm 
Like jfrazierjr, there are several ways to tackle this. And unless you plan on writing the actual dice "recognition" code inside the MapTool project itself, it can come second. I would highly recommend the dice rolling to be a separate project and create an API in MapTool to access that "data".

It can start out as simple as your dice project logging it's results to a flat file and create a file watcher in MapTool to watch this file and pull in the results. Eventually moving to creating a macro command that "fetches" the results. Obviously you can't really initiate the dice process by rolling dice and pushing the results to MT as MT needs to know what these dice rolls are for. Unless you plan on creating a special "marker" to also be used. If it were me, and I was going to go the camera route, I may create some sort of custom flash card system with a QR code or something. The QR code would contain enough data to tell MapTool what you want to do with the dice rolls. Probably just a URI like maptool://macro?rollInit which calls the rollInit macro passing the dice results as arguments.

Creating your dice project outside of MapTool will give you more flexibility in choosing existing libraries to leverage. You wouldn't be locked into Java if you found, say, a better library to use written in C++.

So,
Step 1, flesh out the work flow (press MT macro, prompt user, roll dice? or roll dice, press MT macro? Roll dice & tell MT what to do? etc). Basically, how will the user tell MapTool how to use the dice he/she just rolled?
Step 2, Decide on technology (bluetooth, camera, some other sensor), start on a simple POC (proof of concept)
Step 3, Get your POC to display/log your results for a simple die
Step 4, Download MapTool from GitHub and get it to compile and run in your development environment
Step 5, Decide on API method or bake it into the MT project (if your POC is written in Java, you have options here)
Step 6, Flesh it out and profit!

So, unless the MapTool part is really the core of your project and the dice part is just black box, don't worry about it at this point. It can be solved several ways, none of them difficult. If you really want to nail down the MapTool part first, then you have to at least generate a program to simulate your dice results to send to MT.

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
 Offline
Kobold
 
Joined: Sat Apr 22, 2017 6:16 pm
Posts: 9
 Post subject: Re: Use Real Dice Rolls?
PostPosted: Mon Apr 24, 2017 12:53 pm 
JamzTheMan wrote:
Like jfrazierjr, there are several ways to tackle this. And unless you plan on writing the actual dice "recognition" code inside the MapTool project itself, it can come second. I would highly recommend the dice rolling to be a separate project and create an API in MapTool to access that "data".

It can start out as simple as your dice project logging it's results to a flat file and create a file watcher in MapTool to watch this file and pull in the results. Eventually moving to creating a macro command that "fetches" the results. Obviously you can't really initiate the dice process by rolling dice and pushing the results to MT as MT needs to know what these dice rolls are for. Unless you plan on creating a special "marker" to also be used. If it were me, and I was going to go the camera route, I may create some sort of custom flash card system with a QR code or something. The QR code would contain enough data to tell MapTool what you want to do with the dice rolls. Probably just a URI like maptool://macro?rollInit which calls the rollInit macro passing the dice results as arguments.

Creating your dice project outside of MapTool will give you more flexibility in choosing existing libraries to leverage. You wouldn't be locked into Java if you found, say, a better library to use written in C++.

So,
Step 1, flesh out the work flow (press MT macro, prompt user, roll dice? or roll dice, press MT macro? Roll dice & tell MT what to do? etc). Basically, how will the user tell MapTool how to use the dice he/she just rolled?
Step 2, Decide on technology (bluetooth, camera, some other sensor), start on a simple POC (proof of concept)
Step 3, Get your POC to display/log your results for a simple die
Step 4, Download MapTool from GitHub and get it to compile and run in your development environment
Step 5, Decide on API method or bake it into the MT project (if your POC is written in Java, you have options here)
Step 6, Flesh it out and profit!

So, unless the MapTool part is really the core of your project and the dice part is just black box, don't worry about it at this point. It can be solved several ways, none of them difficult. If you really want to nail down the MapTool part first, then you have to at least generate a program to simulate your dice results to send to MT.


According to this, it might actually work!
Thank you for your input and help so far :)


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1684
Location: Chicagoland
 Post subject: Re: Use Real Dice Rolls?
PostPosted: Mon Apr 24, 2017 1:40 pm 
Anything is possible with Time & Money. :D

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9413
Location: Netherlands
 Post subject: Re: Use Real Dice Rolls?
PostPosted: Mon Apr 24, 2017 5:37 pm 
my $0.02: https://www.simplicity.be/article/recognizing-dices/

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3729
Location: MD
 Post subject: Re: Use Real Dice Rolls?
PostPosted: Mon Apr 24, 2017 10:13 pm 
wolph42 wrote:

I just tried the facial recognition software I linked above... and it's a *fail* for dice when the orientation changes. Or, at least, using semi-translucent dice and color pictures as my test dice/pictures really fooled it by creating all kinds of random tones to match. ;)

I believe that the isolation/threshold techniques in your article would need to be used to remove various shadows, reflections, and extraneous data. But, even so, it will be far more complicated to remove some extraneous data from poly dice as you won't just be looking at pips.

This project will really end up being a poly dice/image recognition project.

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9413
Location: Netherlands
 Post subject: Re: Use Real Dice Rolls?
PostPosted: Tue Apr 25, 2017 4:45 am 
I can imagine, there are so many variables to keep track of and indeed, the fact that the numeral system is used. Also the dice can rotate which means that classic OCR is also difficult e.g. try to recognize 6 and 9 rotated. Still for someone who wants to put time and effort in it, it can be a fun project. You can also decide to limit the scope to one specific set of dice, e.g. only black and white polys! e.g. this set is pretty common and most easy to OCR.

I mean if MT would at any time support ODR (optical dice recognition) but the function would be limited to one set of dice, I wouldn't hesitate to buy that set.

more link, more focused on java:
https://sourceforge.net/projects/javaocr/
http://tess4j.sourceforge.net/

previous one: https://www.simplicity.be/article/recognizing-dices/

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon Sep 15, 2008 8:27 am
Posts: 1178
Location: Bristol, UK
 Post subject: Re: Use Real Dice Rolls?
PostPosted: Fri Sep 08, 2017 9:53 am 
I think a way you could cope with the d4 would be to roll onto glass with the camera underneath.

Obviously you would need to read the results and convert them to appropriate value. Fortunately for us, dice tend to have fixed opposites.


Top
 Profile  
 
 Offline
Giant
 
Joined: Mon Aug 03, 2015 5:30 pm
Posts: 204
 Post subject: Re: Use Real Dice Rolls?
PostPosted: Fri Sep 08, 2017 10:10 am 
Jagged wrote:
I think a way you could cope with the d4 would be to roll onto glass with the camera underneath.


Every d4 I've ever seen has three numbers on each face.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7887
Location: Bay Area
 Post subject: Re: Use Real Dice Rolls?
PostPosted: Fri Sep 08, 2017 2:03 pm 
taustinoc wrote:
Jagged wrote:
I think a way you could cope with the d4 would be to roll onto glass with the camera underneath.


Every d4 I've ever seen has three numbers on each face.


I guess technically it can be done. It would just be the number you don't see on the side facing down.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3482
Location: Austin, Tx
 Post subject: Re: Use Real Dice Rolls?
PostPosted: Mon Sep 18, 2017 8:16 am 
I'd also recommend going with a gaming system that uses all d6 to limit the scope.

_________________
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman