Page 4 of 36

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Wed May 04, 2016 5:07 pm
by Sanguion
Fantastic mod. I'm going to test the dev branch right now in MP.

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Wed May 04, 2016 5:20 pm
by Qloshae
Sanguion wrote:Fantastic mod. I'm going to test the dev branch right now in MP.
I love the mod, but will be better when it doesn't cause super fps drops. :P

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Wed May 04, 2016 5:39 pm
by Qloshae
Small fix I did personally to fix the lag since this is an awesome mod and the mod dev hasn't posted a fix yet. :P

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Wed May 04, 2016 7:57 pm
by kyranzor
Qloshae wrote:Small fix I did personally to fix the lag since this is an awesome mod and the mod dev hasn't posted a fix yet. :P
Can you mention what you fixed so I can integrate the changes?

Sanguion:
Tell me how you go. The terminators, clockwork rifle bots and rocket bots are working fine and join squads in the Dev branch. I can't remember if they will all spawn correctly from the Droid Assembler yet. I am in the middle of adding code to allow all spawable droids to be spawned by the droid assembler rather than the original code which only checked for and spawned the basic droid.

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Wed May 04, 2016 8:25 pm
by Qloshae
kyranzor wrote:
Qloshae wrote:Small fix I did personally to fix the lag since this is an awesome mod and the mod dev hasn't posted a fix yet. :P
Can you mention what you fixed so I can integrate the changes?
Did it over at Evolve and the zip is above, but here's all the code.

Code: Select all

TICK_UPDATE_SQUAD_AI = 0 --Not Checking for squad
DEFAULT_SQUAD_RADIUS = -1 -- No radius
SOLDIER_MAX_AMMO = 100
SQUAD_SIZE_MIN_BEFORE_HUNT = 1 --Can hunt from start
SQUAD_CHECK_RANGE = -1 --Not checking for squad
Spawned 500 droids and only lagged for a short moment then it went up to 50+ fps again.
You do get however 500 squads for 500 droids, but I didn't notice any issues.

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Wed May 04, 2016 8:29 pm
by kyranzor
Qloshae wrote:
kyranzor wrote:
Qloshae wrote:Small fix I did personally to fix the lag since this is an awesome mod and the mod dev hasn't posted a fix yet. :P
Can you mention what you fixed so I can integrate the changes?
Did it over at Evolve and the zip is above, but here's all the code.

Code: Select all

TICK_UPDATE_SQUAD_AI = 0 --Not Checking for squad
DEFAULT_SQUAD_RADIUS = -1 -- No radius
SOLDIER_MAX_AMMO = 100
SQUAD_SIZE_MIN_BEFORE_HUNT = 1 --Can hunt from start
SQUAD_CHECK_RANGE = -1 --Not checking for squad
Spawned 500 droids and only lagged for a short moment then it went up to 50+ fps again.
You do get however 500 squads for 500 droids, but I didn't notice any issues.
Do they run off and hunt?

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Wed May 04, 2016 8:36 pm
by Qloshae
kyranzor wrote:
Qloshae wrote:
kyranzor wrote:
Qloshae wrote:Small fix I did personally to fix the lag since this is an awesome mod and the mod dev hasn't posted a fix yet. :P
Can you mention what you fixed so I can integrate the changes?
Did it over at Evolve and the zip is above, but here's all the code.

Code: Select all

TICK_UPDATE_SQUAD_AI = 0 --Not Checking for squad
DEFAULT_SQUAD_RADIUS = -1 -- No radius
SOLDIER_MAX_AMMO = 100
SQUAD_SIZE_MIN_BEFORE_HUNT = 1 --Can hunt from start
SQUAD_CHECK_RANGE = -1 --Not checking for squad
Spawned 500 droids and only lagged for a short moment then it went up to 50+ fps again.
You do get however 500 squads for 500 droids, but I didn't notice any issues.
Do they run off and hunt?
Yep, that they do.
If you put update squad ai as -1, they don't however. I assume as they have to run through the squad AI before they can hunt.

