[MOD 0.18] Robot Army. v0.4.4

Topics and discussion about specific mods
dauphin
Inserter
Inserter
Posts: 38
Joined: Fri Aug 19, 2016 1:59 am
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by dauphin »

wow. Lua doesn't have a continue statement. Been awhile since I've seen a `goto`, but apparently that's standard practice for Lua. Huh. https://stackoverflow.com/questions/352 ... -statement

User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by aubergine18 »

The goto statement is actually more useful than a continue statement, because it allows you to both emulate continue and also break out of multiple loops depending on how you use it. :)
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.

dauphin
Inserter
Inserter
Posts: 38
Joined: Fri Aug 19, 2016 1:59 am
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by dauphin »

aubergine18 wrote:The goto statement is actually more useful than a continue statement, because it allows you to both emulate continue and also break out of multiple loops depending on how you use it. :)
Of course it's more useful. It's also far more dangerous.

I understand the reasons why goto is still occasionally used. I have even been tempted to use it myself, sometimes for the very case you're describing. Ultimately, though, I often find my desire to break out of multiple loops to be a sign that my code needs rethinking.

And as a replacement for a simple 'continue', it is most certainly not preferable. :)

dauphin
Inserter
Inserter
Posts: 38
Joined: Fri Aug 19, 2016 1:59 am
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by dauphin »

Couple of things to report from the multiplayer session tonight:

1) It would be nice if the Deconstruction Planner could send your Construction Bots to pick up spawned Robot Army robots. Both from a general usability/convenience perspective, and also because, during multiplayer where one system has significantly higher UPS than the other, I found that it was often impossible for the slower computer's player to pick up any of the bots. They would immediately be re-placed as soon as communication with the server had taken place, presumably because the pickup didn't happen during some sort of server interval. This isn't limited to Robot Army at all, but it is also an issue that never seems to happen with either constructing or deconstructing with construction bots.
2) My wife believes she observed a case where some 'lost' robots (that also no longer had radar vision) ended up joining a working squad. I have not observed this behavior, but I think it is worth reporting.
3) We eventually had a 'crash' in Robot Army. The stacktrace was as follows:

Code: Select all

  32.260 Error MainLoop.cpp:747: Exception at tick 18969186: Error while running event on_tick (ID 0)
position not specified
stack traceback:
	__robotarmy__/robolib/Squad.lua:95: in function 'checkMembersAreInGroup'
	__robotarmy__/control.lua:338: in function 'runTableTickUpdates'
	__robotarmy__/control.lua:173: in function 'onTickHandler'
	__robotarmy__/control.lua:291: in function <__robotarmy__/control.lua:290>
Related screenshot: https://www.dropbox.com/s/clunpqeqta3oc ... 9.png?dl=0
I can share the savefile if desired, though there are about 20 mods enabled on it, so it won't be a breeze to get set up to load it on your own system.

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by kyranzor »

Hey thanks for more testing!

I will debug that "position not specified" crash in the "checkMembersAreInGroup" function tonight while i'm testing the other person's game save they asked me to check.

Lua Goto statement was a hack because "continue" doesn't exist and I didn't want to break out of my entire nested-if (which in factorio is basically required, with all the stupid input validation you need to do). The way around using goto is to function-ize the code that would normally be skipped, and simply use "return", which is exactly what I did with the refactored new functions which are just passed a squad instead of how it was used before. So hopefully i can remove the nasty gotos.

I don't think "lost" squads can join other squads, my code shouldn't be able to handle that situation. So, she may have seen something else going on...

dauphin
Inserter
Inserter
Posts: 38
Joined: Fri Aug 19, 2016 1:59 am
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by dauphin »

kyranzor wrote: Lua Goto statement was a hack because "continue" doesn't exist and I didn't want to break out of my entire nested-if (which in factorio is basically required, with all the stupid input validation you need to do). The way around using goto is to function-ize the code that would normally be skipped, and simply use "return", which is exactly what I did with the refactored new functions which are just passed a squad instead of how it was used before. So hopefully i can remove the nasty gotos.
Yep, makes perfect sense, and frankly, I don't fault you for using the goto. Under the circumstances, it was the easy way out. Maybe I can help with refactoring if I get some time later this week to look through, and then submit a pull request.
kyranzor wrote: I don't think "lost" squads can join other squads, my code shouldn't be able to handle that situation. So, she may have seen something else going on...
I suspected as much. Mentioned it just in case. :)

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: [MOD 0.14.3] Robot Army. 0.2.3

Post by kyranzor »

b38917ce-3ad3-4fae-b wrote:
kyranzor wrote: I can have upwards of 1200 droids actively slaughtering biters, before I see any performance impact.. maybe my computer is just a beast?
I'm curious about this: do you mind trying the save I linked in this post and comparing your timings to mine?
I checked out your save as you requested. LOL terminators with 21,000 HP? but the health scale in the config file was only 3.0 ... how? did you edit the unit's base HP as well?

