The best way to simulate this flint knapping minigame?

Started by Scavenger, Wed 05/10/2016 08:01:45

Previous topic - Next topic

Scavenger

I have a puzzle in my game where you need to make a stone tool, and I really want to use a tactile stone knapping thing to shape it instead of just combining items. There was a game called Sapiens that had this kind of minigame in it where you worked away at the edges of a stone plate to create a hatchet or something:
[imgzoom]https://dl.dropboxusercontent.com/u/50882197/art/GameStuff/knapping.gif[/imgzoom]
The idea was that you struck at the stone by holding down the mouse button, and the longer you held it down, the harder it hits. Small taps can get rid of that bright yellow area, but large strikes are required to get those in the first place. I know how to do the controls, and I'd be able to draw the assets, but I have no idea how I'd program the shape detector, or bits chipping off of it. I don't need anything super realistic, but I'm not sure how to approach the problem itself. Does anyone have any suggestions as to where I can begin?

RickJ

What if the work piece were composed of a grid of objects?  Each object would be assigned a view composed of a number of frames.  When a blow is struck the force is calculated as you say by the length of time the button is down.  The force could be applied to a single object at the XY position of the strike or it could be distributed over the area surrounding the XY trike point.

For example use a floating point variable to hold the accumulated force applied to each object, with a range of 0 to 100%. Going past 100% would represent a flaw in the final piece (i.e. chipped off too much material). The strike force would be added to object accumulated force variables as follows:  Object at the strike point would feel 100% of the blow.  Adjacent objects would feel 50% and objects adjacent to the adjacent objects would feel 25%, etc.  As the accumulated forces increase the object frames would be advanced.  Of course some other distribution algorithm could just as easily be used.

Alternatively, you could use a dynamic drawing surface.  Instead of objects and frames you would have pixels and colors. 

SMF spam blocked by CleanTalk