mirror of
https://github.com/veden/Rampant.git
synced 2024-12-30 21:19:46 +02:00
remove debug for alpha release
This commit is contained in:
parent
bf57e5aa45
commit
75b31047e3
@ -3,8 +3,8 @@ Factorio Mod - Uses potential fields to improve the enemy AI
|
||||
|
||||
# Recommend Map Settings
|
||||
|
||||
Enemy Bases Frequeny:Very Low, Size:Big
|
||||
Everything else is open to what ever you like
|
||||
Enemy Bases Frequency:Very Low, Size:Big
|
||||
Everything else is open to what ever you like
|
||||
|
||||
# Features
|
||||
|
||||
|
10
control.lua
10
control.lua
@ -27,7 +27,6 @@ local processMap = mapProcessor.processMap
|
||||
local accumulatePoints = aiBuilding.accumulatePoints
|
||||
local removeScout = aiBuilding.removeScout
|
||||
local scouting = aiBuilding.scouting
|
||||
local digTunnel = aiBuilding.digTunnel
|
||||
|
||||
local playerScent = pheromoneUtils.playerScent
|
||||
local deathScent = pheromoneUtils.deathScent
|
||||
@ -63,7 +62,7 @@ function onInit()
|
||||
natives.tunnels = {}
|
||||
natives.points = 0
|
||||
|
||||
game.forces.player.research_all_technologies()
|
||||
-- game.forces.player.research_all_technologies()
|
||||
|
||||
-- queue all current chunks that wont be generated during play
|
||||
local surface = game.surfaces[1]
|
||||
@ -94,9 +93,9 @@ function onTick(event)
|
||||
local surface = game.surfaces[1]
|
||||
|
||||
if (event.tick % 40 == 0) then
|
||||
if not game.players[1].cheat_mode then
|
||||
game.players[1].cheat_mode = true
|
||||
end
|
||||
-- if not game.players[1].cheat_mode then
|
||||
-- game.players[1].cheat_mode = true
|
||||
-- end
|
||||
|
||||
accumulatePoints(natives)
|
||||
|
||||
@ -110,7 +109,6 @@ function onTick(event)
|
||||
squadAttackPlayer(regionMap, surface, natives, game.players)
|
||||
|
||||
squadBeginAttack(natives)
|
||||
-- digTunnel(regionMap, surface, natives)
|
||||
squadAttackLocation(regionMap, surface, natives)
|
||||
|
||||
-- print(natives.points)
|
||||
|
@ -73,7 +73,6 @@ function aiBuilding.sendScouts(regionMap, surface, natives, chunk, neighbors, ev
|
||||
max_distance = HALF_CHUNK_SIZE})
|
||||
|
||||
if (enemy ~= nil) and (enemy.type == "unit") then
|
||||
-- print("making scouts", natives.points)
|
||||
natives.points = natives.points - AI_SCOUT_COST
|
||||
scouts[#scouts+1] = enemy
|
||||
end
|
||||
@ -83,10 +82,7 @@ end
|
||||
|
||||
function aiBuilding.scouting(regionMap, surface, natives)
|
||||
-- print("scouting")
|
||||
-- enemy.set_command({type=defines.command.attack,
|
||||
-- target=game.players[1].character})
|
||||
|
||||
-- if ()
|
||||
|
||||
end
|
||||
|
||||
function aiBuilding.formSquads(regionMap, surface, natives, chunk, neighbors, evolution_factor)
|
||||
@ -106,8 +102,8 @@ function aiBuilding.formSquads(regionMap, surface, natives, chunk, neighbors, ev
|
||||
squadPosition.x = neighborChunk.pX
|
||||
squadPosition.y = neighborChunk.pY
|
||||
if (neighborChunk[NORTH_SOUTH_PASSABLE] and neighborChunk[EAST_WEST_PASSABLE]) then
|
||||
local attackScore = surface.get_pollution(squadPosition) + neighborChunk[PLAYER_PHEROMONE] + neighborChunk[PLAYER_DEFENSE_PHEROMONE]
|
||||
local avoidScore = neighborChunk[DEATH_PHEROMONE] -- + neighborChunk[ENEMY_BASE_PHEROMONE]
|
||||
local attackScore = surface.get_pollution(squadPosition) + neighborChunk[PLAYER_PHEROMONE] + neighborChunk[PLAYER_DEFENSE_PHEROMONE]
|
||||
local avoidScore = neighborChunk[DEATH_PHEROMONE]
|
||||
local score = attackScore - avoidScore
|
||||
if (squadScore < attackScore) then
|
||||
squadScore = attackScore
|
||||
@ -130,7 +126,6 @@ function aiBuilding.formSquads(regionMap, surface, natives, chunk, neighbors, ev
|
||||
unit_count = AI_MAX_SQUAD_SIZE * evolution_factor,
|
||||
unit_search_distance = (CHUNK_SIZE*2) })
|
||||
if (foundUnits > 0) then
|
||||
-- print("making squad", natives.points, foundUnits, squadPath.cX, squadPath.cY)
|
||||
natives.points = natives.points - AI_SQUAD_COST
|
||||
end
|
||||
end
|
||||
|
@ -76,8 +76,8 @@ function aiDefense.retreatUnits(position, squad, regionMap, surface, natives)
|
||||
retreatPosition.x = neighborChunk.pX
|
||||
retreatPosition.y = neighborChunk.pY
|
||||
|
||||
local dangerScore = neighborChunk[DEATH_PHEROMONE] + surface.get_pollution(retreatPosition) + neighborChunk[PLAYER_PHEROMONE] + neighborChunk[PLAYER_DEFENSE_PHEROMONE] + (neighborChunk[ENEMY_BASE_GENERATOR] * 10)
|
||||
local avoidScore = neighborChunk[ENEMY_BASE_PHEROMONE]
|
||||
local avoidScore = neighborChunk[ENEMY_BASE_PHEROMONE] - (neighborChunk[ENEMY_BASE_GENERATOR] * 3)
|
||||
local dangerScore = neighborChunk[DEATH_PHEROMONE] + surface.get_pollution(retreatPosition) + neighborChunk[PLAYER_PHEROMONE] + neighborChunk[PLAYER_DEFENSE_PHEROMONE]
|
||||
local score = avoidScore - dangerScore
|
||||
if (exitScore < score) then
|
||||
exitScore = score
|
||||
|
Loading…
Reference in New Issue
Block a user