Goblins mobbing your town?

Hey Everyone,

It was definitely not our intention to starve/swamp you all with waves of goblins. They’re supposed to come out on a regular drip-feed schedule. For those who are seeing giant waves, we suspect that your terrain is such that your goblin AI/pathfinder is batching up. For long periods of time, the goblins that spawn can’t find your town, and then all at once, all of them find the path and charge in together. (This makes them look smarter than we intended, I guess.)

We’re looking into this right now, but I don’t expect an easy fix any time soon. Here are some modding solutions in the interim:

a.) Crank down their stats! In stonehearth\entities\monsters\goblins\goblin\goblin.json, find their attributes component and lower their max health, speed, and menace to whatever number that you find more palatable.

b.) Make them spawn less often! If you’re into recompiling lua, hack at the “time till first spawn” and “spawn interval” numbers at the top of stonehearth\services\server\linear_combat\linear_combat_service.lua till you like the flow of the combat.

c.) If you want to turn off combat entirely, in stonehearth/stonehearth_server.lua, remove the linear_combat entry on line 32.

If you engage in either a or b, I’d love to see the stats you prefer playing at; post them here!

For those of you who see no goblins, ever, try making a town in the middle of a big flat open space.

Edit: We will definitely implement c.) as a game option in an upcoming release.

16 Likes

Thanks, I love how you guys help out so much :smile:

3 Likes

Hey @sdee Before you posted this I released this hotfix :slight_smile: Hope people like it! It does just number 1. Its kinda an inconvenient install, because I don’t know exactly how to structure a .smod with mixins. Is there a tutorial somewhere? I just need to mixin one file.

1 Like

Also, when will stone swords make it into the game? Maybe in alpha 4?

Well, alpha 4 has been officially released, so probably not that. However, the mason (well, one of the two lines saying “mason”) shows as being in progress in the dev roadmap.

2 Likes

Awesome!!!

Try some of the resources in this thread. The short version is that you create a folder that will be a peer to stonehearth.smod. The manifest.json and the mixinto file in your folder will insert the right code into stonehearth.smod.

5 Likes

Thanks, btw I don’t think I’ve ever seen such a community orientated dev team, you guys are great!

4 Likes

ikr they are awesome!

2 Likes

Thanks for the help, I released an actual .smod

Is there some type of cheat i could do to spawn in some goblins to see if it works?

1 Like

Right now you’d have to modify some lua. You can do b.) above and set the first spawn time to 1h and the interval to 1h and see what happens. :wink:

You can also call in the goblins directly if you have some lua code that you know will run; for example if you have a timer in a lua component associated with a craftable item that has been placed in the world:

stonehearth.dynamic_scenario:force_spawn_scenario(‘stonehearth:scenarios:goblin_thief’)
stonehearth.dynamic_scenario:force_spawn_scenario(‘stonehearth:scenarios:goblin_brigands’, { num_escorts = 1 })

Thanks for the help, I’m not into LUA,for some reason I don’t like it. I like C# or C++ better. LUA just seems like it has to much puncuation rather then words.

I pulled down the smod file to give it a try. However, I started noticing random game crashes that were not happening before. This was in the stonehearth.log file:

2014-Aug-20 14:41:45.367573 | 0 |                         lua.code | -- Script Error (lua) Begin ------------------------------- 
2014-Aug-20 14:41:45.367573 | 0 |                         lua.code |    stonehearth/components/ai/execution_frame.lua:1396: stonehearth/components/ai/execution_frame.lua:1396: stonehearth/components/ai/execution_frame.lua:1396: stonehearth/components/ai/execution_frame.lua:1396: stonehearth/components/ai/execution_frame.lua:1396: stonehearth/components/ai/execution_frame.lua:1396: stonehearth/components/ai/execution_frame.lua:1396: std::exception: 'invalid file path '/goblins/data/rigs/monsters/goblin'.'
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    stack traceback:
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    	stonehearth/components/ai/execution_frame.lua:1338: in function <stonehearth/components/ai/execution_frame.lua:1329>
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    	[C]: in function 'error'
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    	stonehearth/components/ai/execution_frame.lua:1396: in function '_exit_protected_call'
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    	stonehearth/components/ai/execution_frame.lua:1385: in function '_protected_call'
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    	stonehearth/components/ai/execution_frame.lua:777: in function '_run_from_started'
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    	stonehearth/components/ai/execution_frame.lua:170: in function '_run'
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    	stonehearth/components/ai/execution_frame.lua:497: in function <stonehearth/components/ai/execution_frame.lua:481>
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    	[C]: in function 'xpcall'
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    	stonehearth/components/ai/execution_frame.lua:1342: in function '_protected_call'
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    	stonehearth/components/ai/execution_frame.lua:507: in function 'run'
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    	stonehearth/components/ai/ai_component.lua:319: in function '_thread_main'
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    	stonehearth/services/server/threads/thread.lua:210: in function <stonehearth/services/server/threads/thread.lua:207>
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    	[C]: in function 'xpcall'
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code |    	stonehearth/services/server/threads/thread.lua:207: in function <stonehearth/services/server/threads/thread.lua:199>
2014-Aug-20 14:41:45.368573 | 0 |                         lua.code | -- Lua Error End   ------------------------------- 

It looks like it gets thrown whenever the game tries to spawn in the goblins. Not certain that this is due to the mod or not, just something new I noticed.

1 Like

@Nicedude80, maybe double, triple, quadruple check that your mixintos are overriding the right file? There are 2 goblin.json files; one is a rig and one is the actual entity description.

1 Like

