AI for Drones Faction: Das Schwarm!
Moderators: Moderators, Content Developer
Re: AI for Drones Faction: Das Schwarm!
mm. good idea, having them guard the engineers.
Anyway, I had great fun last night, tinkering with the Lua of Schwarm, namely the unit numbers it maintains. But I have some questions about the stages:
-Once the AI gets to a stage, it can't leave that stage until it gets the unit numbers required of it in that stage, right?
-Why does it sometimes drop from a high stage back to a much lower one?
-Umm... how exactly does it progress from stage to stage?
Thanks.
EDIT: Also, it looks like the AI will stop mining for metal at some point, even if it still needs metal to produce more units. Is there a way to make it really metal-hungry so it keeps mining and mining and mining and getting more metal (and more miners)?
Anyway, I had great fun last night, tinkering with the Lua of Schwarm, namely the unit numbers it maintains. But I have some questions about the stages:
-Once the AI gets to a stage, it can't leave that stage until it gets the unit numbers required of it in that stage, right?
-Why does it sometimes drop from a high stage back to a much lower one?
-Umm... how exactly does it progress from stage to stage?
Thanks.
EDIT: Also, it looks like the AI will stop mining for metal at some point, even if it still needs metal to produce more units. Is there a way to make it really metal-hungry so it keeps mining and mining and mining and getting more metal (and more miners)?
Re: AI for Drones Faction: Das Schwarm!
Well, I tinkered with it a bit, should work a tiny bit better now. .lua file's attatched. Still curious about the stage stuff though.
- Attachments
-
- tp_schwarmAI.lua
- (18.92 KiB) Downloaded 38 times
Re: AI for Drones Faction: Das Schwarm!
yes.-Once the AI gets to a stage, it can't leave that stage until it gets the unit numbers required of it in that stage, right?
If it is at, say stage 6 but the requirements for stage 1 are no longer met (ie stage 1 requirement is a factory and it gets destroyed) it will drop all the way down to stage 1.-Why does it sometimes drop from a high stage back to a much lower one?
by building the units it is missing and assigning the task to units who can do it. (function makeSomeUnits)-Umm... how exactly does it progress from stage to stage?
Yeah, thats half bug of ai and half of game.Also, it looks like the AI will stop mining for metal at some point, even if it still needs metal to produce more units.
ie sometimes mining towers are in range of rocks but can not mine because something is in the way. (like a wreck blocks their laser)
Re: AI for Drones Faction: Das Schwarm!
Oh good.
Also, if I put ["kdroneminingtower"]=x in one of the stages, and it doesn't have enough engineers to morph into x towers, will it build the necessary engineers?
Anyway, did you like the modifications I made? The major one is that instead of machGo() on building a tridroneroller, any military units built will automatically go to random place on map.
Thanks for all your help with my edits of Schwarm.
I was talking about when sometimes there's mining towers sitting around but they won't go move rocks, or when theres engineers sitting around and they won't go mine.knorke wrote: ie sometimes mining towers are in range of rocks but can not mine because something is in the way. (like a wreck blocks their laser)
Also, if I put ["kdroneminingtower"]=x in one of the stages, and it doesn't have enough engineers to morph into x towers, will it build the necessary engineers?
Anyway, did you like the modifications I made? The major one is that instead of machGo() on building a tridroneroller, any military units built will automatically go to random place on map.
Thanks for all your help with my edits of Schwarm.
Re: AI for Drones Faction: Das Schwarm!
sorry, could not yet test out your changes.
Yes, thats a problem. It happens because the AI might fall back to stage 1 and then it "is ok" with just having 2 mining towers because thats what stage 1 is. Slowly the other engineers should then morph too as it progress through the stages. Would probally be better to make idle engineers also seek out rocks.sometimes there's mining towers sitting around but they won't go move rocks, or when theres engineers sitting around and they won't go mine.
yes.Also, if I put ["kdroneminingtower"]=x in one of the stages, and it doesn't have enough engineers to morph into x towers, will it build the necessary engineers?
Re: AI for Drones Faction: Das Schwarm!
is there an easy way to do that?knorke wrote: Would probally be better to make idle engineers also seek out rocks.
Re: AI for Drones Faction: Das Schwarm!
My latest revision:
-Removed cloning from the AI behavior, because the AI had a tendancy to clone all units at once and paralyze it's entire army.
-More economy improvements
-Removed cloning from the AI behavior, because the AI had a tendancy to clone all units at once and paralyze it's entire army.
-More economy improvements
- Attachments
-
- tp_schwarmAI.lua
- (19.03 KiB) Downloaded 123 times
- SanadaUjiosan
- Conflict Terra Developer
- Posts: 907
- Joined: 21 Jan 2010, 06:21
Re: AI for Drones Faction: Das Schwarm!
Definitely seems more aggressive. Incorporating reclaiming could really make this deadly I think.
Re: AI for Drones Faction: Das Schwarm!
Is there an easy way to do that?SanadaUjiosan wrote: Incorporating reclaiming could really make this deadly I think.
I still want knorke to make it attack the enemy, with large groups, like a player would. My spring-lua skills aren't really up to that task.
Are there any small improvements I could make?
Thanks for your feedback
Re: AI for Drones Faction: Das Schwarm!
weee hooray, looks like i found somebody to take this over 