EDIT: I btw. tried with like 5k droids and it only lagged while they couldn't figure out where the closest hive was since so many were dropped at the same time. After that it went back up.

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Wed May 04, 2016 8:51 pm
by kyranzor
Wow, thanks Factorio pathfinder. I cannot believe how ridiculous the difference is - 5k individuals or less than 300 in squads causing 15fps. That's silly.
Thanks for the testing.

Anyone who is interested, merely see the config.lua changes that Qloshae did and go change the values yourself with any text editor. The only important one (I wrote the code, and to me the only one which is really critical here) is the SQUAD_SIZE_MIN_BEFORE_HUNT = 1 to make them hunt, and SQUAD_CHECK_RANGE = -1 to mean they can never join a nearby squad (they will always make their own).

In theory, the tables will get quite large very quickly but Lua is all about tables so it will be okay for a while. The squad update tick value should be left alone, or even increased to 120 or 180 (60 ticks is 1 real world second).

I wonder if it's also related to squad radius? Like, if the radius was set to 0 or -1 maybe they do not keep formation (which I swear is half the FPS struggle, keeping formation).

If it's any consolation to those who like squad-based droids, Factorio 0.13 has been confirmed to contain a much better pathfinding subsystem than the current one, thanks to Oxyd. Rseding confirmed this on IRC the other day.

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Wed May 04, 2016 8:59 pm
by Qloshae
kyranzor wrote:Wow, thanks Factorio pathfinder. I cannot believe how ridiculous the difference is - 5k individuals or less than 300 in squads causing 15fps. That's silly.
Thanks for the testing.

Anyone who is interested, merely see the config.lua changes that Qloshae did and go change the values yourself with any text editor. The only important one (I wrote the code, and to me the only one which is really critical here) is the SQUAD_SIZE_MIN_BEFORE_HUNT = 1 to make them hunt, and SQUAD_CHECK_RANGE = -1 to mean they can never join a nearby squad (they will always make their own).

In theory, the tables will get quite large very quickly but Lua is all about tables so it will be okay for a while. The squad update tick value should be left alone, or even increased to 120 or 180 (60 ticks is 1 real world second).

I wonder if it's also related to squad radius? Like, if the radius was set to 0 or -1 maybe they do not keep formation (which I swear is half the FPS struggle, keeping formation).

If it's any consolation to those who like squad-based droids, Factorio 0.13 has been confirmed to contain a much better pathfinding subsystem than the current one, thanks to Oxyd. Rseding confirmed this on IRC the other day.
Well, I use -1 for the squad radius and I had like 500 running together, so. Lol.
Don't know about the update tho, seemed to work better with 0 for me, but I guess you can time it if you feel like it. Say, spawn 1k droids and see how long it takes for all to walk away. Use the same map exchange string. Do it like 3 times per each and make an average.

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Wed May 04, 2016 11:48 pm
by kyranzor
Sanguion wrote:Fantastic mod. I'm going to test the dev branch right now in MP.
Please get the recently updated Dev branch, I fixed a small error after you said you got it. Also be aware that the "Droid Assemblers" do not yet spawn the new types of bots. That will be added probably in the next day or so. I will be converting the code over to be organising entities and squads based on Force instead of each player's name, so that I can properly handle Droid Assemblers being built by robots.

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Thu May 05, 2016 1:20 am
by Adil
Have you handled the initialization for the case when mod is added to existing game? I've built a few droids (in 0.1.3) just a little away from a bunch of biters but they didn't express search and destroy behavior.

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Thu May 05, 2016 1:54 am
by kyranzor
Adil wrote:Have you handled the initialization for the case when mod is added to existing game? I've built a few droids (in 0.1.3) just a little away from a bunch of biters but they didn't express search and destroy behavior.
How many did you build? How did you place them (by hand or spawned with Droid Assembler)? If you look in the mod folder, then config folder, then config.lua what is the value for "squad size to hunt"? If you had less than this amount, the squad will not go hunting for biters. You need to place >= this number to see them go hunting.

