mirror of
https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git
synced 2024-12-04 09:43:00 +02:00
Messing around with debug launch options for directly loading a scenario to speed up development. Blueprint.zip is only a temporary solution and will be deleted later.
This commit is contained in:
parent
d5f17a01f7
commit
ca347d88bf
@ -4,6 +4,7 @@
|
||||
9. Add multiple surfaces to all core code
|
||||
10. Check and update all functions using surfaces to clearly use either the LuaSurface obj OR a string name.
|
||||
11. Expose more config options in admin GUI
|
||||
12. Tooltips for GUI elements in spawn menu options!
|
||||
|
||||
Random Notes:
|
||||
Configurable welcome message in admin GUI.
|
||||
@ -11,6 +12,7 @@ Add option to spawn on existing chunks (look for chunks with any entities in the
|
||||
Add option for spawn pen to be on a specified surface
|
||||
Change "search for ungenerated spawn point" to be a "roll" button that the player can re-roll? Maybe it shows on the map in an icon where they might go first?
|
||||
Make players join a "holding_pen" force instead of the main force? Might cause issues with chat and vision?
|
||||
Separate chest sharing and electricity ()
|
||||
|
||||
1. (DONE) First setup the mod settings and lua global settings.
|
||||
2. (DONE) Test out removing the creation of a custom surface and ensure map settings can be set as needed. Possibly create a separate surface, or just a separate area away from the origin, for starting players.
|
||||
|
74
example/example-map-gen-settings.json
Normal file
74
example/example-map-gen-settings.json
Normal file
@ -0,0 +1,74 @@
|
||||
{
|
||||
"_terrain_segmentation_comment": "Inverse of map scale",
|
||||
"terrain_segmentation": 1,
|
||||
|
||||
"_water_comment":
|
||||
[
|
||||
"Multiplier for water 'coverage' - higher increases the water level.",
|
||||
"Water level = 10 * log2(this value)"
|
||||
],
|
||||
"water": 1,
|
||||
|
||||
"_comment_width+height": "Width and height of map, in tiles; 0 means infinite",
|
||||
"width": 1,
|
||||
"height": 1,
|
||||
|
||||
"_starting_area_comment": "Multiplier for 'biter free zone radius'",
|
||||
"starting_area": 1,
|
||||
|
||||
"peaceful_mode": false,
|
||||
|
||||
"default_enable_all_autoplace_controls": true,
|
||||
|
||||
"autoplace_controls":
|
||||
{
|
||||
"coal" : {"frequency" : 0.20, "richness" : 10.00, "size" : 0.20},
|
||||
"iron-ore" : {"frequency" : 0.20, "richness" : 10.00, "size" : 0.20},
|
||||
"copper-ore" : {"frequency" : 0.20, "richness" : 10.00, "size" : 0.20},
|
||||
"stone" : {"frequency" : 0.20, "richness" : 10.00, "size" : 0.20},
|
||||
"uranium-ore" : {"frequency" : 0.20, "richness" : 10.00, "size" : 0.20},
|
||||
"crude-oil" : {"frequency" : 0.20, "richness" : 10.00, "size" : 0.20},
|
||||
"trees" : {"frequency" : 0.30, "richness" : 1.50, "size" : 1.00},
|
||||
"enemy-base" : {"frequency" : 0.40, "richness" : 0.50, "size" : 0.50}
|
||||
},
|
||||
|
||||
"cliff_settings":
|
||||
{
|
||||
"_name_comment": "Name of the cliff prototype",
|
||||
"name": "cliff",
|
||||
|
||||
"_cliff_elevation_0_comment": "Elevation of first row of cliffs",
|
||||
"cliff_elevation_0": 10,
|
||||
|
||||
"_cliff_elevation_interval_comment": "Elevation difference between successive rows of cliffs",
|
||||
"cliff_elevation_interval": 10,
|
||||
|
||||
"_richness_comment": "Multiplier for cliff continuity; 0 will result in no cliffs, 10 will make all cliff rows completely solid",
|
||||
"richness": 1
|
||||
},
|
||||
|
||||
"_property_expression_names_comment":
|
||||
[
|
||||
"Overrides for property value generators",
|
||||
"Elevation influences water and cliff placement.",
|
||||
"Leave it blank to get 'normal' terrain.",
|
||||
"Use '0_16-elevation' to reproduce terrain from 0.16.",
|
||||
"Use '0_17-island' to get an island.",
|
||||
"elevation'': ''0_17-island"
|
||||
],
|
||||
"property_expression_names":
|
||||
{
|
||||
"control-setting:aux:bias": "0.00",
|
||||
"control-setting:aux:frequency:multiplier": "1.00",
|
||||
"control-setting:moisture:bias": "0.00",
|
||||
"control-setting:moisture:frequency:multiplier": "1.00"
|
||||
},
|
||||
|
||||
"starting_points":
|
||||
[
|
||||
{"x": 0, "y": 0}
|
||||
],
|
||||
|
||||
"_seed_comment": "Use null for a random seed, number for a specific seed.",
|
||||
"seed": null
|
||||
}
|
120
example/example-map-settings.json
Normal file
120
example/example-map-settings.json
Normal file
@ -0,0 +1,120 @@
|
||||
{
|
||||
"difficulty_settings":
|
||||
{
|
||||
"recipe_difficulty": 0,
|
||||
"technology_difficulty": 0,
|
||||
"technology_price_multiplier": 1,
|
||||
"research_queue_setting": "always"
|
||||
},
|
||||
"pollution":
|
||||
{
|
||||
"enabled": true,
|
||||
"_comment_min_to_diffuse_1": "these are values for 60 ticks (1 simulated second)",
|
||||
"_comment_min_to_diffuse_2": "amount that is diffused to neighboring chunk",
|
||||
"diffusion_ratio": 0.02,
|
||||
"min_to_diffuse": 15,
|
||||
"ageing": 1,
|
||||
"expected_max_per_chunk": 150,
|
||||
"min_to_show_per_chunk": 50,
|
||||
"min_pollution_to_damage_trees": 60,
|
||||
"pollution_with_max_forest_damage": 150,
|
||||
"pollution_per_tree_damage": 50,
|
||||
"pollution_restored_per_tree_damage": 10,
|
||||
"max_pollution_to_restore_trees": 20,
|
||||
"enemy_attack_pollution_consumption_modifier": 0.5
|
||||
},
|
||||
"enemy_evolution":
|
||||
{
|
||||
"enabled": true,
|
||||
"time_factor": 0.000000,
|
||||
"destroy_factor": 0.002,
|
||||
"pollution_factor": 0.0000002
|
||||
},
|
||||
"enemy_expansion":
|
||||
{
|
||||
"enabled": true,
|
||||
"min_base_spacing": 3,
|
||||
"max_expansion_distance": 10,
|
||||
"friendly_base_influence_radius": 2,
|
||||
"enemy_building_influence_radius": 2,
|
||||
"building_coefficient": 0.1,
|
||||
"other_base_coefficient": 2.0,
|
||||
"neighbouring_chunk_coefficient": 0.5,
|
||||
"neighbouring_base_chunk_coefficient": 0.4,
|
||||
"max_colliding_tiles_coefficient": 0.9,
|
||||
"settler_group_min_size": 5,
|
||||
"settler_group_max_size": 20,
|
||||
"min_expansion_cooldown": 14400,
|
||||
"max_expansion_cooldown": 108000
|
||||
},
|
||||
"unit_group":
|
||||
{
|
||||
"min_group_gathering_time": 3600,
|
||||
"max_group_gathering_time": 36000,
|
||||
"max_wait_time_for_late_members": 7200,
|
||||
"max_group_radius": 30.0,
|
||||
"min_group_radius": 5.0,
|
||||
"max_member_speedup_when_behind": 1.4,
|
||||
"max_member_slowdown_when_ahead": 0.6,
|
||||
"max_group_slowdown_factor": 0.3,
|
||||
"max_group_member_fallback_factor": 3,
|
||||
"member_disown_distance": 10,
|
||||
"tick_tolerance_when_member_arrives": 60,
|
||||
"max_gathering_unit_groups": 30,
|
||||
"max_unit_group_size": 200
|
||||
},
|
||||
"steering":
|
||||
{
|
||||
"default":
|
||||
{
|
||||
"radius": 1.2,
|
||||
"separation_force": 0.005,
|
||||
"separation_factor": 1.2,
|
||||
"force_unit_fuzzy_goto_behavior": false
|
||||
},
|
||||
"moving":
|
||||
{
|
||||
"radius": 3,
|
||||
"separation_force": 0.01,
|
||||
"separation_factor": 3,
|
||||
"force_unit_fuzzy_goto_behavior": false
|
||||
}
|
||||
},
|
||||
"path_finder":
|
||||
{
|
||||
"fwd2bwd_ratio": 5,
|
||||
"goal_pressure_ratio": 2,
|
||||
"max_steps_worked_per_tick": 100,
|
||||
"max_work_done_per_tick": 8000,
|
||||
"use_path_cache": true,
|
||||
"short_cache_size": 5,
|
||||
"long_cache_size": 25,
|
||||
"short_cache_min_cacheable_distance": 10,
|
||||
"short_cache_min_algo_steps_to_cache": 50,
|
||||
"long_cache_min_cacheable_distance": 30,
|
||||
"cache_max_connect_to_cache_steps_multiplier": 100,
|
||||
"cache_accept_path_start_distance_ratio": 0.2,
|
||||
"cache_accept_path_end_distance_ratio": 0.15,
|
||||
"negative_cache_accept_path_start_distance_ratio": 0.3,
|
||||
"negative_cache_accept_path_end_distance_ratio": 0.3,
|
||||
"cache_path_start_distance_rating_multiplier": 10,
|
||||
"cache_path_end_distance_rating_multiplier": 20,
|
||||
"stale_enemy_with_same_destination_collision_penalty": 30,
|
||||
"ignore_moving_enemy_collision_distance": 5,
|
||||
"enemy_with_different_destination_collision_penalty": 30,
|
||||
"general_entity_collision_penalty": 10,
|
||||
"general_entity_subsequent_collision_penalty": 3,
|
||||
"extended_collision_penalty": 3,
|
||||
"max_clients_to_accept_any_new_request": 10,
|
||||
"max_clients_to_accept_short_new_request": 100,
|
||||
"direct_distance_to_consider_short_request": 100,
|
||||
"short_request_max_steps": 1000,
|
||||
"short_request_ratio": 0.5,
|
||||
"min_steps_to_check_path_find_termination": 2000,
|
||||
"start_to_goal_cost_multiplier_to_terminate_path_find": 500.0,
|
||||
"overload_levels": [0, 100, 500],
|
||||
"overload_multipliers": [2, 3, 4],
|
||||
"negative_path_cache_delay_interval": 20
|
||||
},
|
||||
"max_failed_behavior_count": 3
|
||||
}
|
BIN
scenarios/OARC/blueprint.zip
Normal file
BIN
scenarios/OARC/blueprint.zip
Normal file
Binary file not shown.
@ -7,6 +7,8 @@ HOLDING_PEN_SURFACE_NAME = "oarc_holding_pen"
|
||||
|
||||
function CreateHoldingPenSurface()
|
||||
|
||||
---@type MapGenSettings
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
local map_settings = {}
|
||||
map_settings.terrain_segmentation = "none"
|
||||
map_settings.water = "none"
|
||||
@ -28,10 +30,17 @@ function CreateHoldingPenSurface()
|
||||
if game.surfaces[HOLDING_PEN_SURFACE_NAME] == nil then
|
||||
local holding_pen_surface = game.create_surface(HOLDING_PEN_SURFACE_NAME, map_settings)
|
||||
holding_pen_surface.always_day = true
|
||||
RenderPermanentGroundText(holding_pen_surface, {x=-29,y=-37}, 30, "OARC", {0.9, 0.7, 0.3, 0.8})
|
||||
holding_pen_surface.show_clouds = false
|
||||
holding_pen_surface.generate_with_lab_tiles = true
|
||||
|
||||
holding_pen_surface.request_to_generate_chunks({0,0}, 2)
|
||||
holding_pen_surface.force_generate_chunk_requests()
|
||||
RenderPermanentGroundText(holding_pen_surface, {x=-15,y=-24}, 20, "OARC", {0.9, 0.7, 0.3, 0.8})
|
||||
|
||||
-- This doesn't work if loading map data. TODO: Revert this later?
|
||||
-- Disabling this let's me launch the scenario directly from the editor while using an empty blueprint.zip as
|
||||
-- a workaround since there's a bug with the "--load-scenario" launch argument.
|
||||
-- https://forums.factorio.com/110708
|
||||
-- holding_pen_surface.request_to_generate_chunks({0,0}, 2)
|
||||
-- holding_pen_surface.force_generate_chunk_requests()
|
||||
else
|
||||
log("Holding pen surface already exists!?")
|
||||
end
|
||||
@ -59,7 +68,7 @@ function CreateHoldingPenChunks(surface, chunkArea)
|
||||
for j=chunkArea.left_top.y,chunkArea.right_bottom.y,1 do
|
||||
local distance = math.floor(i^2 + j^2)
|
||||
if (distance < 10^2) then
|
||||
table.insert(tiles, {name="grass-1", position={i, j}})
|
||||
table.insert(tiles, {name="tutorial-grid", position={i, j}})
|
||||
else
|
||||
table.insert(tiles, {name="out-of-map", position={i, j}})
|
||||
end
|
||||
|
@ -313,6 +313,16 @@ function GivePlayerStarterItems(player)
|
||||
end
|
||||
end
|
||||
|
||||
--- Delete all chunks on a surface
|
||||
--- @param surface LuaSurface
|
||||
--- @return nil
|
||||
function DeleteAllChunks(surface)
|
||||
for chunk in surface.get_chunks() do
|
||||
surface.delete_chunk({chunk.x, chunk.y})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- -- Modular armor quick start
|
||||
-- function GiveQuickStartModularArmor(player)
|
||||
-- player.insert{name="modular-armor", count = 1}
|
||||
|
@ -484,7 +484,7 @@ function SeparateSpawnsGenerateChunk(event)
|
||||
local surface = event.surface
|
||||
local chunkArea = event.area
|
||||
|
||||
if (!global.ocore.surfaces[surface.name]) then return end
|
||||
if (not global.ocore.surfaces[surface.name]) then return end
|
||||
|
||||
-- Helps scale worm sizes to not be unreasonable when far from the origin.
|
||||
if global.ocfg.gameplay.oarc_modified_enemy_spawning then
|
||||
|
Loading…
Reference in New Issue
Block a user