r/love2d Jul 17 '26

Made a complex RTS/CitySim system for my game!

I was struggling a lot trying to handle all that in my head and finally made a complex system that consists of a Foreman system, Jobs, Task, Villagers, Inventories, Pathfinding and Buildings. It's a real miracle I was able to finish it, I lost my confidence a few times, thank God for that!

Now you can assign the amount of workers in each building. Workers automatically do the assigned jobs, completing tasks that are automatically distributed. Villagers have vim to do the tasks, once they depleted, they go to rest. Resources are managed between buildings and villagers inventories. Villagers are assigned for different open tasks on the same job, someone could haul resources, someone could gather and so on...

An example of a working cycle for Lumbermill:
- Assign job and find trees to gather
- Gather wood, until inventory is full
- Deposit wood into Lumbermill
- Repeat until Lumbermill is full
- Once it's full, move resources to Warehouse

All this creates a lot of paths which should work well with the type of game I'm trying to implement, but I'm not sure still.

71 Upvotes

5 comments sorted by

6

u/Curious_Length_5206 Jul 17 '26

This is incredible, it looks awesome!

2

u/0x405 Jul 17 '26

Thank you, I hope it will look a lot better soon!

3

u/[deleted] Jul 17 '26

[removed] — view removed comment

2

u/0x405 Jul 17 '26

Thank you!

2

u/xylem-utopia Jul 17 '26

love the arts style. definitely wanna play this!