Anyway, during engagements, my pathfinder update time each tick went from 0.5 ms to 1.5ms peaks, but average was definitely more like 0.5 - 0.7 where the peak of 1.5ms was rare.

It does seem like the units are making quite a lot of requests to the pathfinder during combat, probably constantly trying to re-path towards their targets and get in optimal firing range.




To Dauphin: I just updated Development branch with fixes to the crash you experienced.

b38917ce-3ad3-4fae-b
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Aug 31, 2016 8:43 am
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by b38917ce-3ad3-4fae-b »

I initially intended them to have tons of hp and no damage so that the behavior could be better observed, but I didn't take the save in the right place so I just reverted the damage.
Could've done it via config, but I messed with some other things as well so I didn't bother.
What machine are you using, if I may ask?

By the way, I noticed that you have an issue on your repo about changing the droid color on the map. I'm not sure if you haven't gotten around to it or if you have something more complex in mind, but

Code: Select all

friendly_map_color = {r = .05, g = .70, b = .29}
on the unit's prototype seemed to do the trick for me.

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by kyranzor »

b38917ce-3ad3-4fae-b wrote:I initially intended them to have tons of hp and no damage so that the behavior could be better observed, but I didn't take the save in the right place so I just reverted the damage.
Could've done it via config, but I messed with some other things as well so I didn't bother.
What machine are you using, if I may ask?

By the way, I noticed that you have an issue on your repo about changing the droid color on the map. I'm not sure if you haven't gotten around to it or if you have something more complex in mind, but

Code: Select all

friendly_map_color = {r = .05, g = .70, b = .29}
on the unit's prototype seemed to do the trick for me.
Hey that's cool, i'll add the map colours to my droids in my current test code and if that solves it, then jolly good! Thanks for that! I hadn't bothered looking into it yet, so you saved me some time :)

My machine specs are: Intel i5-4590 @ 3.3GHz (4 cores), 16GB DDR3@1600Mhz RAM, Nvidia GTX 960, running windows 10.

edit: yep, the map colours for the droids are now a bright green. awesome! can anyone think of a better colour? white might be a good option

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by kyranzor »

Dev branch updated to contain two fixes to possible error situations introduced by fixing the bug before lol.

The map colours are in now, for the 4 droids (not the flying robots yet). It's just the bright green as suggested in the code shown earlier.

Should be stable enough for some good testing! I would like to know how people's performance goes with the new tick schdule system. Shouldn't be large 1 second lag spikes anymore.

dauphin
Inserter
Inserter
Posts: 38
Joined: Fri Aug 19, 2016 1:59 am
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by dauphin »

Will give this a try tonight. I'll let you know if I run across any issues!

dauphin
Inserter
Inserter
Posts: 38
Joined: Fri Aug 19, 2016 1:59 am
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by dauphin »

Gave it a couple of hours. Performance still feels smooth, which is great.

Also, the new green color for the robots is awesome. Helps a ton with scanning the map.


I currently have a large group that seems like it ought to be doing something, because there are biters being engaged by a different squad maybe 4 or 5 chunks away. But they're just milling around, though they're still active. Thoughts?

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by kyranzor »

dauphin wrote:Gave it a couple of hours. Performance still feels smooth, which is great.

Also, the new green color for the robots is awesome. Helps a ton with scanning the map.


I currently have a large group that seems like it ought to be doing something, because there are biters being engaged by a different squad maybe 4 or 5 chunks away. But they're just milling around, though they're still active. Thoughts?
Using F4 settings change it so F5 overlay shows "unit group info" or whatever, and then use F5 and have a look at the squad. Where is their position ring? how scattered are all the members? A screenshot might help with this bit.

User avatar
MrGrim
Fast Inserter
Fast Inserter
Posts: 231
Joined: Sat Apr 09, 2016 7:58 pm
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by MrGrim »

I'm also having trouble with squads mostly just standing about. I think it's because they might be selecting targets they can't get to. Either they're in a part of the map that's walled off or they're busy in a sort of re-grouping loop. I decided to try for flying units to see if their flying ability would make them less likely to get stuck, but they don't seem to really fly in that they are affected by belts, cannot traverse water, and are also blocked by walls. I had one group of destroyers get stuck at a mining outpost just being dragged all over by the belts. Another group of destroyers targeted some biters in an island (I think, based on the pathing debug overlay) and couldn't get to them. Another group of destroyers flew through the middle of my base and just couldn't deal w/ the main bus. I'm using the current development branch. Shouldn't flyers be immune to belts and structures?

Prior to trying the flying units I was deploying terminators at a forward post just beyond my perimeter defense walls. At first things were going great, but as they cleared a larger and larger area squads would simply idle despite having a target rich environment inside the 5000 tile hunt area. I suspect they were also trying to target enemies that pathing wanted them to traverse the wall to get to, but I'm not sure.

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by kyranzor »

