Tin Mining by rubenwardy

Manage a Cornish tin mine, placing orders for the workers to mine and build
The year is 1790, and the Cornish tin industry is booming. You are a businessperson who has just secured investment to build a mine. The area is known to be rich in tin, which is in high demand.
Rather than controlling your workers directly, you drag out plans for tiles to be mined and built on. The workers will mine tunnels and build where ordered. They will carry mined resources to the surface to be sold.
The map is procedurally-generated, and the workers use behaviour tree based AI with a work queue. Behaviour trees make it easier to make extendable NPC behaviour, which will be useful post LD.
This is my first Ludum Dare, I started this a day late, and had to work on Monday - so this only contains the bare minimum gameplay. I had planned to add hazards, buildings to prevent hazards, and a tech tree. For example, gas explosions and toxic gas is quite a problem in mines, as well as flooding from the nearby sea.
This is a solo project, and all code and art is original.
Controls
- Pan: Right-click drag / middle-click drag / arrow keys to pan
- Zoom: scroll wheel
- Select tools from build menu, and then:
- Left-click and drag to place orders.
- Esc to cancel the tool.
- Tip: you can order workers to mine and build a ladder on the same tile, and they will mine and then build a ladder.
Troubleshooting
- Workers may get stuck as the pathfinder is quite picky:
- Make sure that the worker doesn't need to jump down more than one tile to get to the target.
- Make sure that they can get to one of the 4 neighbouring tiles (above/below/left/right) of their target. You can build ladders to help them reach places.
Changelog
- Fixed not being able to build from neighbouring node
- Fixed workers getting stuck due to path invalidations
- Fixed incorrect pathfinder weightings
- Fixed item transport interrupting other work
- Fixed tin ore item having the wrong texture
- Fixed update issues due to uncapped dtime
- Reduced weight of ladder nodes to fix pathfinder timeouts
- Fixed broken entity failure lock causing MoveItem saturation
- Fixed weird back-and-forth when dropping off items
- Fixed missing collision check when leaving ladder vertically
Screenshots


Desktop only: this game won't work on mobile.
| Link | https://rubenwardy.com/ld48_cornish_mines/ |
| Link | https://gitlab.com/rubenwardy/cornish_mines |
| Original URL | https://ldjam.com/events/ludum-dare/48/tin-mining |
Ratings
| Overall | 907th | 3.52⭐ | 27🧑⚖️ |
| Fun | 1071th | 3.24⭐ | 27🧑⚖️ |
| Innovation | 806th | 3.3⭐ | 27🧑⚖️ |
| Theme | 355th | 4.04⭐ | 27🧑⚖️ |
| Graphics | 1040th | 3.58⭐ | 27🧑⚖️ |
| Given | 29🗳️ | 27🗨️ |
It seems like AI does work fine with simple instruction but it gets buggy at some point and I don't really know what is the cause.
Here are some thought of what could cause them :
- I did test mine and ladder on single tile > it works fine
- when selecting a range of tiles with mine or ladder, some workers seems to get stuck ? I'm not sure
- when I order to mine an already mined tile, i think the worker will still go there and then get stuck? > not sure as well
- when switching tabs on the web browser and then come back, some workers get stuck and no longer move > this one does seem to be consistent. (I'm on Firefox)
Besides these, it's a great game ! Congrats on your first ludum dare ! :tada:
--------------
@gcake I believe I have fixed the issues you mentioned:
- The changing browser tabs issue was a simple broken limit on delta time
- I found a bug in how the job queue marked Move Item jobs as impossible. After a while, this would have resulted in the workers constantly trying to do impossible jobs, causing them to freeze up
--------------
@globulous not sure what you mean by "blocked at a moment". If it's regarding workers being stuck, then read above :)
This is a really nice first game, especially considering the amount of time you had to make it in.
I'll probably keep this open in the background while I rate LD games. I must mine the entire earth!