Added some functionality to Platforms

Replaces resource spawning system, so that the distances between resources are much bigger. Railway is needed then.

Moderators: orzelek, Dark

Dreadicon
Inserter
Inserter
Posts: 38
Joined: Sun Jun 22, 2014 9:06 am
Contact:

Added some functionality to Platforms

Post by Dreadicon »

So, I made a version of RSO which allows for partial or complete use of Straight World mod but only for platforms. You can adjust how blocky/organic the shapes are by adjusting a ratio which I added to the config. I prefer just a little bit of imperfection with an overall blocky shape. This makes them more useful and feel more like they're from some alien civilization long-past.

Anywho, made this for myself mostly, but figured others out there might like it too. Do what you will with it; if orzelek uses it I'd be honored and maybe he could stick my username in a corner of a file somewhere....or not :) It's not like I did a lot; just re-wrote the straight world code to only work for platforms if a config is changed in RSO.
Attachments
rso-mod_2.2.9.zip
Modded RSO file
(39.24 KiB) Downloaded 142 times
example
example
Capture.PNG (2.09 MiB) Viewed 4951 times
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Added some functionality to Platforms

Post by orzelek »

Looks promising :)

Since it integrates nicely I don't see any problems adding it to RSO permanently. On thing that might need tweaking is to disable the processing when platforms mod is not present to make sure it's not searching around when it doesn't need to.

I haven't played around with platforms mainly because the are kind of incompatibile with bobs+angels set.
Dreadicon
Inserter
Inserter
Posts: 38
Joined: Sun Jun 22, 2014 9:06 am
Contact:

Re: Added some functionality to Platforms

Post by Dreadicon »

I'm actually playing with Angels+bob's right now, though I did turn up the starting zone platforms a little, turned on a medium-cost recipe to make more platforms, added AAI, and a neutered version of Factorissimo(sp?) where I set them as always night, reduced their interrior size to 2/3 scale, and disabled the option for building-in-a-building. Oh, and I've added Rampant AI + Natural Evolution (because I'm a masochist who thinks the enemies should be deadly on top of all that crazyness...)

I'm almost to the point of automating platform manufacture in my first run through, so that'll help. I've been meaning to add No Handcrafting and Only Robots to make it into a proper sci-fi factory survival sim, but I'm getting my sea legs with Platforms before I do that ;) I might end up disabling some of Angel's Petrochem buildings for placement inside Factorissimo buildings; mostly tanks and refineries. We'll see.

Anywho, glad you like the look of it :) Not bad for a few hours and having completely forgotten how to Lua (been wielding C# at my work, so takes a little getting used to a squishy language again). I would have implemented a check for if Platforms exist, but that's reliant on stuff I don't know, like what order mods are loaded in, when what is called, etc., so I decided to let the one more familiar with Factorio's mod API do that ;)
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Added some functionality to Platforms

Post by orzelek »

There is a recent addition that gives a direct array for mods that are installed so it's not a problem to check for mod.
When you add Factorissimo all balancing goes away anyway - you are basically multiplying space and that has a lot of consequences for stuff like terrain grabbing and defense.
Not sure how much you can fit of angel's in one factory tho.

Your total set of mods seems.. ambitious. I got stuck on trying to do bob's+angel's with science cost tweaker to make science more costly.
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Added some functionality to Platforms

Post by orzelek »

Added this support to latest RSO version.
Thanks for preparing the code :)
Neemys
Filter Inserter
Filter Inserter
Posts: 461
Joined: Sat Apr 09, 2016 6:16 pm
Contact:

Re: Added some functionality to Platforms

Post by Neemys »

@orzelek

I'm Building-Platform author, is there something I could add in my mod to help with the support of RSO with my mod or you have taken care of everything ?

Platform incompatible with angel+bob ? Because of space needed or because some building aren't blocked ?
Want more space restriction ? Or maybe you want to be forced to use train for other thing than ore and oil ? Try Building Platform Mod !
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Added some functionality to Platforms

Post by orzelek »

Neemys wrote:@orzelek