I have successfully added the mod to a vanilla save game and everything worked - I could place droids and spawn them from buildings and they did as expected (waited until squad was big enough and then hunted)

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Thu May 05, 2016 8:20 pm
by Adil
Whoops silly me. Sorry for the false alarm then. It was only four with default settings of 5.

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Sat May 07, 2016 8:39 am
by kunkka
I love this mod, thanks kyranzor, and for the fix Qloshae.

How can I use the dev branch with my current robot army save? I really want to see the new features.
When i replaced the prev "robotarmy_0.1.3" with the new "robotarmyfactorio-Development" the game can't start because the wrong folder name.
When i renamed the new "robotarmyfactorio-Development" folder to the old "robotarmy_0.1.3" the game starts, but I cant load saves:

Code: Select all

__robotarmy__/control.lua:5
__robotarmy__/Squad.lua:278:
'do' expected near ')'
Edit:
I edited the Squad.lua:
278: deleted ')'
279: added ')'

Now works or the save works at least, I will continue playing now.
(I have really limited programming "skills" :roll: – and English of course.)


Edit 2:
The Terminators are awesome! I dont need to "hack" the config to get stronger soldiers for late game (biter evo is 99.9% now with big bases).

Sadly, I didn't noticed too much fps difference with Qloshae's fix. I regain my fps faster because I get back the fps / died droid instead of fps / died squad, so i regain my fps faster but smaller amount. It's better, but I can't place more droids. With 100-150 i have 15 fps. Maybe I missed something? My config:

Code: Select all

TICK_UPDATE_SQUAD_AI = 0
DEFAULT_SQUAD_RADIUS = -1
SOLDIER_MAX_AMMO = 100
SQUAD_SIZE_MIN_BEFORE_HUNT = 1
SQUAD_CHECK_RANGE = -1
ASSEMBLER_UPDATE_TICKRATE = 120 
The huge problem with this, I get a tonn of msg when a droid dies.. "Squad 3123 is no more... Squad 3124 is no more..." etc.

I didn't tested the Assembler yet, because I like to place them by hands near the biter bases (because my trains kill the droids before they can reach the base :D).

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Sun May 08, 2016 4:53 am
by kyranzor
kunkka,

The dev branch has recently had the fix to squad.lua for that line, but now that you mention it again I went back and see that I fixed/edited the wrong line! I'm sorry! I have now fixed it on the github development branch properly.

The way to use the dev branch is to download it and copy the contents of the folder into your robotarmy v0.1.3 folder and overwrite all files. You are correct about the folder names not being the right name, but that is just because of how Github provides the download. The development branch is still considered v0.1.3. When all is done, I will change the info.json and folder names etc to 0.1.4.

Save games might not work properly with old Battle Droid entities, the entity has been changed from "droid" to "droid-smg".

Good work on fixing the Squad.lua bracket issue yourself btw :)


"The huge problem with this, I get a tonn of msg when a droid dies.. "Squad 3123 is no more... Squad 3124 is no more..." etc."
Yes, that is the problem of doing only 1 man squads.

To get better FPS, please change "TICK_UPDATE_SQUAD_AI = 0" to "TICK_UPDATE_SQUAD_AI =120"

After testing Qolshae's changes myself I agree that the squads are very bad for performance, and single man squads are very good for FPS in comparison.

"I didn't tested the Assembler yet" - Good, because the assember can only assemble the "Battle Droid" with SMG for now. I have not yet added the ability to assemble/deploy the other 3 new robot types yet.

