• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Crop Farming Mechanic

Status
Not open for further replies.
Level 11
Joined
Apr 9, 2013
Messages
710
What kind of methods could I use to simulate simple crop farming that gives gold (not a custom resource). What if I only want it to be localised on a certain tileset (farm tiles)?
I had thought about a building that spawn hostile crop that can only be targetted by peasants killing it would give you gold (a more primitive version of that found in Dawn of Kingdoms).
The Werewolf transylvania one is also interesting but I do not know how to make it.

Can anyone provide me with an idea and help with the trigger?
 
Level 11
Joined
Apr 9, 2013
Messages
710
Well, I would rather not make it a simple income point system.

I have a farming system that I made using the Graveyard spawn corpse as base. It's simple in practice When corpse spawns, it will replace it with planted wheat. There are some downsides: because corpse gets replaced it doesn't spawn the corpses around the windmill but only north of it (that's how graveyard ability works, first corpse is always north). The biggest inconvenience is that you can't walk through the wheat as it has collision, if I remove collision the wheat will get spawned on top of eachother overlapping creating a mega wheat bundle. I tried giving it the walkable pathing but it still overlaps, I don't get why it doesn't overlap with magenta pathing. Anyone can come up with a solution to make the wheat walkable? (It needs to be walkable cause as you can see the ready crops are surrounded by unready crops and you can't harvest it.

There's not way to go around it so I need a new system. I wasted a lot of time with this system but I have to move on.

I need something that: simulates farming i.e. peasant does action/work (not income point) - gives gold - related to crop tileset.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
It really depends on the vision of the farms.

One approach would be a central building. When constructed it looks nearby for suitable ground and then builds dummy "field" objects on it. All fields are tracked by their owning farm using data structures like structs or Lua tables. The number of fields determines the income, up to some maximum field count per farm. When the farm is destroyed the fields associated with it also are. There might be some sort of optimisation logic that when placing a farm near other farms it tries to take over fields from that farm should the other farm have suitable place for more while that farm does not, possibly chaining or maybe implemented with a manual ability to additional assistance with field management.
 
Status
Not open for further replies.
Top