View topic - Evolution RTS - Forb vs Shard - Game 2



All times are UTC + 1 hour


Post new topic Reply to topic  [ 18 posts ] 
Author Message
PostPosted: 28 Sep 2011, 04:30 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring on 04/24/12
http://youtu.be/7gdlra_0r1Q


Top
 Offline Profile  
 
PostPosted: 28 Sep 2011, 04:45 
User avatar

Joined: 03 Jan 2008, 14:51
Add a proper description with links!


Top
 Offline Profile  
 
PostPosted: 28 Sep 2011, 05:12 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring on 04/24/12
I did, youtube nuked it.


Top
 Offline Profile  
 
PostPosted: 28 Sep 2011, 12:29 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
I'm liking these videos! They're giving me ideas

Does this include the 1 line change I suggested in the previous video thread?


Top
 Offline Profile  
 
PostPosted: 28 Sep 2011, 22:38 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring on 04/24/12
Doah, damnit! No, I'm sorry, I completely forgot.

For the next one I'll make sure to do it.


Top
 Offline Profile  
 
PostPosted: 29 Sep 2011, 11:37 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
Test beforehand, Im not sure how itll handle your metal extractor weapons


Top
 Offline Profile  
 
PostPosted: 03 Oct 2011, 10:00 
Map Creator
User avatar

Joined: 10 Mar 2006, 10:24
Location: waiting in line for The Expendables 2
defences look to be incredibly strong.. the crisis was over the moment your first turret was up and shard just kept running small groups into it instead of attacking the ungaurded and accessible extractors below


Top
 Offline Profile  
 
PostPosted: 03 Oct 2011, 14:06 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
In vanilla Shard, it counts units, it makes no distinction between 5 power structures, and 5 lightning turrets.

As a result, given 2 grid sectors, it would attack the sector containing 3 turrets, rather than the sector containing 30 power structures.

Also keep in mind that you could not see the actual target of the units. It may have sent them to a heavily undefended region at the back of the base, while the engine pathfinder sends them through the turrets.

All in all Shards attack system was intended as an example, something simple and elegant that just worked. I kept a lot of what you said to me in mind, and left my options open, and there is a lot of room for improvement merely in how it executes the existing behaviour.

For example, at the moment it targets the weakest grid sector:

  • It could consider units with no weapons as weaker than units with weapons
  • It could evaluate the maximum damage output of a weapon
  • It could evaluate units within firing range but not inside the cell
  • It could path around defences enroute and use the value of the weakest sectors enroute if defences are unavoidable
  • It could have a behaviour that made units avoid enemy weapons ( as demonstrated in a lua widget not so long ago )
  • It could evaluate how essential a unit is to the enemies cause, e.g. their only factory, their massive windfarm, their lone super hyper free metal producer etc

There's more to attacking the weakest point, than simply picking the weakest point and attacking it. Its not enough to tell me what Shard should do. In this case it is doing exactly what you are saying it should do, yet the result is not what you expect


Top
 Offline Profile  
 
PostPosted: 03 Oct 2011, 15:06 
Map Creator
User avatar

Joined: 10 Mar 2006, 10:24
Location: waiting in line for The Expendables 2
AF wrote:
In this case it is doing exactly what you are saying it should do, yet the result is not what you expect


actually, I'm pretty sure I specified the need for it to waypoint its movement to the low threat cells in a way that avoids high threat cells.

and yes, performance would improve significantly if you made it only consider units with weapons when counting units (ie, it counts unarmed units as 0.001 when counting). that way, it would gravitate its attacks to defenceless sectors instead of under-populated ones.


Top
 Offline Profile  
 
PostPosted: 03 Oct 2011, 20:40 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
I would consider a generic unit with no weapons as 1, remember it culls sectors 0 or less, and I'd rather not deal with floating points if I can. Valuable units can be another setup.

Making weapons count as more than one makes more sense than making ordinary units count as less than one


Top
 Offline Profile  
 
PostPosted: 03 Oct 2011, 20:47 
Map Creator
User avatar

Joined: 10 Mar 2006, 10:24
Location: waiting in line for The Expendables 2
right, so units with weapons are big number and units without are 1. boom, your attack system is now about 5x more intelligent. For an added bonus, make that number proportional to the DPS of the units in question.


Top
 Offline Profile  
 
PostPosted: 03 Oct 2011, 22:48 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
make units that are to be avoided (turrets) give +1 and units that you want to attack (eco) give -1


Top
 Offline Profile  
 
PostPosted: 03 Oct 2011, 23:01 
Map Creator
User avatar

Joined: 10 Mar 2006, 10:24
Location: waiting in line for The Expendables 2
but then a cell that just contains eco would be a negative number, which will probably cause your computer to explode. I like the idea of giving stationary units with weapons extra threat, since generally stationary with weapons = cost efficent turret


Top
 Offline Profile  
 
PostPosted: 04 Oct 2011, 00:07 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
I thought about making valuable units lead to negative numbers, but this leads to a paradox.

Suppose we have 10 super critical resource generators that provide 99% of the enemies resources, giving them a total value of -100.

In that same grid square is a collection of uber super units that have a total value of 100.

This grid sector would be 0, and thus wouldn't even be evaluated. Using the same grid and algorithm to determine both value threat and military power does not work. I've tried it in the past, and ti gives you a little improvement, but introduces a lot of horrible unwanted consequences that make no sense in an RTS AI. Instead this data needs to eb tracked separately and compiled afterwards on a per case basis.


Top
 Offline Profile  
 
PostPosted: 04 Oct 2011, 08:00 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring on 04/24/12
actually, the evo eco structures (the ones with lolskyhaet) actually ahve 3 weapons. Both of which do 1 damage (spring will not allow 0 damage weapons). I jsut had a thought, I'll change all those fx weapons to -1 damage (which spring DOES allow) and see how shard reacts to that.

Oh wait, shard doesn't pay attention to damage numbers. Gah :-(

AF add a unit exception list. These units have weapons but are not considered a threat.


Top
 Offline Profile  
 
PostPosted: 04 Oct 2011, 08:26 
Moderator

Joined: 12 Oct 2007, 08:24
CAI attacks the highest cost economy square that it's scouted and disregards squares with too much cost in defence compared to raiding party cost. This seems to work and is reasonably simple, you just need 2 heatmaps.

A better solution would path around dangerous locations but that's a lot more work.


Top
 Offline Profile  
 
PostPosted: 04 Oct 2011, 19:27 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
Indeed that's similar to the obvious optimization I had in mind. Discard all cells on either grid with no value of significance, subtract one from the other, and use that as a basis.

Attack handler is rather simple in it's design, you could easily add an extra file that defined a table of unitnames and their values, then used that in the line I suggested you change earlier.

e.g.

Code:
cell.count = cell.count + 1 + e:WeaponCount()


becomes

Code:
cell.count = cell.count + 1 + offensive_value[e:Name()]


Coupled with an include somewhere, probably the top of the attack handler file. There's a lot of places in Shard that this kind of change can be made, and can be done in ~1minute with minimal effort. Just remember to make sure that you check there's a value for that unit type in the table and do an alternative calculation/default value. In this case it's the line I originally had in place. An if else should suffice.


Top
 Offline Profile  
 
PostPosted: 04 Oct 2011, 19:39 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
And remember forb, all you have to do is copy and paste attackhandler.lua into your evo subfolder and it'll use your version of the attack handler rather than mine, so you can edit to your hearts content.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.