That is just be a matter of replacing CMD.MOVE with CMD.FIGHT
Making better "stages-lists" is probally not much use right now as first the makeSomeUnits() would have to be fixed to follow the list more closely. Right now it often builds more units then defined.
So that would be the next step I guess.


if you make engineers use fight-move instead of move when going to rocks, they should reclaim any wreckage in their way.Are there any small improvements I could make?
That is just be a matter of replacing CMD.MOVE with CMD.FIGHT
Making better "stages-lists" is probally not much use right now as first the makeSomeUnits() would have to be fixed to follow the list more closely. Right now it often builds more units then defined.
So that would be the next step I guess.
Re: AI for Drones Faction: Das Schwarm!
Well, I really like tweaking and improving this AI, but I don't have the Lua skills atm to add lots of new code or anything..... Is there a good spring-lua tutorial anywhere?knorke wrote:weee hooray, looks like i found somebody to take this over![]()
Please keep working on this AI (add attacking, etc) if you can, or if you can't, can some other good lua coder help me with this?
Anyway, I'll do the CMD.FIGHT thing.
- SanadaUjiosan
- Conflict Terra Developer
- Posts: 907
- Joined: 21 Jan 2010, 06:21
Re: AI for Drones Faction: Das Schwarm!
Well, you just admitted to a weakness in Spring-lua (which I respect, as mine is even less) but I think a "better" clone function would be better than no clone function. Example:
Instead of "clone whole army" it checks its current resources and will clone enough units to maintain half of the resources it has, or use all of them, or a quarter, something like that.
Also, not sure if this falls under revisions you did, but snoop and I noticed that if a rock is unobtainable, they will build mining towers around it trying to get it, until there's a ton and the rock of course is not being mined. Maybe try a "if cannot mine in a minute or two, give up" sort of deal.
Instead of "clone whole army" it checks its current resources and will clone enough units to maintain half of the resources it has, or use all of them, or a quarter, something like that.
Also, not sure if this falls under revisions you did, but snoop and I noticed that if a rock is unobtainable, they will build mining towers around it trying to get it, until there's a ton and the rock of course is not being mined. Maybe try a "if cannot mine in a minute or two, give up" sort of deal.
Re: AI for Drones Faction: Das Schwarm!
ehhhehhhheh.... all of that's above me. Probably. First time I ever saw Lua was opening up knorke's Schwarm. but i'd done a little Java and Python before that. So I need to learn all of this spring-lua and just lua stuff somewhere.SanadaUjiosan wrote:Well, you just admitted to a weakness in Spring-lua (which I respect, as mine is even less) but I think a "better" clone function would be better than no clone function. Example:
Instead of "clone whole army" it checks its current resources and will clone enough units to maintain half of the resources it has, or use all of them, or a quarter, something like that.
Also, not sure if this falls under revisions you did, but snoop and I noticed that if a rock is unobtainable, they will build mining towers around it trying to get it, until there's a ton and the rock of course is not being mined. Maybe try a "if cannot mine in a minute or two, give up" sort of deal.
Re: AI for Drones Faction: Das Schwarm!
mmm. does anyone know how I could somehow detect when a unit is attacked?