Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleMaas committed Nov 7, 2020
0 parents commit 5326859
Show file tree
Hide file tree
Showing 18 changed files with 1,183 additions and 0 deletions.
202 changes: 202 additions & 0 deletions COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Binary file added Graphics/1354075811-square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Graphics/Halloween-Spider-Web-Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Graphics/grey-cloud-1-poof.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Graphics/ragnetto-incazzato-arch-04r-splat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Graphics/ragnetto-incazzato-arch-04r.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
142 changes: 142 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Spider Stomping Game

## About the game

This game is a Halloween decoration, originally designed back in 2018, which is
run using a projector and 3D scanner. It scans for players' feet and maps that
into projection space to allow players to try to stomp on as many cartoon spiders
as they can within the allotted time.


## Required equipment

To run this game, you will need the following hardware:

* Reasonably hefty computing device. A Raspberry Pi is unlikely to have enough
horsepower for it.

* 3D scanner which is compatible with OpenNI. I used a Structure sensor, but a
Microsoft Kinect should work just fine as well.

* Projector which has a wide enough field of view to form a decent-sized play area.

* Ladder and some means of fastening the projector and 3D scanner. The taller the
ladder, the more flexibility you have in positioning the projector for a workable
play area size.

* Light-colored driveway or other flat floor surface. Dark-colored asphalt
driveways will not give you a good projection surface. Concrete driveways work well.


As for software, you will need:

* Processing 3

* OpenNI, which as of 2020 I no longer remember how to set up, so you're on your own

* Processing audio library


## Equipment setup

1. Set up the ladder to one side of the driveway with steps pointing toward the
driveway.

2. Attach the 3D scanner to the ladder pointing roughly straight horizontally out
toward the driveway. Make sure that the play area you want is within the
3D scanner's field of view.

3. Attach a board or something to the ladder, near the top on an angle pointing
downward toward the driveway, so you have something to attach the projector to.

4. Attach the projector to the board.

5. Connect projector and 3D scanner to the computer and power everything on.

6. Set up the projector as a second monitor on the computer.

7. Adjust the projector so that the playfield is roughly rectangular on the
driveway. It also needs to be relatively large - 8-10 feet long is a good size to
aim for. The larger you make the playfield, the more exercise the players will
get and the harder the game is. Larger playfields also accommodate multiple
players better.


## Software setup

1. Due to the way OpenNI works, I have to launch Processing as the root user.

2. Run the sketch. It will launch two windows. The one on the second screen (the
projector) will be the actual game. The first screen should have a diagnostic window
showing various information overlayed onto a preview of what the 3D scanner sees.

3. The game will initially start in calibration mode, to account for differences in
setup of where the projector and 3D scanner are aligned. To calibrate, make sure the
3D scanner can only see one person. The game will display an arrow in one corner.
Walk over to it and, facing the 3D scanner, place your left foot on the arrow. (For
best results, make sure the 3D scanner can also clearly see your right foot, but do
not place your right foot on the arrow.) After a few seconds, the game will move the
arrow to another corner. Keep walking to the arrow and placing your left foot on it
until you have completed all four corners.

4. Once calibration is complete, the game will launch into actual game mode.

5. If you want to quit, stop the sketch.


## Playing the game

1. Have player or players stand in the starting circle. The game works well for
one to two players, although if your computer is fast enough and your play area is
large enough, it seems to work okay up to about four players. All of the players
need to have their feet inside of the circle to start the game.

2. Spiders will start randomly floating through the play area. The goal is to stomp
on as many spiders as possible within the allotted time period. If even one spider
is stomped, you win!

3. Once the game is over, it will reset back to the start mode in step 1. This is a
pretty simple game.


## Diagnosing problems

* There is a diagnostic window which runs on screen 1 when the game is running. If
you are running the game on a laptop, this should be the laptop's built-in screen.
This diagnostic screen shows what the 3D scanner sees. Information is overlayed onto
this 3D scanner view to show (in green) where it is detecting feet as well as (in red)
where the calibration step has placed the corners of the play area.

* The projected game displays yellow circles where the 3D scanner sees feet. Whereas
the diagnostic image on-screen displays the information in scanner space, the yellow
circles show the same data after being mapper to projector space.

* The 3D scanner will try to detect and map into 3D space every person it sees within
its field of view. It will try to track them even if they're outside of the
playfield. The more people it tracks, the slower the game runs. So it's best if you
limit the number of players playing together to a very small number, depending on how
powerful your computer is. My computer can track two players quite well, which works
great if you have a couple siblings who want to play together. Or a parent with a
small child.

* If the game is running slow, even with a limited number of players, check to make
sure that all spectators are outside of the field of view of the 3D scanner. You can
confirm this by looking at the on-screen diagnostic image. You may need to add some
festive methods of blocking the field of view (large props, fake castle walls, etc.)
since often with this game spectators will get excited and keep advancing closer to
cheer on and help the player.

* Once the game gets to a high enough level and there are too many sounds playing at
the same time from a lot of spiders on the playfield, sometimes the sound will glitch
out. I have not been able to debug this problem yet. If it happens, the only
solution I've got is to restart the game, which will require doing calibration again.


## Any other problems?

I'm finally getting this thing released after Halloween 2020 is already over. I've
tried to include everything in here you need and add some comments to make this
reproducible, but unfortunately now that I have time to do this, I've already torn
down my setup for the year and can't realistically retest the changes I've made
right now. So if you have any issues with this release, please file an issue and
let me know!
Binary file not shown.
Binary file not shown.
Binary file added Sounds/387834__ryansitz__poof-normalized.wav
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 5326859

Please sign in to comment.