The official "due date" for my crane game project was yesterday, and I'm happy to say that it is to the point where I can say I accomplished everything I set out to do at the beginning of the semester. It's been a long journey this semester to get here and I'm honestly stunned I was able to achieve my goals and learn so much. Since the only update I have made since week 10 has been a very quick (and excited) post, here's a fill in of all of the details!
The entire semester I have been riding on the hope that the claw grab was going to successfully be able to pick up my physics body prizes. I learned a bit about Animation Blueprints in UE4 and added in an animation state for the claw grab. The claw animation is a blend of the animation and the physics, I then tweaked the physics bodies on my prizes and the claw as well as the physics materials (to change the mass and physical properties). I was very pleasantly surprised that the claw's collision interacted with the collision of the prizes to successfully be able to pick them up.
There is a bit more I'd like to do here to get it functioning the way I want it to completely, but given the time constraints of this project and the goal of getting the game to a level of proof of concept, I am happy that it is working enough to pick up a prize, have the possibility of it being able to slip, and drop a prize into the drop chute.
At the moment, the claw is only able to grab around the physics bodies. In the future, I'd like for the claw animation to be blended with the physics collision so that the physics collision is able to stop the animation of the claw when the pincers collide with the prize. This would provide for more variability in the way the prizes are picked up, hopefully allowing for the ability to pick prizes up by the smaller physics bodies, like limbs.
RANDOM PRIZE SPAWNING
he prize spawning and randomly populating the machine with prizes was a somewhat challenging dilemma. I couldn't spawn the prizes all at once from one location. Doing so made the physics assets collide with each other, explode, and get stuck in the walls of the crane game machine. Here are my solutions:
The spawning of the prizes is done within the Level Blueprint. It's a for loop that runs until it reaches the number of max prizes set to fill the machine. The spawn determines which prize class it is spawning by a random number chosen each time it runs through the for loop. The number of prizes is set by Number of Prizes user input exposed for the CGPrize Blueprint. Each time a random location is chosen from a custom function I set up that chooses between two different custom spawn zones defined by the min and max coordinates of cubes. I set up two cubes to define the spawn zones to avoid spawning prizes over top of the drop chute. On spawn, one of the spawn zones is chosen by a random number (1 or 2), like flipping a coin. All prizes are spawned at a constant Z height, but the X and Y are chosen randomly as floats between the range of the min and max coordinates of the X and Y of the cube.
HUD & SCORE
This is very basic at the moment, but screenshots of my Blueprints graph are soon to come. For this semester, I just wanted a basic indicator of the recognition of a prize being dropped into the chute. It is essentially an invisible cube positioned within the area of the drop chute that triggers overlap events when it is overlapped by the plush prizes. When overlapped, it sets off a chain of resulting functions, such a sound trigger and a call to the update score function. The update score adds to the score total variable, casts the score to a string and feeds it into an update to the Draw Text, a HUD function.
As a next step, I'd like to add in a timer, and instead base the points system around a fulfilling of specific achievements in that allotted time.
I've also made some graphical elements like a score panel that I'd like to begin to implement by drawing a texture to the screen. I've done some work to make sure that the drawn elements hold their place on the screen and scale properly with a rescaling of the screen dimensions.
I created a few more prizes to fill up the machine, and more are underway! It's quite a fun process to make these. For all of them, I have started with ZBrush's ZSpheres to block out the form of the prize, and it's basic armature, sculpted them to a high level of detail, retopologized and UVed them using 3D Coat, then hand-painted the texture maps for PBR materials using Substance Painter and Photoshop.
You can view the prizes so far here.
I added wonderfully cheesy background music to the game, recorded from a real life crane game machine, and then edited and cut to loop annoyingly as you struggle to pick up prizes. Additionally, there is a sound trigger that randomly chooses a sound effect to play every time you get a point. Sound adds a lot of refinement and character to the game, so I'll definitely be adding more. As of now, the sound effects come from RIT's School of Film & Animation sound library.
FUTURE OF THE STUFFGRABBER
I really have enjoyed working on this project, and I have so many more ideas for it that I'm able to pursue now that I have the base down. I'm really excited to keep developing this game this summer, and would love to eventually release it publicly to play. I'll be posting a video playthrough soon on The Stuffgrabber project page. Stay tuned!