eronoobos / BABAR-The-Shardifant

Balanced Annihilation & Balanced Annilhation Reloaded configuration for Shard
2 stars 1 forks source link

use a better way to choose to build amphibious vs vehicles #19

Open eronoobos opened 8 years ago

eronoobos commented 8 years ago

currently it is:

if ai.hasUWSpots and ai.mobRating["sub"] > ai.mobRating["bot"] * 0.75 then
    needAmphibiousCons = true
end

better would be: if the metal spots are in the same amp network, but not the same veh network.

('network' is not a good term for these areas of contiguous grids that contain metal spots.)

pandaro commented 8 years ago

my idea is more easy: 1 amph can build more things than a normal one 2 amph can build some factory less than normal one 3 amph have more capability than a normal one 4 the cost and the power have little difference i think measure the proportion of water and ground on the map and build a proportioned number of builders, much water = much amph, much ground = much normal builder, no ground= no normal, etc in water we can build stuff like radar energy and converters etc

pandaro commented 8 years ago

i will fix this in the next days, but i don't want fallow your issues:

better would be: if the metal spots are in the same amp network, but not the same veh networ

the reason is one: for me is not smart simply chose between amp or veh, in the case that the water is just a little part, maybe we can go on water and make a little economy to have extra income in case of attack and vice versa. So in my mind, the goal is obtain the right proportion between veh and amp builders, the economic cost i think is insignificant compared with the obtained advantage.

this is my sincere opinion, what do you think it about?

pandaro commented 8 years ago

2303ffdacebcfb7f2180e196157f7805a480a8b4

pandaro commented 8 years ago

close if you think

eronoobos commented 8 years ago

i think the same rank should be used to build amphibious/non-amphibious combat units from a vehicle factory

pandaro commented 8 years ago

the same at all? or a more fine tuning?

eronoobos commented 8 years ago

Haha, now that I think about it, the combat units should be decided a bit differently. It should be either/or--I can't think of many situations in which both is wanted. For attackers, check if the factory and the enemy base location share the same amp network but not same veh network. AA vehicles would remain unchanged.

Now it occurs to me, there may be multiple enemy teams... targethandler should probably keep a list of enemy hotspots instead of one enemy base location.

pandaro commented 8 years ago

Now it occurs to me, there may be multiple enemy teams... targethandler should probably keep a list of enemy hotspots instead of one enemy base location.

about this... the situation is a bit more complex in my think, i need units for attack and for defense. in defense i dont think about where are my enemy to chose my mobile units for defense, but only the best units to win. in attack if i know that there are enemy in a different mtype area, now i search the best way to go there what you think it about

eronoobos commented 8 years ago

If you can't get to the enemy, the enemy can't get to you.

I just remembered amphibious tanks can't fire underwater. So to decide between normal tanks and amphibious tanks, one needs to check how many of the metal spots in the amp network here are in a veh network other than the one here.

If such checks are useful elsewhere, they could be described more generally as "the network here of mtype A connects me to how many more metal spots in networks of mtype B?", which could be a maphandler function.

pandaro commented 8 years ago

ok, i found a funct to do what we need this a example:

function AmpOrGroundWeapon(MyTB)
    print(tostring(MyTB.position))
    print(tostring(ai.enemyBasePosition))
    local doAmp = false
    if ai.enemyBasePosition then
        print(tostring('i know where is base'))
        --if ai.maphandler:MobilityNetworkHere('veh', MyTB.position) == ai.maphandler:MobilityNetworkHere('veh', ai.enemyBasePosition) then
        --  print(tostring('canbuild ground'))
        if ai.maphandler:MobilityNetworkHere('veh', MyTB.position) ~= ai.maphandler:MobilityNetworkHere('veh', ai.enemyBasePosition) and ai.maphandler:MobilityNetworkHere('amp', MyTB.position) ~= ai.maphandler:MobilityNetworkHere('amp', ai.enemyBasePosition) then
            print(tostring('canbuild amphibious'))
            doAmp = true
        end
    end
    return doAmp
end

ok, is not clear now but... now question is, there is no map useful for this function, the queue is always changed in watery one or otmoded one. so or i change the queues, or i delete the minor queues or all this work is useless, or tell me the plain boss!

eronoobos commented 8 years ago

i think it's just because the second ~= should be a ==. the amp networks should be the same

but i'd prefer not bringing enemy base location into it, what i sketched in my comment above

pandaro commented 8 years ago

using the system that you suggested, there are the risk of build amph tank if enemy base is in your same mtype veh area, i think. but we can try and see what happend

eronoobos commented 8 years ago

Only the second ~=, not both

pandaro commented 8 years ago

84