User avatar
karrika
Posts: 1051
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Read position of game piece on TV screen

Sat May 28, 2016 12:22 pm

PiGraham wrote:I like the health glow idea.

DO players roll dice to move? If you could read the roll would that tell you where a piece would be? I see there are some wireless dice around, also dice apps for a mobile device thay you shake. I see at least one source example for Unity.

Another option is an IR touchscreen overlay that could detect multiple pieces on the board area.
E.g. http://www.ebay.co.uk/itm/Dual-touch-IR ... 1176067213
There is a dice roll only for combat. The movements are fixed based on the character stats. But you can move in any direction and also stop in any tile if you want. The dice rolls are automatic and built into the game.

The IR touchscreen is a bit bulky and expensive. I like the cam or IR led approach more.

PiGraham
Posts: 3531
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Read position of game piece on TV screen

Sat May 28, 2016 1:00 pm

karrika wrote:The IR touchscreen is a bit bulky and expensive. I like the cam or IR led approach more.
Agreed. The potential advantages being no need to build electronics and fit it into tiny packages with batteries and mount overhead IR receivers. It could be plug and play.

User avatar
karrika
Posts: 1051
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Read position of game piece on TV screen

Sun May 29, 2016 5:29 pm

I just got my hardware together.

PiZero
IR camera with 160 degree lens
DiscoCap for light control

Image

The mechanics will be built into the wooden case that is some left-over from last weeks party. The case can double as a storage place for the cables.

The camera approach is very clean and simple. No extra soldering or extra components. I may actually go for this because of simple hardware. Then I can also make the characters glow by changing colors of the tile. In the IR approach the battery would block the lighting of the game piece.

User avatar
karrika
Posts: 1051
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Read position of game piece on TV screen

Sat Jul 09, 2016 7:46 pm

Finally I had time to test the TV screen to frequency chip.

Light:
2016-07-09-192516_1824x984_scrot.png
2016-07-09-192516_1824x984_scrot.png (1.84 KiB) Viewed 2761 times
Dark:
2016-07-09-192631_1824x984_scrot.png
2016-07-09-192631_1824x984_scrot.png (1.75 KiB) Viewed 2761 times
So it should be easy to distinguish between a peg standing on a dark tile or a lighted tile :D

This also means that I skip the camera and the IR LED's. Now I have just a very thing cable going directly from the PiZero GPIO pin to the frequency-out pin of the light sensor.

In the long run this is better as I don't need batteries for the IR leds, no IR detectors.

When I get everything together I will post some pictures and perhaps videos.

The game is also getting better all the time. I got the alsamixer to combine a piano track with ambient sounds and sound effects in the game. So far I have 6 scenarios ready. But no playtesters yet...

User avatar
karrika
Posts: 1051
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Ropecon 2016 PiZero for read position of game piece on TV sc

Sat Jul 30, 2016 8:43 pm

Today is the second day of Ropecon 2016. The game has been played by many visitors and they even made a streaming video broadcast out of it with an interview.

Here is a nice girl demonstating the game to a starting roleplayer.
Image

Tomorrow (Sunday) is the last day of Ropecon 2016. The nice girl that used to demonstrate the games suddenly disappeared. I wonder if she will be back tomorrow?

Image

ghans
Posts: 7856
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Ropecon 2016 Reading position of game piece on TV screen

Sun Jul 31, 2016 8:36 am

So how does it work ?

You turn the whole board black , light up the legal targets
of the pieces in a serial fashion and count the IR pulses emitted
by the transparent pieces ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
karrika
Posts: 1051
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Ropecon 2016 Reading position of game piece on TV screen

Sun Jul 31, 2016 11:10 am

No. I keep the whole board lighted as normal and turn just one tile adjacent to the active character black for some milliseconds. It worked ok.

User avatar
karrika
Posts: 1051
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Ropecon 2016 Reading position of game piece on TV screen

Sun Jul 31, 2016 3:06 pm

End of Ropecon 2016. One and a half day before the Ropecon the magic blue smoke that keeps electronics alive escaped from one of my IR playing pegs. So I had to re-design everything on Friday morning. The event opened at 3 PM.

So I rewrote the code to use just one photo sensitive peg to be used as an "active" peg. Instead of having real pegs on the board for the heroes I use computer graphics.

Image

Note: on top of the PiZero I also have DiscoCap DMX control for running the water effect on the wall.

The event was very educational for me. Now I know what the problems are, how delays can be avoided, what the optimal colour schemes for scanning the pegs should be. Perhaps my next game will build on top of the experience I got from this Ropecon convention.

ghans
Posts: 7856
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Ropecon 2016 Reading position of game piece on TV screen

Mon Aug 01, 2016 8:37 am

How do you count the pulses ? Via camera or is something
connected to the GPIO ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
karrika
Posts: 1051
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Ropecon 2016 Reading position of game piece on TV screen

Mon Aug 01, 2016 11:17 am