If you want to edit the Squad.lua again to remove the "squad is no more.." message spam, put a "--" in front of line 208 in Squad.lua where it says: player.print(string.format("Squad %d is no more...", squad.squadID))

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Sun May 08, 2016 5:32 pm
by kunkka
kyranzor wrote:To get better FPS, please change "TICK_UPDATE_SQUAD_AI = 0" to "TICK_UPDATE_SQUAD_AI =120"
Thanks for your reply! Now I can place more units! (400-500 with ~40+ fps, I play from a 4 years old laptop). If I put them near to a biter base they hunt instant without huge fps drop, but if they finished all nearby enemies they think a lot before they go hunt again. But this is not a problem just i have to avoid placing them too far away.
kyranzor wrote:After testing Qolshae's changes myself I agree that the squads are very bad for performance, and single man squads are very good for FPS in comparison.
Yeah, i dont understand why, 4-5 squad with 100-125 soldiers = massive lagg, but 4-5000 biters can chase my car without any fps drop. But the sqaud thing was really good idea. I hope this will work in the Factorio patch.
kyranzor wrote:If you want to edit the Squad.lua again to remove the "squad is no more.." message spam, put a "--" in front of line 208 in Squad.lua where it says: player.print(string.format("Squad %d is no more...", squad.squadID))
Thanks! Probably I can know when all died, because my fps will be max again, but it would be awesome if we could get a message when the last squad died. So we can know that we have to send out new soldiers soon or the biters can breath again.
When the squad size == 1:
"Your last unit died."
When the squad size > 1, then the message could be:
"Squad 101. is no more... 6 Sqaud is still hunting."
...
"Squad 107. is no more... Your last squad died." (or something similar).

Sorry for my bad grammar.

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Mon May 09, 2016 2:58 am
by kyranzor
That is a reasonable idea, what you have said now. However, I have a better idea that can help with just more than printing messages, but can drive your ability to deploy new droids automatically! I will be including Combinators which output the number of alive droids. There will be 2, one outputs all number of alive droids, and another outputs number of alive droids within a certain radius from the combinator.

This means you could have a combinator-based logic system which does something like the following:
Using signal "alive droids" = number of alive droids in the map, on your "force"/team.

If "alive droids" < 50
- trigger latch style combinator circuit output which loads droids into droid assemblers
- deploy 100 more droids, using a combinator to count each time a droid is inserted
- when count == 100, send "reset" signal to latch to turn off the "load droids" circuit.

This means you'll always have 50+ droids on the battle field, with a peak of 150.
How you set up the droid assemblers lets you determine what ratio of droid types you have - using requester chests you could make 3 assemblers have SMG droids, and 2 assemblers have Rocket droids, and 1 have terminators. This gives you a 3:2:1 ratio of squad composition which should be able to do a lot of damage.

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Wed May 11, 2016 5:46 pm
by Akronymus
I have a question: Is this mod compatible with bobs mods?

(sry if it has already been asked)

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Wed May 11, 2016 6:05 pm
by Qon
Chris4197 wrote:I have a question: Is this mod compatible with bobs mods?

(sry if it has already been asked)
I'm not OP and I haven't tested this with bobs but:
Bobs mods only adds new recipes, items and alters the recipes for some items as far as I know.
This mod does not really depend on the behavior of any items. As long as bobs mods doesn't alter how factions work or removes any vanilla items then it will most likely work. This mod is in alpha though, so if it works as you expect or not is a risk you have to take no matter what mods you have installed. So try it out and see for yourself if you are willing to risk finding bugs. Even if they are incompatible it's very unlikely that your save gets corrupted so you can just deactivate Robot Soldiers if you find that thet do not work together. I save under a new name from time to time so that I can go back if I must though. GL HF.

Re: [MOD 0.12.29] Robot Soldiers. 0.1.3 squads hunt!

Posted: Wed May 11, 2016 6:46 pm
by Airat9000
:D :D good idea!! plaese more tanks! and aircraft! :D army!!