1
0
mirror of https://github.com/veden/Rampant.git synced 2025-02-13 13:48:36 +02:00

Merge branch '0.13'

This commit is contained in:
veden 2016-09-14 12:35:04 -07:00
commit cc398eca65
6 changed files with 15 additions and 28 deletions

View File

@ -46,8 +46,6 @@ Base Expansion
added scaling for kamikaze attack (https://forums.factorio.com/viewtopic.php?f=94&t=31445&start=10#p199401) added scaling for kamikaze attack (https://forums.factorio.com/viewtopic.php?f=94&t=31445&start=10#p199401)
increased squad size max from 125 to 150, (larger waves) increased squad size max from 125 to 150, (larger waves)
0.0.7 - updated for 0.14
0.0.6 - some speed improvements 0.0.6 - some speed improvements
MP is working (https://github.com/veden/Rampant/issues/1) MP is working (https://github.com/veden/Rampant/issues/1)

View File

@ -39,7 +39,7 @@ local addRemoveEntity = entityUtils.addRemoveEntity
local regionMap local regionMap
local natives local natives
local pheromoneTotals -- local pheromoneTotals
local pendingChunks local pendingChunks
-- hook functions -- hook functions
@ -49,7 +49,7 @@ local function onLoad()
regionMap = global.regionMap regionMap = global.regionMap
natives = global.natives natives = global.natives
pendingChunks = global.pendingChunks pendingChunks = global.pendingChunks
pheromoneTotals = global.pheromoneTotals -- pheromoneTotals = global.pheromoneTotals
end end
local function onChunkGenerated(event) local function onChunkGenerated(event)
@ -89,19 +89,7 @@ local function onConfigChanged()
regionMap.processPointer = 1 regionMap.processPointer = 1
regionMap.scanPointer = 1 regionMap.scanPointer = 1
regionMap.processRoll = -1 regionMap.processRoll = -1
if (pheromoneTotals == nil) then
global.pheromoneTotals = {}
pheromoneTotals = global.pheromoneTotals
end
pheromoneTotals[constants.DEATH_PHEROMONE] = 0
pheromoneTotals[constants.ENEMY_BASE_PHEROMONE] = 0
pheromoneTotals[constants.PLAYER_PHEROMONE] = 0
pheromoneTotals[constants.PLAYER_BASE_PHEROMONE] = 0
pheromoneTotals[constants.PLAYER_DEFENSE_PHEROMONE] = 0
pheromoneTotals[constants.MOVEMENT_PHEROMONE] = 0
global.version = constants.VERSION_9 global.version = constants.VERSION_9
end end
if (global.version < constants.VERSION_10) then if (global.version < constants.VERSION_10) then
@ -165,7 +153,7 @@ local function onDeath(event)
local entityPosition = entity.position local entityPosition = entity.position
-- drop death pheromone where unit died -- drop death pheromone where unit died
deathScent(regionMap, entityPosition, pheromoneTotals) deathScent(regionMap, entityPosition)
if (event.force ~= nil) and (event.force.name == "player") then if (event.force ~= nil) and (event.force.name == "player") then
retreatUnits(entityPosition, retreatUnits(entityPosition,
@ -198,12 +186,12 @@ local function onInit()
global.regionMap = {} global.regionMap = {}
global.pendingChunks = {} global.pendingChunks = {}
global.natives = {} global.natives = {}
global.pheromoneTotals = {} -- global.pheromoneTotals = {}
regionMap = global.regionMap regionMap = global.regionMap
natives = global.natives natives = global.natives
pendingChunks = global.pendingChunks pendingChunks = global.pendingChunks
pheromoneTotals = global.pheromoneTotals -- pheromoneTotals = global.pheromoneTotals
onConfigChanged() onConfigChanged()
end end

View File

@ -1,7 +1,7 @@
{ {
"name" : "Rampant", "name" : "Rampant",
"factorio_version" : "0.14", "factorio_version" : "0.13",
"version" : "0.14.2", "version" : "0.13.2",
"title" : "Rampant AI", "title" : "Rampant AI",
"author" : "Veden", "author" : "Veden",
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445", "homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",

View File

@ -34,6 +34,7 @@ local EAST_WEST_PASSABLE = constants.EAST_WEST_PASSABLE
local getChunkByPosition = mapUtils.getChunkByPosition local getChunkByPosition = mapUtils.getChunkByPosition
local getNeighborChunksWithDirection = mapUtils.getNeighborChunksWithDirection local getNeighborChunksWithDirection = mapUtils.getNeighborChunksWithDirection
local findNearBySquad = unitGroupUtils.findNearBySquad local findNearBySquad = unitGroupUtils.findNearBySquad
local addSquadMovementPenalty = unitGroupUtils.addSquadMovementPenalty
local createSquad = unitGroupUtils.createSquad local createSquad = unitGroupUtils.createSquad
local membersToSquad = unitGroupUtils.membersToSquad local membersToSquad = unitGroupUtils.membersToSquad
local scoreNeighborsWithDirection = neighborUtils.scoreNeighborsWithDirection local scoreNeighborsWithDirection = neighborUtils.scoreNeighborsWithDirection

View File

@ -49,11 +49,11 @@ function pheromoneUtils.scents(chunk)
end end
end end
function pheromoneUtils.deathScent(regionMap, position, pheromoneTotals) function pheromoneUtils.deathScent(regionMap, position)
local chunk = getChunkByPosition(regionMap, position.x, position.y) local chunk = getChunkByPosition(regionMap, position.x, position.y)
if (chunk ~= nil) then if (chunk ~= nil) then
chunk[DEATH_PHEROMONE] = chunk[DEATH_PHEROMONE] + DEATH_PHEROMONE_GENERATOR_AMOUNT chunk[DEATH_PHEROMONE] = chunk[DEATH_PHEROMONE] + DEATH_PHEROMONE_GENERATOR_AMOUNT
pheromoneTotals[DEATH_PHEROMONE] = pheromoneTotals[DEATH_PHEROMONE] + DEATH_PHEROMONE_GENERATOR_AMOUNT -- pheromoneTotals[DEATH_PHEROMONE] = pheromoneTotals[DEATH_PHEROMONE] + DEATH_PHEROMONE_GENERATOR_AMOUNT
end end
end end

View File

@ -6,7 +6,7 @@
;(define modFolder "C:/Users/veden/AppData/Roaming/Factorio/mods/") ;(define modFolder "C:/Users/veden/AppData/Roaming/Factorio/mods/")
;(define zipModFolder "C:/Program Files/Factorio_0.14.1/mods/") ;(define zipModFolder "C:/Program Files/Factorio_0.14.1/mods/")
(define modFolder "/home/veden/.factorio/mods/") (define modFolder "/home/veden/.factorio/mods/")
(define zipModFolder "/home/veden/.factorio/mods/") (define zipModFolder "/data/games/factorio13.20/mods/")
(define configuration (call-with-input-file "info.json" (define configuration (call-with-input-file "info.json"
(lambda (port) (lambda (port)
(string->jsexpr (port->string port))))) (string->jsexpr (port->string port)))))
@ -73,7 +73,7 @@
(copyDirectory "graphics" modFolder) (copyDirectory "graphics" modFolder)
(copyDirectory "prototypes" modFolder))) (copyDirectory "prototypes" modFolder)))
; (copyFiles modFolder) (copyFiles modFolder)
; (copyFiles zipModFolder) ; (copyFiles zipModFolder)
(makeZip) ; (makeZip)
) )