Spidertron squad control [0.5.0 BETA RELEASE]


adds a spidertron squad remote so you don't have to use 100 remotes to control your spider army. also adds a follow mode for your spider army. And a better entity-follow tool that doesn't require you to link every single spidertron individually Beta versions available on GitHub for testing: https://github.com/npc-strider/spidertron-squad-control/releases

Utilities
4 years ago
1.0 - 1.1
7.48K

b Spidertrons move in opposite direction when controlled whilst in follow mode + strange bit of code

4 years ago

v0.4.0 (current dev branch)

Select a group with the squad remote shortcut
Turn on follow mode
Connect a normal remote to one of the group
Click anywhere else, and that one goes to that location, but the others go in the opposite location

I suppose that I'd expect them to not respond whilst they are in follow mode?


I'm trying to understand your mod in order to finish the Spidertron Waypoints compatibility, but this section of code has me confused: https://github.com/npc-strider/spidertron-squad-control/blob/dev/control.lua#L237-L278
It is the bit that causes the above (presumably wrong) behaviour, but I can't work out when it as supposed to be used. Getting rid of it fixes the above issue (well almost... ideally you'd cancel the autopilot straight away in the deleted section instead of waiting for on_nth_tick to catch it, but it doesn't make much difference). I can't find any other part that it affects. Is there something that I'm missing?

4 years ago

yeah, that's a bug I've tried to narrow down but it's weird
The code there is to allow the regular/vanilla remote to move the position of a specific spidertron in the squad, and save the position relative to the center of the squad (need to update dy and dx for all spidertrons, so there's many loops and messy code). I can't really narrow down what's causing the spidertron opposite walk, because sometimes it occurs but other times it doesn't (I need to check this specific case because I might be experiencing the issue in a different scenario - could not find a scenario to produce the bug before)

4 years ago

Oh ok, that's interesting. My only input would be that I'd have assumed that controlling a single spider with a remote would remove it from the squad. Very happy for you to disagree though :D

Thanks for making the mod btw, its impressively easy to use, especially considering the limitations of the base game API.

4 years ago

yeah, originally I wasn't doing this but a user asked and it sounded like it would add a lot of value in combat situations. of course, it also added a ton of bugginess. Going to try and fix it soon

4 years ago

alright I found a little bit of time to work on this issue, and it seems like this is 'expected' behaviour (but it looks seriously buggy)
I've added a hack that if a player is not in a spider vehicle and moves a spider's position using the vanilla remote, the follow mode disables.
the reason why it's 'expected' is because when the player is not in a spider vehicle that is in the squad, the player becomes the 'mean position' of the squad. when the player moves the spider, this mean changes so the other spiders move in the opposite direction to counteract the change in the mean (I think that's what's happening). of course this looks really buggy so I implemented that hack.
i'm not sure how to fix this without revamping the system. the mean system seems to work well because if a 'leader' spider dies, then the whole squad could disconnect from the player, but It also results in stuff like this happening. I'm not sure if there's a better solution and im open to suggestions
I'll be working on the mod integration some time, just having a lot happening IRL.

4 years ago

Thanks for the update. Again, take your time, I'm in no rush as I have more than enough other stuff to be getting on with!
What you do with that section of code doesn't really affect me. If I can't get it working with my integration, then I'll just conditionally disable it when needed.
However, I think that I do need some way to handle multiple squadrons at once, so ideally your code would have a table of squadrons instead of a just keeping track of a single squadron at once. If your happy for me to have a go at this, I'd willingly give it a try, but it would require more substantial changes than what I've done so far in my PR.

4 years ago

hello, i'm 2 months late (oof) but I've commented a bit on the pr with an update on the situation :)

2 years ago

i found to remove one controlled unit from the squad. and just get the remaining squad to follow it. then use the vanilla controller on the lone unit and the rest behaves like it should.

New response