MrGrim wrote:I'm also having trouble with squads mostly just standing about. I think it's because they might be selecting targets they can't get to. Either they're in a part of the map that's walled off or they're busy in a sort of re-grouping loop. I decided to try for flying units to see if their flying ability would make them less likely to get stuck, but they don't seem to really fly in that they are affected by belts, cannot traverse water, and are also blocked by walls. I had one group of destroyers get stuck at a mining outpost just being dragged all over by the belts. Another group of destroyers targeted some biters in an island (I think, based on the pathing debug overlay) and couldn't get to them. Another group of destroyers flew through the middle of my base and just couldn't deal w/ the main bus. I'm using the current development branch. Shouldn't flyers be immune to belts and structures?

Prior to trying the flying units I was deploying terminators at a forward post just beyond my perimeter defense walls. At first things were going great, but as they cleared a larger and larger area squads would simply idle despite having a target rich environment inside the 5000 tile hunt area. I suspect they were also trying to target enemies that pathing wanted them to traverse the wall to get to, but I'm not sure.
Hi Mr Grim,

The flying units being affected by belts and walls and water is unfortunate, because even though I set the collision box size to 0,0,0 and they truly can cross those areas, they cannot path through them because of the biter AI pathfinding (which assumes some kind of collision even if it's infinitely small). I have been meaning to put in a request/bug report to allow units with a 0 collision box to be immune to belts and other obstacles but I haven't done this yet.

The retreat mechanic is currently broken in that squads will only retreat at 2 members, and ignore the settings from the settings module.

The pathfinder will not work if an area is fully walled off too. Can't be pathed into or out of it.

Having truely flying robots would be great but the game engine doesn't support that it seems, so it will have to be a request, which Oxyd most likely would implement if we ask nicely :) .

Can you try to observe one of your squads and using the debug overlay with "unit group info" on and pathfinder shown as well, a screenshot of the squad with all of this turned on might help me work out what's going wrong with them.

Thanks for choosing Robot Army, I look forward to helping you through this difficult time ;)

LightDefiant
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Feb 05, 2015 3:53 am
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by LightDefiant »

Just had a thought that would make this mod even better. Hopefully others reading it can help flesh it out since it was just a random thought.

The ability with trains to actually look and see what a train is doing from long distance would be a great ability have with your droids (I'm a Star Wars nerd, they will always be Droids to me :P). So when they are roaming on the other side of the map, (especially when you are using RSO and the bots go FAR) You can select a squad (and have a quick peep through their robot eyes to see how they are doing (or just to get your biter slaughter fix, whatever floats your boat :P ). The "fire and forget" part of Robot Army is great, but I would like SOME interaction with the droids.

Like I said just a thought. :)

b38917ce-3ad3-4fae-b
Burner Inserter
Burner Inserter
Posts: 11
Joined: Wed Aug 31, 2016 8:43 am
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by b38917ce-3ad3-4fae-b »

That would certainly be nice to have, was thinking of it myself.
Not only will this allow you to see what they are doing, but you would also get some insight into how many squads you actually have if you have a GUI listing them.
It would be even better if the UI would also show what state the squads are currently in, since it happened to me more than once to not realize that a squad wasn't at its minimum hunting size and was just sitting around, apparently for no reason.
But it's probably a good chunk of work implementing this.

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by kyranzor »

as i've been saying for a while now, I want to add an "RTS" mode building/command centre where you can move around without a body and view teh battlefield, and maybe while in this mode, have "command capsules" that you use to select and command squads directly. Line of Sight is provided by the squads or your factory's radar coverage. Is this good enough? Not quite the same as a little train preview window, but perhaps better.

User avatar
MrGrim
Fast Inserter
Fast Inserter
Posts: 231
Joined: Sat Apr 09, 2016 7:58 pm
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by MrGrim »

kyranzor wrote:Can you try to observe one of your squads and using the debug overlay with "unit group info" on and pathfinder shown as well, a screenshot of the squad with all of this turned on might help me work out what's going wrong with them.

Thanks for choosing Robot Army, I look forward to helping you through this difficult time ;)
Thanks! :) Would a save be better? You can ignore the other mods in the save. In it you'll find my first attempt at using a rally point to zap some of the stuck squads. It didn't seem to work. You should be able to see 3 stuck squads; one far west, one far east, and one near south(ish) of the player position. There's 2 or 3 active squads to the southeast.

https://dl.dropboxusercontent.com/u/969 ... d-bots.zip

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: [MOD 0.14.7] Robot Army. 0.2.3

Post by kyranzor »

Hey Mr Grim, sorry about the delay, i've been super busy. I'll check out your save game some time in the next few days!

Post Reply

Return to “Mods”