Friday Facts #165 - Death by a thousand cuts
Re: Friday Facts #165 - Death by a thousand cuts
Super psyched about the performance improvements.
When you do profiling, do you run at unlimited UPS or does the game still max at 60? It might be useful to disable v-sync and run at unlimited UPS. CPU time percentages should be about the same but it would take much less real time to simulate the same scenario.
When you do profiling, do you run at unlimited UPS or does the game still max at 60? It might be useful to disable v-sync and run at unlimited UPS. CPU time percentages should be about the same but it would take much less real time to simulate the same scenario.
-
- Manual Inserter
- Posts: 2
- Joined: Sat Nov 19, 2016 7:48 am
- Contact:
Re: Friday Facts #165 - Death by a thousand cuts
Feature request:Right now when you want to customize a particular mod you have to:
1. Know what folder the mods are stored on your computer
add a button in mods window like "Open mods location"
-
- Filter Inserter
- Posts: 299
- Joined: Sun Jun 12, 2016 11:29 pm
- Contact:
Re: Friday Facts #165 - Death by a thousand cuts
Mod settings! Yay!
Now for... map-bound mods. Generally, better mod management, where you bind mod to a map so whichever mods you have installed or install new, the mods a map runs with remains a fixed set. Right now, if you install a new mod, or any enabled mod that is, gets run for any map you load. Which means you *manually* have to enable/disable the mods you want to play *this* map with... that's just not manageable.
Or, and of course those mod settings need to be per-map too, not global.
Now for... map-bound mods. Generally, better mod management, where you bind mod to a map so whichever mods you have installed or install new, the mods a map runs with remains a fixed set. Right now, if you install a new mod, or any enabled mod that is, gets run for any map you load. Which means you *manually* have to enable/disable the mods you want to play *this* map with... that's just not manageable.
Or, and of course those mod settings need to be per-map too, not global.
Re: Friday Facts #165 - Death by a thousand cuts
For all those fellas who wanted a wallpaper, I did some photoshop and created you this. So hopefully this could help waiting for the official wallpaper
-
- Long Handed Inserter
- Posts: 61
- Joined: Thu Sep 10, 2015 2:29 am
- Contact:
Re: Friday Facts #165 - Death by a thousand cuts
For one of the configurable mod settings, may i suggest changing and/or ignoring supported factorio version? I typically play experimentals and manually edit the mods to be supportable for the next version. this allows those daring to keep using mods (and detect any flaws/changes the mod creator may need to make) to do so readily.
Re: Friday Facts #165 - Death by a thousand cuts
i have not read all but
why make this big blabla with all the modfiles? makeing a gui for changes? worktime could be much faster.
Just AUTO-DOWNLOAD the mods via eachPlayers if there are changes.
Skip working on what happen if server and client not have same mod installed. AUTO-INSTALL them!
The mod-database can be the HOST-Server for that.
AUTO_MOD_ACTIVE/deactiveate !!
why make this big blabla with all the modfiles? makeing a gui for changes? worktime could be much faster.
Just AUTO-DOWNLOAD the mods via eachPlayers if there are changes.
Skip working on what happen if server and client not have same mod installed. AUTO-INSTALL them!
The mod-database can be the HOST-Server for that.
AUTO_MOD_ACTIVE/deactiveate !!
Re: Friday Facts #165 - Death by a thousand cuts
So you want to restart your game every time you want to change something with a mod? Restart your game every time it downloads the mods to join a particular server?noliVe wrote:i have not read all but
why make this big blabla with all the modfiles? makeing a gui for changes? worktime could be much faster.
Just AUTO-DOWNLOAD the mods via eachPlayers if there are changes.
Skip working on what happen if server and client not have same mod installed. AUTO-INSTALL them!
The mod-database can be the HOST-Server for that.
AUTO_MOD_ACTIVE/deactiveate !!
If you want to get ahold of me I'm almost always on Discord.
-
- Inserter
- Posts: 33
- Joined: Sun Jun 26, 2016 9:37 pm
- Contact:
Re: Friday Facts #165 - Death by a thousand cuts
We were having some performance trouble in our 3-player game, so all this optimization work is very appreciated
One thing we found to be particularly expensive is battles. Essentially everything would run smoothly, until one of us went head-on into a large-ish Biter base and throws grenades at everything, or, alternatively, burns everything to the ground using the flamethrower.
Also maybe it's worth to work on the failure mode for the game getting slow... we had the game almost unplayable because the host was fine, but one of the other players couldn't catch up. So on his machine, the player would just freeze. We'd rather have everyone slowed down a little than stop playing the game because one of us just can't move.
One thing we found to be particularly expensive is battles. Essentially everything would run smoothly, until one of us went head-on into a large-ish Biter base and throws grenades at everything, or, alternatively, burns everything to the ground using the flamethrower.
Also maybe it's worth to work on the failure mode for the game getting slow... we had the game almost unplayable because the host was fine, but one of the other players couldn't catch up. So on his machine, the player would just freeze. We'd rather have everyone slowed down a little than stop playing the game because one of us just can't move.
Re: Friday Facts #165 - Death by a thousand cuts
no logic, you always have to restart your game when join a server with different mods.Rseding91 wrote: So you want to restart your game every time you want to change something with a mod? Restart your game every time it downloads the mods to join a particular server?
where is the difference ? i tell you
- you dont have to search the mods on your own.
- you dont have to install them manually
- you never forget any mods
- changes to any mod will AUTOcorrect them
- automatic DEactivate and Activate to all needet mods
Re: Friday Facts #165 - Death by a thousand cuts
Right now, yes. But here's the thing: What if you didn't need to?noliVe wrote:no logic, you always have to restart your game when join a server with different mods.Rseding91 wrote: So you want to restart your game every time you want to change something with a mod? Restart your game every time it downloads the mods to join a particular server?
Re: Friday Facts #165 - Death by a thousand cuts
i forgot to say
Join a new server you ALWAYS restart the game.
Activate/deactivate even a SINGLE mod restart the game
and you forgot a single mod... restart again.. grrr.
That! is something really bugging me to hell
And AutoMod download helps smaller MOD-Devs finding their mods.
Have you seen some servers with soooo many mods in there? Yes there are some having 20+ mods...
all the time searching for that oO
Even we Crew I-Craft on our Server.list website you can download all mods in ONE Click
Http://i-craft.de/factorio-list/ (Details)
AUTO-MOD DOWNLOAD! that would be awesome
Join a new server you ALWAYS restart the game.
Activate/deactivate even a SINGLE mod restart the game
and you forgot a single mod... restart again.. grrr.
That! is something really bugging me to hell
And AutoMod download helps smaller MOD-Devs finding their mods.
Have you seen some servers with soooo many mods in there? Yes there are some having 20+ mods...
all the time searching for that oO
Even we Crew I-Craft on our Server.list website you can download all mods in ONE Click
Http://i-craft.de/factorio-list/ (Details)
AUTO-MOD DOWNLOAD! that would be awesome
Re: Friday Facts #165 - Death by a thousand cuts
I too have been silently concerned about performance of my mod sometimes. It takes just 0.25ms or so but it was more than many actually big mods. So when i looked in the code:
There wasn't any glaringly obvious... except for "local player = ...". I assume LUA doesn't work with pointer references, so what it actually does is copy the entire player structure (which is apparently big), and it does that every second tick for every player. So i'd assume solution is to get rid of it and use direct reference:
So yeah, i don't know if you are dealing with these sort of code pieces, but it's a thing
Other thing i often see is people use sqrt() when counting if something is within circular radius. a^2 + b^2 = c^2, so all you need to do is square the comparison value.
Code: Select all
script.on_event(defines.events.on_tick, function(event)
if game.tick % 2 == 0 then
for i = 1, #game.players do
local player = game.players[i]
if player.vehicle and player.vehicle.valid then
local v = player.vehicle.type
if v == "car" or v == "tank" then
...
end
end
end
end
end
Code: Select all
if game.players[i].vehicle and game.players[i].vehicle.valid then
Other thing i often see is people use sqrt() when counting if something is within circular radius. a^2 + b^2 = c^2, so all you need to do is square the comparison value.
Re: Friday Facts #165 - Death by a thousand cuts
Can I throw in my two-penneth on optimisation?
The loading screen.
I have a laptop with an SSD and it takes 10-15 seconds to get to the menu. Given that there are no credits, or unskippable logos or any other tripe, it's probably one of the longest loading screens I've ever seen.
Can we not load what's needed for the menu, and then background-load the rest while people are in the menu and configuring/loading their game.
Especially when you do mod-installs or removes and then it restarts, it can be a long time with no interaction possible before you get back in.
And are things being done right for it to take quite so long? I understand there are probably a LOT of sprites etc. to load into graphics RAM (and it seems like you do your best to optimise at runtime by cropping them down to take less graphics RAM or whatever) but it's the only part where I feel like I'm waiting for the game.
And if that's happening on an SSD with a decent nVidia graphics card, I wonder what people with lesser machines are experiencing?
The loading screen.
I have a laptop with an SSD and it takes 10-15 seconds to get to the menu. Given that there are no credits, or unskippable logos or any other tripe, it's probably one of the longest loading screens I've ever seen.
Can we not load what's needed for the menu, and then background-load the rest while people are in the menu and configuring/loading their game.
Especially when you do mod-installs or removes and then it restarts, it can be a long time with no interaction possible before you get back in.
And are things being done right for it to take quite so long? I understand there are probably a LOT of sprites etc. to load into graphics RAM (and it seems like you do your best to optimise at runtime by cropping them down to take less graphics RAM or whatever) but it's the only part where I feel like I'm waiting for the game.
And if that's happening on an SSD with a decent nVidia graphics card, I wonder what people with lesser machines are experiencing?
Re: Friday Facts #165 - Death by a thousand cuts
Regarding playing with different mods, is there an easy way to play several local games with different mods and switch between them without having to manually toggle the mods needed? I know Factorio has to restart when changing mods, but it would be great to have a button that lets one switch to the mods of a saved game in the loading menu.
Re: Friday Facts #165 - Death by a thousand cuts
Best solution i know to that is using any Factorio Mod Manager. Such thing loads instantly and can save several different mod configurations, or a profile to instantly disable all mods. It writes the mod configuration file on Factorios behalf so you'll see the effect immediately ingame once you launch game.brab wrote:Regarding playing with different mods, is there an easy way to play several local games with different mods and switch between them without having to manually toggle the mods needed? I know Factorio has to restart when changing mods, but it would be great to have a button that lets one switch to the mods of a saved game in the loading menu.
Re: Friday Facts #165 - Death by a thousand cuts
Nice! Thank you for the suggestion.Zaflis wrote:Best solution i know to that is using any Factorio Mod Manager. Such thing loads instantly and can save several different mod configurations, or a profile to instantly disable all mods. It writes the mod configuration file on Factorios behalf so you'll see the effect immediately ingame once you launch game.brab wrote:Regarding playing with different mods, is there an easy way to play several local games with different mods and switch between them without having to manually toggle the mods needed? I know Factorio has to restart when changing mods, but it would be great to have a button that lets one switch to the mods of a saved game in the loading menu.
Re: Friday Facts #165 - Death by a thousand cuts
What I do most of the time if I need to use more than 1 mod "pack" for different local games/servers is... make few copies of "mods" folder where it's stored in %appdata%. Then I manually rename it to something like "mods_sp_bobs" and change the one i want to currently use back to plain "mods".brab wrote:Regarding playing with different mods, is there an easy way to play several local games with different mods and switch between them without having to manually toggle the mods needed? I know Factorio has to restart when changing mods, but it would be great to have a button that lets one switch to the mods of a saved game in the loading menu.
Re: Friday Facts #165 - Death by a thousand cuts
Regarding maintaining different "modpacks" for different games:
There's a command line option to change which folder Factorio looks in for mods. I make a desktop shortcut for each set of mods I'm actively using.
For the Steam version:
"C:\Program Files (x86)\Steam\Steam.exe" -applaunch 427520 --mod-directory %APPDATA%\Factorio\packs\YourPackFolder
For the Website versions:
factorio.exe --mod-directory %APPDATA%\Factorio\packs\YourPackFolder
You'll need to adjust those to fit your configuration of course. I find it's at least as reliable as any mod manager, and the ingame mod downloader will use whatever you've pointed the game at.
There's a command line option to change which folder Factorio looks in for mods. I make a desktop shortcut for each set of mods I'm actively using.
For the Steam version:
"C:\Program Files (x86)\Steam\Steam.exe" -applaunch 427520 --mod-directory %APPDATA%\Factorio\packs\YourPackFolder
For the Website versions:
factorio.exe --mod-directory %APPDATA%\Factorio\packs\YourPackFolder
You'll need to adjust those to fit your configuration of course. I find it's at least as reliable as any mod manager, and the ingame mod downloader will use whatever you've pointed the game at.
Re: Friday Facts #165 - Death by a thousand cuts
Well, a bit late but still -
first off - the render, even though simple (or maybe because of that), is beautiful, made it to my wallpaper
Now, about optimalisations - the game runs smooth for me, I didn't notice any drops so far, co - needless to say - I am really pumped to see it getting even more smooth
About mod support - I play only vanilla version so far, but I might help myself to some, regarding trains handling
And hey, I still think of that Gustav, you know? He would render very well too I think
first off - the render, even though simple (or maybe because of that), is beautiful, made it to my wallpaper
Now, about optimalisations - the game runs smooth for me, I didn't notice any drops so far, co - needless to say - I am really pumped to see it getting even more smooth
About mod support - I play only vanilla version so far, but I might help myself to some, regarding trains handling
And hey, I still think of that Gustav, you know? He would render very well too I think
For those that do not know what Gustav
Re: Friday Facts #165 - Death by a thousand cuts
No, LUA can pass objects by reference.Zaflis wrote:I too have been silently concerned about performance of my mod sometimes. It takes just 0.25ms or so but it was more than many actually big mods. So when i looked in the code:There wasn't any glaringly obvious... except for "local player = ...". I assume LUA doesn't work with pointer references, so what it actually does is copy the entire player structure (which is apparently big), and it does that every second tick for every player. So i'd assume solution is to get rid of it and use direct reference:Code: Select all
script.on_event(defines.events.on_tick, function(event) if game.tick % 2 == 0 then for i = 1, #game.players do local player = game.players[i] if player.vehicle and player.vehicle.valid then local v = player.vehicle.type if v == "car" or v == "tank" then ... end end end end end
So yeah, i don't know if you are dealing with these sort of code pieces, but it's a thingCode: Select all
if game.players[i].vehicle and game.players[i].vehicle.valid then
Other thing i often see is people use sqrt() when counting if something is within circular radius. a^2 + b^2 = c^2, so all you need to do is square the comparison value.
http://stackoverflow.com/questions/6128 ... -reference
Code: Select all
local player = game.players[i]
Here is a link shared by Choumiko: https://springrts.com/wiki/Lua_Performa ... _for-loops
And I wonder
Code: Select all
for i = 1, #game.players do
Code: Select all
for index, player in pairs(game.players) do