Game Limitations

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
User avatar
SoulForge
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Wed Apr 13, 2016 6:58 pm
Contact:

Game Limitations

Post by SoulForge »

Can someone give me some more information on this error. I have a number of mods installed but I didn't think I was at this kinda wall yet;
14.428 Error Util.cpp:57: Reached id limit for equipment-grid. The game can't contain more than 255 instances of this prototype due to hardcoded limits of the engine.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Game Limitations

Post by aubergine18 »

Looks like a mod has been creating crazy numbers of equipment item prototypes. Do you have any mods that add lots of equipments (or maybe lots of equipment tech upgrades)?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
User avatar
SoulForge
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Wed Apr 13, 2016 6:58 pm
Contact:

Re: Game Limitations

Post by SoulForge »

I did just update Cursed-Exp-Remake_0.5.4. I didn't think it added anything like that.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14280
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Game Limitations

Post by Rseding91 »

I'd be interested in known which mod is making so many different kinds of equipment grids and why if you do find out.
If you want to get ahold of me I'm almost always on Discord.
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Game Limitations

Post by daniel34 »

Cursed-Exp-Remake_0.5.4 (https://mods.factorio.com/mods/PhoNoThe ... Exp-Remake) creates 250 different armors in prototypes/items/cursed-armors.lua, the amount is defined in data.lua.

AFAIK it's a mod that allows you to get experience points by doing different tasks and lets you level up your character/equipment.
It probably works when used alone but if you use other mods that also add a few armors you hit the 255 limit.
quick links: log file | graphical issues | wiki
Rseding91
Factorio Staff
Factorio Staff
Posts: 14280
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Game Limitations

Post by Rseding91 »

daniel34 wrote:Cursed-Exp-Remake_0.5.4 (https://mods.factorio.com/mods/PhoNoThe ... Exp-Remake) creates 250 different armors in prototypes/items/cursed-armors.lua, the amount is defined in data.lua.

AFAIK it's a mod that allows you to get experience points by doing different tasks and lets you level up your character/equipment.
It probably works when used alone but if you use other mods that also add a few armors you hit the 255 limit.
Is it actually making 250 different kinds of equipment grids or is it just making a new identical grid with different armor stats?
If you want to get ahold of me I'm almost always on Discord.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5267
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Game Limitations

Post by Klonan »

Rseding91 wrote:
daniel34 wrote:Cursed-Exp-Remake_0.5.4 (https://mods.factorio.com/mods/PhoNoThe ... Exp-Remake) creates 250 different armors in prototypes/items/cursed-armors.lua, the amount is defined in data.lua.

AFAIK it's a mod that allows you to get experience points by doing different tasks and lets you level up your character/equipment.
It probably works when used alone but if you use other mods that also add a few armors you hit the 255 limit.
Is it actually making 250 different kinds of equipment grids or is it just making a new identical grid with different armor stats?
Its doing some crazy stuff:

Code: Select all

local r = -- resistances starting level
{
	p = 1, -- physical
	a = 5, -- acid
	l = 10, -- laser
	e = 15, -- explosion
	i = 20, -- impact
	po = 25, -- poison
	f = 30 -- fire
}
local armordatos = {}
armordatos.minflat = 2.5 --flat reduction at lvl 1
armordatos.maxflat = 8 - armordatos.minflat -- flat reduction at level [ breakflatlevel ]
armordatos.maxmaxflat = 15 -- max flat reduction at level [ datos.maxarmor ]
armordatos.breakflatlevel = 50 -- break level, finish maxflat, starts maxmaxflat
armordatos.minperc = 20 -- percent reduction at lvl 1
armordatos.maxpercent = 50 - armordatos.minperc -- max percent reduction at level [ breakpercentlevel ]
armordatos.breakpercentlevel = 50 -- final level for percent reduction
armordatos.mingrid = 2 -- min grid :lol:
armordatos.maxgrid = 42 - armordatos.mingrid -- max grid

for i = 1, datos.maxarmor do

	local armor = util.table.deepcopy(data.raw["armor"]["modular-armor"])
	armor.name = "cursed-armor-" .. i
	local f = math.ceil(i * datos.maxarmorimg / datos.maxarmor)
	armor.icon = "__Cursed-Exp-Remake__/graphics/icons/armor/cursed-armor-" .. f .. ".jpg"
	armor.durability = 50000
	armor.subgroup = "cursed-armor"
	armor.order = "c-b"
	armor.stack_size = 1
    data:extend({{
    type = "equipment-grid",
    name = "cursed-equipment-grid-" .. i,
    width = math.floor(i * armordatos.maxgrid / 250) + armordatos.mingrid,
    height = math.floor(i * armordatos.maxgrid / 250) + armordatos.mingrid,
    equipment_categories = {"armor"}
    }})
	armor.equipment_grid = "cursed-equipment-grid-" .. i
	armor.resistances = {}
	if i >=  r.p then
		armor.resistances[#armor.resistances + 1] = {}
		armor.resistances[#armor.resistances].type = "physical"
		if i < armordatos.breakflatlevel then
			armor.resistances[#armor.resistances].decrease = math.floor(((i - (r.p - 1)) * armordatos.maxflat / (armordatos.breakflatlevel - (r.p - 1))) * 100) / 100 + armordatos.minflat
		else
			armor.resistances[#armor.resistances].decrease = math.floor(((i - (r.p - 1) - armordatos.breakflatlevel) * armordatos.maxmaxflat / (datos.maxarmor - (r.p - 1) - armordatos.breakflatlevel)) * 100) / 100 + armordatos.minflat + armordatos.maxflat
		end
		if i < armordatos.breakpercentlevel then 
			armor.resistances[#armor.resistances].percent = math.floor(((i - (r.p - 1)) * armordatos.maxpercent / (armordatos.breakpercentlevel - (r.p - 1)) ) * 100) / 100 + armordatos.minperc
		else
			armor.resistances[#armor.resistances].percent = armordatos.maxpercent + armordatos.minperc
		end
	end
	if i >= r.a then
		armor.resistances[#armor.resistances + 1] = {}
		armor.resistances[#armor.resistances].type = "acid"
		if i < armordatos.breakflatlevel then
			armor.resistances[#armor.resistances].decrease = math.floor(((i - (r.a - 1)) * armordatos.maxflat / (armordatos.breakflatlevel - (r.a - 1))) * 100) / 100 + armordatos.minflat
		else
			armor.resistances[#armor.resistances].decrease = math.floor(((i - (r.a - 1) - armordatos.breakflatlevel) * armordatos.maxmaxflat / (datos.maxarmor - (r.a - 1) - armordatos.breakflatlevel)) * 100) / 100 + armordatos.minflat + armordatos.maxflat
		end
		if i < armordatos.breakpercentlevel then 
			armor.resistances[#armor.resistances].percent = math.floor(((i - (r.a - 1)) * armordatos.maxpercent / (armordatos.breakpercentlevel - (r.a - 1)) ) * 100) / 100 + armordatos.minperc
		else
			armor.resistances[#armor.resistances].percent = armordatos.maxpercent + armordatos.minperc
		end
	end
	if i >= r.l then
		armor.resistances[#armor.resistances + 1] = {}
		armor.resistances[#armor.resistances].type = "laser"
		if i < armordatos.breakflatlevel then
			armor.resistances[#armor.resistances].decrease = math.floor(((i - (r.l - 1)) * armordatos.maxflat / (armordatos.breakflatlevel - (r.l - 1))) * 100) / 100 + armordatos.minflat
		else
			armor.resistances[#armor.resistances].decrease = math.floor(((i - (r.l - 1) - armordatos.breakflatlevel) * armordatos.maxmaxflat / (datos.maxarmor - (r.l - 1) - armordatos.breakflatlevel)) * 100) / 100 + armordatos.minflat + armordatos.maxflat
		end
		if i < armordatos.breakpercentlevel then 
			armor.resistances[#armor.resistances].percent = math.floor(((i - (r.l - 1)) * armordatos.maxpercent / (armordatos.breakpercentlevel - (r.l - 1)) ) * 100) / 100 + armordatos.minperc
		else 
			armor.resistances[#armor.resistances].percent = armordatos.maxpercent + armordatos.minperc
		end
	end
	if i >= r.e then
		armor.resistances[#armor.resistances + 1] = {}
		armor.resistances[#armor.resistances].type = "explosion"
		if i < armordatos.breakflatlevel then
			armor.resistances[#armor.resistances].decrease = math.floor(((i - (r.e - 1)) * armordatos.maxflat / (armordatos.breakflatlevel - (r.e - 1))) * 100) / 100 + armordatos.minflat
		else
			armor.resistances[#armor.resistances].decrease = math.floor(((i - (r.e - 1) - armordatos.breakflatlevel) * armordatos.maxmaxflat / (datos.maxarmor - (r.e - 1) - armordatos.breakflatlevel)) * 100) / 100 + armordatos.minflat + armordatos.maxflat
		end
		if i < armordatos.breakpercentlevel then 
			armor.resistances[#armor.resistances].percent = math.floor(((i - (r.e - 1)) * armordatos.maxpercent / (armordatos.breakpercentlevel - (r.e - 1)) ) * 100) / 100 + armordatos.minperc
		else 
			armor.resistances[#armor.resistances].percent = armordatos.maxpercent + armordatos.minperc
		end
	end
	if i >= r.i then
		armor.resistances[#armor.resistances + 1] = {}
		armor.resistances[#armor.resistances].type = "impact"
		if i < armordatos.breakflatlevel then
			armor.resistances[#armor.resistances].decrease = math.floor(((i - (r.i - 1)) * armordatos.maxflat / (armordatos.breakflatlevel - (r.i - 1))) * 100) / 100 + armordatos.minflat
		else
			armor.resistances[#armor.resistances].decrease = math.floor(((i - (r.i - 1) - armordatos.breakflatlevel) * armordatos.maxmaxflat / (datos.maxarmor - (r.i - 1) - armordatos.breakflatlevel)) * 100) / 100 + armordatos.minflat + armordatos.maxflat
		end
		if i < armordatos.breakpercentlevel then 
			armor.resistances[#armor.resistances].percent = math.floor(((i - (r.i - 1)) * armordatos.maxpercent / (armordatos.breakpercentlevel - (r.i - 1)) ) * 100) / 100 + armordatos.minperc
		else 
			armor.resistances[#armor.resistances].percent = armordatos.maxpercent + armordatos.minperc
		end
	end
	if i >= r.po then
		armor.resistances[#armor.resistances + 1] = {}
		armor.resistances[#armor.resistances].type = "poison"
		if i < armordatos.breakflatlevel then
			armor.resistances[#armor.resistances].decrease = math.floor(((i - (r.po - 1)) * armordatos.maxflat / (armordatos.breakflatlevel - (r.po - 1))) * 100) / 100 + armordatos.minflat
		else
			armor.resistances[#armor.resistances].decrease = math.floor(((i - (r.po - 1) - armordatos.breakflatlevel) * armordatos.maxmaxflat / (datos.maxarmor - (r.po - 1) - armordatos.breakflatlevel)) * 100) / 100 + armordatos.minflat + armordatos.maxflat
		end
		if i < armordatos.breakpercentlevel then 
			armor.resistances[#armor.resistances].percent = math.floor(((i - (r.po - 1)) * armordatos.maxpercent / (armordatos.breakpercentlevel - (r.po - 1)) ) * 100) / 100 + armordatos.minperc
		else
			armor.resistances[#armor.resistances].percent = armordatos.maxpercent + armordatos.minperc
		end
	end
	if i >= r.f then
		armor.resistances[#armor.resistances + 1] = {}
		armor.resistances[#armor.resistances].type = "fire"
		if i < armordatos.breakflatlevel then
			armor.resistances[#armor.resistances].decrease = math.floor(((i - (r.f - 1)) * armordatos.maxflat / (armordatos.breakflatlevel - (r.f - 1))) * 100) / 100 + armordatos.minflat
		else
			armor.resistances[#armor.resistances].decrease = math.floor(((i - (r.f - 1) - armordatos.breakflatlevel) * armordatos.maxmaxflat / (datos.maxarmor - (r.f - 1) - armordatos.breakflatlevel)) * 100) / 100 + armordatos.minflat + armordatos.maxflat
		end
		if i < armordatos.breakpercentlevel then 
			armor.resistances[#armor.resistances].percent = math.floor(((i - (r.f - 1)) * armordatos.maxpercent / (armordatos.breakpercentlevel - (r.f - 1)) ) * 100) / 100 + armordatos.minperc
		else 
			armor.resistances[#armor.resistances].percent = armordatos.maxpercent + armordatos.minperc
		end
	end
	data.raw[armor.type][armor.name] = armor
end


daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Game Limitations

Post by daniel34 »

It creates a new equipment grid for each armor, at level 1 the grid size is 2x2 which grows linearly until at level 250 it is 42x42. At level 50 for example it would be 10x10. Although it creates 250 equipment grids numbered 1 to 250 there are only ~40 distinct grids.

It also does something similar with all the resistances, it scales them with the level so each armor has different resistances.
It picks the icon for the armor from a pool of 110 different images it has, so that each image corresponds to 2 or 3 armors.
quick links: log file | graphical issues | wiki
Post Reply

Return to “Technical Help”