I'm Building-Platform author, is there something I could add in my mod to help with the support of RSO with my mod or you have taken care of everything ?

Platform incompatible with angel+bob ? Because of space needed or because some building aren't blocked ?
Dreadicon did all the worka nd I integrated it already.

And angel+bob and platforms is to hardcore. They would need to be much bigger - small output high grade smelting facility might need 3-4 chunks of space :)
Even then it would be a pain looking at sice of my sorting areas - and I didn't have petrochem then.
Dreadicon
Inserter
Inserter
Posts: 38
Joined: Sun Jun 22, 2014 9:06 am
Contact:

Re: Added some functionality to Platforms

Post by Dreadicon »

Glad my code was useful!

Concerning the matter of Factorissimo, thanks to my nerfs and tweaks, it is about a 1:3 ratio of expansion, and I've disabled the power plant option (so no packing steam generators or solar panels in them). This means that where previously one had to scrunch their factory into convoluted shapes, now, one just has to have multiple factories and move goods between them. This gets balanced out thanks to Angels + Bob's, which demand a lot of process and space. Also I denied some of the Angel's buildings from being placed inside, such as Ore Sorter and the various Refineries. I play with a medium-expense platform placement option (custom one using stone, concrete, and iron sticks, to the tune of 100/30/80) so I can expand, but generally it's best to just make separate factories. Mostly the recipe is so that I can make better use of odd shaped platforms.

More than anything, imo the combo of (nerfed)Factorissimo + Platforms changes the gameplay from 'build mega busses' to 'build modular factories'. I'm still adapting, and eventually I plan to add no hand crafting, only robot building, and finally I will add one that slices your inventory to a single row (expandable via power suit to a small degree). I mean, really, what use are cars otherwise? ;)
Dreadicon
Inserter
Inserter
Posts: 38
Joined: Sun Jun 22, 2014 9:06 am
Contact:

Re: Added some functionality to Platforms

Post by Dreadicon »

Hey Orzelek, encountered an error in the Platforms code I wrote when using my monstrous pile of mods; LuaTile API call when LuaTile was invalid.

Already tracked down the cause and fixed it; new straight_world_platforms.lua code below. Essentially in some cases tiles can be called before they are 'valid', or they can be null. Added a couple null checks and a (tile).valid check. Toss it in your next update if you would; not especially urgent as I think this is an edge case caused by one of my other mods. Thanks!

Code: Select all

require("config")

local blocksize=6
local blockThreshold=straightWorldPlatformsThreshold
local blocksizem1=blocksize-1
local platformName = "building-platform"

function straightWorldPlatforms(surface, leftTop, rightBottom)
  local lt = leftTop
  local rb = rightBottom
  if surface == nil then
    return
  end
  for y0=lt.y,rb.y-1,blocksize do
    for x0=lt.x,rb.x-1,blocksize do
		--Check all blocks for platforms
		local replaceBlocks = false	
		local blockCount = 0
		for y1=y0,y0+blocksizem1 do
			for x1=x0,x0+blocksizem1 do
			  local tileObj = surface.get_tile(x1,y1)
			  if tileObj ~= nil and tileObj.valid then 
			    local tile=tileObj.name
			    if tile == platformName then 	
				  blockCount = blockCount + 1
			    end
			    if blockCount > (blocksize * blocksize) * blockThreshold then
			      replaceBlocks = true
				  break
			    end
			  end
			end
			if replaceBlocks == true then break end
		end
		--if enough platforms are found, replace the blocks
		if replaceBlocks then 
		  local tiles={}
		  for y=y0,y0+blocksizem1 do
			for x=x0,x0+blocksizem1 do
			  table.insert(tiles,{name=platformName,position={x,y}})
			end
		  end
		  surface.set_tiles(tiles) 
		end
    end
  end
end
orzelek
Smart Inserter
Smart Inserter
Posts: 3923
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Added some functionality to Platforms

Post by orzelek »

I add it along. I'm not sure if there will be any release before 0.15 - depends on how long devs will make us wait ;)
Post Reply

Return to “Resource Spawner Overhaul”