@sdee I don’t exactly see what you mean,in the stonehearth/entities/monsters/goblins/goblin/ folder there is only 1 goblin.json. And I believe my manifest is ok.

EDIT: I see what you mean now, and yes, it is going into the right file. I am not touching the rig file.

1 Like

hello there,

would truly build up a little town … but i can’t find the stonhearth_server.lua in my folder? Neither the folder entities …
cleaning my googles … i think they should in the mainfolder above steam/steamapps/common/stonehearth … or i understood something wrong?

But until now, the game feels more and more comfortable ^^

best regards

madda

Ok, just checking. @gryffonx’s error looks like it has to do with not finding a file where it thinks the rig should be. Anyway, I’ll let you guys debug this one. :wink:

Ah, right, Steam and Humble Bundle put the files in different places. For Steam, my path looks something like:

Steam\SteamApps\common\Stonehearth\mods\stonehearth\stonehearth_server.luac

The luac is decompiled lua. Various people here have had luck recompiling it, and editing it to get it to work like a normal text file. Check out this thread here: Stonehearth Modding FAQ

1 Like

Hmmm, well this is what is in the manifest:

{
   "info" : {
      "name" : "Goblins"
   },

   "overrides" : {
      "stonehearth/entities/monsters/goblins/goblin/goblin.json" :"goblins/overrides/goblin.json"
   }
}

And the structure of the inside of my .smod is like this:

smod/goblins/manifest.json
smod/goblins/overrides/goblin.json

1 Like

And post your goblin.json?

Right sorry I was afk. There ya go @sdee

{
“type”: “entity”,
“mixins” : “stonehearth:mixins:mob”,
“components”: {
“render_info” : {
“animation_table”: “file(/data/rigs/monsters/goblin)”
},
“model_variants”: {
“default”: {
“models”: [
{
“type”: “one_of”,
“items”: [
“file(goblin_head_1.qb)”,
“file(goblin_head_2.qb)”,
“file(goblin_head_3.qb)”
]
},
“file(goblin_body.qb)”
]
}
},
“stonehearth:ai”: {
“actions” : [
“stonehearth:actions:idle:sway”,
“stonehearth:actions:idle:look_around”,
“stonehearth:actions:wander”,
“stonehearth:actions:wander_within_leash”,
“stonehearth:actions:wander_when_bored”,
“stonehearth:actions:choose_point_around_leash”,
“stonehearth:actions:wait_for_attribute_above”,
“stonehearth:actions:wait_for_attribute_below”,
“stonehearth:actions:combat”,
“stonehearth:actions:combat:attack_after_cooldown”,
“stonehearth:actions:combat:attack:melee”,
“stonehearth:actions:combat:attack:melee_adjacent”,
“stonehearth:actions:combat:defend_dispatcher”,
“stonehearth:actions:combat:defend:melee”,
“stonehearth:actions:combat:idle_dispatcher”,
“stonehearth:actions:combat:idle:ready”,
“stonehearth:actions:combat:idle:shuffle”,
“stonehearth:actions:combat:hit_stun”,
“stonehearth:actions:chase_entity”,
“stonehearth:actions:restock_stockpile”,
“stonehearth:actions:reserve_stockpile_space”,
“stonehearth:actions:work_task_dispatcher”,
“stonehearth:actions:place_item”,
“stonehearth:actions:stockpile_arson”,
“stonehearth:actions:follow_entity”,
“stonehearth:actions:combat:create_engage_callback”,
“stonehearth:actions:combat:get_melee_range”,
“stonehearth:actions:combat:get_primary_target”,
“stonehearth:actions:combat:set_global_attack_cooldown”,
“stonehearth:actions:combat:wait_for_global_attack_cooldown”,
“stonehearth:actions:set_posture”,
“stonehearth:actions:unset_posture”
],
“observers”: [
“stonehearth:observers:aggro”,
“stonehearth:observers:find_target”,
“stonehearth:observers:health_score”
]
},
“unit_info” : {
“name”: “A Goblin”,
“faction”: “goblin”,
“description”: “Attracted to shiny things”
},
“sensor_list”: {
“sensors”: {
“sight”: {
“radius”: 64
}
}
},
“stonehearth:attributes”: {
“max_health”: {
“type” : “basic”,
“value” : 1
},
“health”: {
“type” : “variable”,
“equation” : “max_health”
},
“speed”: {
“type” : “basic”,
“value” : 80
},
“ferocity”: {
“type” : “basic”,
“value” : 1
},
“menace”: {
“type” : “basic”,
“value” : 1
},
“courage”: {
“type” : “basic”,
“value” : 1
}
},
“stonehearth:carry_block”: {
},
“stonehearth:posture”: [
]
},
“entity_data” : {
“stonehearth:entity_radius” : 0.75,
“stonehearth:entity_reach” : 1.0,
“stonehearth:combat:melee_attacks” : [
{
“name” : “combat_1h_forehand_spin”,
“active_frame” : 21,
“cooldown” : 8000,
“priority” : 1
}
],
“stonehearth:combat:melee_defenses” : [
{
“name” : “combat_1h_dodge”,
“active_frame” : 8,
“cooldown” : 12000,
“priority” : 1
}
]
}
}

1 Like

Thanks! Hm, off the top of my head it might be that the relative paths inside your json aren’t working right because they’re relative from your mod folder instead of the target entity folder. As @gryffonx’s post said, ‘/goblins/data/rigs/monsters/goblin’.’ just isn’t a path that exists inside either your goblins mod or the stonehearth mod itself. Instead, try making your override a mixinto so that it only has to mention the 4 values you’re changing. And of course, test it out on your machine and whatever volunteers are interested.