1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-17 20:58:35 +02:00

see readme

This commit is contained in:
Aaron Veden 2017-07-04 15:52:20 -07:00
parent fca0fbf434
commit 885b3f0bea
6 changed files with 52 additions and 46 deletions

View File

@ -58,12 +58,12 @@ Configure Options not in game menu:
# Version History
0.15.17 -
- Fixed: Remote call load issue. (https://github.com/veden/Rampant/issues/5)
- Tweak: Increased sampling threshold for water tiles from 5 to 10 tiles
- Tweak: Increased small worm turret range from 17 to 18
- Improvement: added ground effect to worm turret for attacking drones
- Improvement: Added option to remove blood particles on biter deaths, which should help reduce lag spikes (default is to remove them)
- Improvement: Added option to remove blood particles on biter deaths, which should help reduce lag spikes (Default is to remove)
- Optimization: Moved math.random to local level instead of global
- Refactored: Unit and attack prototypes
- Framework: Refactored unit and attack prototypes
0.15.16 -
- Tweak: Increased death pheromone weight for squad attack from 1 to 2

View File

@ -75,10 +75,42 @@ local pendingChunks
-- hook functions
local function onIonCannonFired(event)
--[[
event.force, event.surface, event.player_index, event.position, event.radius
--]]
local surface = event.surface
if (surface.index == 1) then
natives.points = natives.points + 3000
if (natives.points > AI_MAX_OVERFLOW_POINTS) then
natives.points = AI_MAX_OVERFLOW_POINTS
end
local chunk = getChunkByPosition(regionMap, event.position.x, event.position.y)
if chunk then
rallyUnits(chunk,
regionMap,
surface,
natives,
event.tick)
end
end
end
local function hookEvents()
if config.ionCannonPresent then
script.on_event(remote.call("orbital_ion_cannon", "on_ion_cannon_fired"),
onIonCannonFired)
-- script.on_event(remote.call("orbital_ion_cannon", "on_ion_cannon_targeted"),
-- onIonCannonTargeted)
end
end
local function onLoad()
regionMap = global.regionMap
natives = global.natives
pendingChunks = global.pendingChunks
hookEvents()
end
local function onChunkGenerated(event)
@ -238,27 +270,6 @@ local function onPickUp(event)
addRemovePlayerEntity(regionMap, event.entity, natives, false, false)
end
local function onIonCannonFired(event)
--[[
event.force, event.surface, event.player_index, event.position, event.radius
--]]
local surface = event.surface
if (surface.index == 1) then
natives.points = natives.points + 3000
if (natives.points > AI_MAX_OVERFLOW_POINTS) then
natives.points = AI_MAX_OVERFLOW_POINTS
end
local chunk = getChunkByPosition(regionMap, event.position.x, event.position.y)
if chunk then
rallyUnits(chunk,
regionMap,
surface,
natives,
event.tick)
end
end
end
local function onDeath(event)
local entity = event.entity
local surface = entity.surface
@ -337,6 +348,7 @@ local function onInit()
pendingChunks = global.pendingChunks
onConfigChanged()
hookEvents()
end
-- hooks
@ -347,13 +359,6 @@ script.on_event(defines.events.on_runtime_mod_setting_changed,
onModSettingsChange)
script.on_configuration_changed(onConfigChanged)
if config.ionCannonPresent then
script.on_event(remote.call("orbital_ion_cannon", "on_ion_cannon_fired"),
onIonCannonFired)
-- script.on_event(remote.call("orbital_ion_cannon", "on_ion_cannon_targeted"),
-- onIonCannonTargeted)
end
script.on_event(defines.events.on_player_built_tile, onSurfaceTileChange)
script.on_event(defines.events.on_biter_base_built,

View File

@ -35,7 +35,7 @@ constants.INTERVAL_LOGIC = 38
constants.PLAYER_PHEROMONE_MULTIPLER = 100
constants.DEV_CUSTOM_AI = true
constants.DEV_CUSTOM_AI = false
-- chunk properties

View File

@ -54,7 +54,7 @@ function neighborUtils.scoreNeighborsForResource(chunk, neighborDirectionChunks,
local highestDirection
for x=1,8 do
local neighborChunk = neighborDirectionChunks[x]
if neighborChunk and canMoveChunkDirection(x, chunk, neighborChunk) and (neighborChunk[RESOURCE_PHEROMONE] > threshold) then
if neighborChunk and canMoveChunkDirection(x, chunk, neighborChunk) and (neighborChunk[RESOURCE_PHEROMONE] > (threshold or 1)) then
local score = scoreFunction(squad, neighborChunk)
if (score > highestScore) then
highestScore = score

View File

@ -5,7 +5,7 @@
(require json)
(define modFolder "/home/veden/.factorio/mods/")
(define zipModFolder "/data/games/factorio15.19/mods/")
(define zipModFolder "/data/games/factorio/mods/")
(define configuration (call-with-input-file "info.json"
(lambda (port)
(string->jsexpr (port->string port)))))
@ -77,8 +77,8 @@
(copyDirectory "prototypes" modFolder)))
(define (run)
(copyFiles modFolder)
;; (copyFiles modFolder)
;; (copyFiles zipModFolder)
;;(makeZip modFolder)
(makeZip modFolder)
)
)

View File

@ -192,18 +192,19 @@ data:extend({
default_value = true,
order = "h[modifier]-a[optimize]",
per_user = false
},
}
-- ,
{
type = "bool-setting",
name = "rampant-reduceAnimations",
description = "rampant-reduceAnimations",
setting_type = "startup",
default_value = true,
order = "h[modifier]-b[optimize]",
per_user = false
}
-- {
-- type = "bool-setting",
-- name = "rampant-reduceAnimations",
-- description = "rampant-reduceAnimations",
-- setting_type = "startup",
-- default_value = true,
-- order = "h[modifier]-b[optimize]",
-- per_user = false
-- }
-- ,