ghans wrote:How do you count the pulses ? Via camera or is something
connected to the GPIO ?

ghans
I added a main loop that recorded the time since the last transition of a GPIO line. I also saved the last 4 time measures for every GPIO line. Once the change of a tile was from light to dark so that the (dark time) > 1.5 * (shortest light time) then I knew that the peg was on a certain place on the screen. This then triggered a move of a peg, choosing an orc, barrel or something to be targetted. The next light to dark transition did then trigger the actual fight or open the chest.

In addition to this I had two buttons connected to GPIO wires:
- open a door button
- end your turn button.

Nothing else was needed for playing the game. Just 3 GPIO lines and a €3 light to frequency chip glued on the bottom of the playing piece. I finally had 3 very thin wires braided together to make a wired contact to PiZero (3.3V, GPIO IN, GND). Look at the blue line in the pic above. The DiscoCap board had proper pull-up resistors for the buttons. I also coded in the hysteresis algorithm to my game (mentioned in some of my other posts) to get rid of spurious signals.

The reason I abandoned IR was that some blue smoke escaped the IR reading hardware and there was no time to buy replacements. So I just changed plans and moved to wired data transfers.

PS. I also bought a camera module on Friday morning but it was dead on arrival. The software recognized it but it refused to digitize anything. So I had to abandon IR completely. That is how things usually are. BIG PANIC a few hours before being on stage. I love the excitement.

PiGraham
Posts: 3531
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Ropecon 2016 Reading position of game piece on TV screen

Mon Aug 01, 2016 11:52 am

Cool.

Before the smoke escaped did you have the pegs operating self-contained with internal batteries?

PiGraham
Posts: 3531
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Ropecon 2016 Reading position of game piece on TV screen

Mon Aug 01, 2016 11:54 am

BTW, did you see Ben Heck Show Hackmanji game? Totally different concept but it is an interesting take on a board game.

User avatar
karrika
Posts: 1051
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Ropecon 2016 Reading position of game piece on TV screen

Mon Aug 01, 2016 12:49 pm

PiGraham wrote:Cool.

Before the smoke escaped did you have the pegs operating self-contained with internal batteries?
Yes, I used 3V 12mm diameter batteries but the chip needed a current booster to drive the LED.

User avatar
karrika
Posts: 1051
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Ropecon 2016 Reading position of game piece on TV screen

Mon Aug 01, 2016 2:58 pm

PiGraham wrote:BTW, did you see Ben Heck Show Hackmanji game? Totally different concept but it is an interesting take on a board game.
This reminds me of our "computer club" at school when I was a teenager. Our "computer" was 6 relays, a motor rotating a mechanical switch, push buttons and bulbs. - No semiconductors at all.

I kind of miss the excitement you get from teaching boolean logic and Karnaugh maps today. The higher integration level has made this kind of knowledge more or less useless. But the show was ok. I had not seen it before. Laser cutters, 3D printers, old school logic gates. Lots of work compared to the amount of time you would be interested in playing this "game".

Btw. In addition to some weeping angels there was also a Dalek around. Luckily I had my Sonic screwdriver.

User avatar
karrika
Posts: 1051
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Ropecon 2016 Reading position of game piece on TV screen

Tue Aug 02, 2016 2:31 pm

I wonder if there would be any interest in this kind of photo sensitive playing piece electronics tutorial?

Perhaps I could put together a small set of schematics for how to connect this and maybe even do a Raspberry Pi binary release for creating and playing your own adventures. The Raspberry Pi also has a built-in adventure creator for making your own adventures with a nice script editor.

Image

Or if this is too old school then I could just drop the idea and go out to play Pokemon Go.

Nitrogen_Widget
Posts: 38
Joined: Tue Aug 28, 2012 5:52 pm

Re: Ropecon 2016 Reading position of game piece on TV screen

Tue Aug 02, 2016 5:32 pm

This is cool.
Would be interested in seeing how I could duplicate this myself.

Would RFID's work for the playing pieces instead?

User avatar
karrika
Posts: 1051
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Ropecon 2016 Reading position of game piece on TV screen

Tue Aug 02, 2016 5:59 pm

Nitrogen_Widget wrote:This is cool.
Would be interested in seeing how I could duplicate this myself.

Would RFID's work for the playing pieces instead?
Thank you. I cannot see how a RFID could measure where on the screen it happens to be. The reason why I used a light sensitive element was that we can paint whatever we want on the screen during the gameplay. So in theory if we paint the entire screen white the light sensor will show "white". We can then start turning the screen black one tile at a time until the sensor shows "black". In this way we know where the peg is.

In this game we use a slightly more intelligent system that turns the tiles around the character that is active black one tile at a time.

Nitrogen_Widget
Posts: 38
Joined: Tue Aug 28, 2012 5:52 pm

Re: Ropecon 2016 Reading position of game piece on TV screen

Tue Aug 02, 2016 7:42 pm

whoops.
I was thinking RFID tags could be actively triggered for some reason.

Return to “Gaming”