[MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Topics and discussion about specific mods
User avatar
jockeril
Filter Inserter
Filter Inserter
Posts: 357
Joined: Sun Feb 08, 2015 11:04 am
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by jockeril »

Afforess - I was thinking about ammobox and remembered there is a similar stacker for the combat shotgun too, so I did some googling, and found this AA-12 combat shotgun (article picture below) with this MD-20 drum (20-round magazine/drum article) and a youtube video to show it off (don't mind the crazy, unprofessional russian demonstrating it :roll: )

Would you please add a shotgun "ammo box" to the game :mrgreen: ?
I'm thinking 10-50 (how about 20 ?) shotgun shells and the stack size could be 50 - since it is much stronger than the piercing rounds and it could be called "shotgun ammo box"


Image
[request] RTL support please

My mods

Formally Hebrew translator for FARL & EvoGUI mods

join me on
- Twitter[@jockeril],
- Twitch.tv/jockeril,
- Youtube/jocker-il (or JoCKeR-iL)
- and steam !
Image

User avatar
Bl4ckmail
Inserter
Inserter
Posts: 29
Joined: Sun Aug 16, 2015 10:31 pm
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by Bl4ckmail »

Afforess wrote:
Bl4ckmail wrote:Lol i never saw your mod before and decided to make aLogistic turrets mod myself and uploaded it yesterday. And now i get to see this post.
:lol: You might want to take a look at how I made the logistics container invisible, and the turret in-operable. It's a bit more polished that way.

If you want to build off this mod and have your mod add new gun turret types (e.g sniper?), that would also be cool. I don't really have any plans to expand this mod, I'm happy with the way it works now.
in the new version i did make it simmaler to your way if you want to check it out Download

User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by Afforess »

jockeril wrote:Afforess - I was thinking about ammobox and remembered there is a similar stacker for the combat shotgun too
I'll see if I can find some decent icon images for shotgun shells, and add it. ;)

NoriSilverrage
Fast Inserter
Fast Inserter
Posts: 159
Joined: Mon Mar 21, 2016 1:19 pm
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by NoriSilverrage »

jockeril wrote:Afforess - I was thinking about ammobox and remembered there is a similar stacker for the combat shotgun too, so I did some googling, and found this AA-12 combat shotgun (article picture below) with this MD-20 drum (20-round magazine/drum article) and a youtube video to show it off (don't mind the crazy, unprofessional russian demonstrating it :roll: )

Would you please add a shotgun "ammo box" to the game :mrgreen: ?
I'm thinking 10-50 (how about 20 ?) shotgun shells and the stack size could be 50 - since it is much stronger than the piercing rounds and it could be called "shotgun ammo box"


Image
This would be pretty nice. :)

Also, slightly off topic, but the FPSRussia guy isn't Russian. I was sad when I found this out...

NoriSilverrage
Fast Inserter
Fast Inserter
Posts: 159
Joined: Mon Mar 21, 2016 1:19 pm
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by NoriSilverrage »

I don't suppose there is a way to get autofill to put ammo in these turrets? Or a way to make blueprints apply the logistics? A bit tough to use it large scale :(

User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by Afforess »

NoriSilverrage wrote:I don't suppose there is a way to get autofill to put ammo in these turrets? Or a way to make blueprints apply the logistics? A bit tough to use it large scale :(
See extra addons on the OP.

NoriSilverrage
Fast Inserter
Fast Inserter
Posts: 159
Joined: Mon Mar 21, 2016 1:19 pm
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by NoriSilverrage »

Afforess wrote:
NoriSilverrage wrote:I don't suppose there is a way to get autofill to put ammo in these turrets? Or a way to make blueprints apply the logistics? A bit tough to use it large scale :(
See extra addons on the OP.
Oh, huh, sorry. :)

malecord
Fast Inserter
Fast Inserter
Posts: 134
Joined: Wed Mar 23, 2016 11:23 am
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by malecord »

Cool mod. The double entity is a really clever workaround. Thank you a lot!

I've adjusted the numbers in your mod to my liking. I've reduced turret range to 19 but added resistances. Increased the cost, especially steel.

I don't want to substitute lasers completely. I'm looking for a setup where each turret has his role. Lasers have good range to "get the attention of bugs" and enough damage to kill small parties before they reach the walls. Full upgraded vanilla gun turrets already have the crazy damage needed to make short work of any bug that comes to near. What they really lack number wise is some tankiness especially vs large number of spitters. They explode to quickly. With the new numbers they fit this role nicely: they stay in the front soaking damage and they destroy any biter fool enough to reach the walls.

I've also reduced the steel cost of boxes. I really don't see where 25 steel can fit into a box that's already full of steel bullets. I think 5 is more than enough.

mooklepticon
Fast Inserter
Fast Inserter
Posts: 237
Joined: Wed Mar 02, 2016 10:09 pm
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by mooklepticon »

I'm having trouble with blueprints. It doesn't always place the turret. It's a little weird. Sometimes it'll place the whole turret. Sometimes it'll place this invisible thing that has the same name.

User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by Afforess »

The latest version of AmmoBox was updated to work for Factorio 0.13 and is available on the mod portal: https://mods.factorio.com/mods/Afforess/AmmoBox

Tyrindor
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sun Jul 03, 2016 10:06 am
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by Tyrindor »

Like the mod, but please give a way to disable the turret MK2 in config. It's not balanced for some other mods I use.

User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by Afforess »

Tyrindor wrote:Like the mod, but please give a way to disable the turret MK2 in config. It's not balanced for some other mods I use.
No thanks. Edit it yourself, but I generally don't provide configurations. Its a waste of my time. Doubly so with thanks to the mod portal.

Tyrindor
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sun Jul 03, 2016 10:06 am
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by Tyrindor »

Afforess wrote:
Tyrindor wrote:Like the mod, but please give a way to disable the turret MK2 in config. It's not balanced for some other mods I use.
No thanks. Edit it yourself, but I generally don't provide configurations. Its a waste of my time. Doubly so with thanks to the mod portal.
Well not everyone knows how to mod, which is why configs exist. The same reason why the 10 mods that add a random radar to their mod, all have a config options to disable it achieve better balance in any modded game. *shrug*

That's your call I guess....

SquarelyCircle
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Sat Jan 07, 2017 12:17 am
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by SquarelyCircle »

I have no idea why, but Ammobox is using a ton of CPU time late game. I'm not even using much of the ammo from it at this point, but it's using 1/16 of the available CPU time each frame... which is a TON for a single mod. Does Ammobox make calculations each frame or something?

Update: Just glancing at the code (I'm new to Factorio modding and Lua), it seems like the ammobox itself is just an item, but the turret has some calculations. Honestly, if I made this mod, I'd drop the turret all together, and make it a separate mod, as it causes issues that aren't in line with an ammobox mod. With your permission, I'd be willing to tease them apart and release a solo ammobox mod, but I feel like you've done the work for the awesome ammobox mod, and I'd not want you to lose the sole credit for that hard work.

SquarelyCircle
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Sat Jan 07, 2017 12:17 am
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by SquarelyCircle »

Yep, so I just went in and modified the code and eliminated the gun turret from the mod, and it went from being the mod that took up the most CPU time to one of them taking up the least CPU time.

If anyone is looking for the turret-less version, I'll upload it here. The author is, of course, perfectly welcome to request I take it down, or to take it and upload it separately as a solo ammobox mod.

https://drive.google.com/file/d/0B2dPrr ... sp=sharing

User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by Afforess »

SquarelyCircle wrote:Yep, so I just went in and modified the code and eliminated the gun turret from the mod, and it went from being the mod that took up the most CPU time to one of them taking up the least CPU time.

If anyone is looking for the turret-less version, I'll upload it here. The author is, of course, perfectly welcome to request I take it down, or to take it and upload it separately as a solo ammobox mod.

https://drive.google.com/file/d/0B2dPrr ... sp=sharing
Cool! Ammobox is open source, and I'm always happy to have people modifying/remixing it.

I'm curious exactly what sort of map setup you have to have such bad performance with this mod. Any chance you can provide a save/mod-set so I can take a look and see if the situation ca be improved?

SquarelyCircle
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Sat Jan 07, 2017 12:17 am
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by SquarelyCircle »

Afforess wrote:
SquarelyCircle wrote:Yep, so I just went in and modified the code and eliminated the gun turret from the mod, and it went from being the mod that took up the most CPU time to one of them taking up the least CPU time.

If anyone is looking for the turret-less version, I'll upload it here. The author is, of course, perfectly welcome to request I take it down, or to take it and upload it separately as a solo ammobox mod.

https://drive.google.com/file/d/0B2dPrr ... sp=sharing
Cool! Ammobox is open source, and I'm always happy to have people modifying/remixing it.

I'm curious exactly what sort of map setup you have to have such bad performance with this mod. Any chance you can provide a save/mod-set so I can take a look and see if the situation ca be improved?
I've long since moved on from that map, and couldn't provide further information. However, I didn't even have any modified turrets on the map, which is what I find really odd. The performance wasn't terrible, it was just more than any other mod at that time. I usually run with a lot of mods, so that's still pretty surprising. Other mods whose performance is surprisingly CPU heavy include the single splitter mod and the item collector mod (although I think I'm getting why the item collector mod was so CPU heavy combined with Bobs Enemies). The only thing I can think is that it's making a call for something every tick, especially if it's searching for all the turrets, that could slow the mod down a lot (like the item collector) - I'm no expert.

Sorry I can't currently be of more help. Thanks for the cool mod, though!

WarriorOfAvalon
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat Aug 13, 2016 9:40 am
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by WarriorOfAvalon »

So I was just investigating the performance of this mod after having some issues with it, specifically when using construction bots to destroy large areas, and have found something kinda weird in the code.

In control.lua your event handler for destroying or mining an entity does not filter the entity before calling 'onGunTurretMk2Destroyed(event.entity)'. This function ALWAYS logs the entity destroyed, before checking if it is a mk2 turret. This means every single entity that is destroyed is written to the text file, which is a massive CPU overhead. I assume this was something left behind from testing but you should remove asap.

Code: Select all

script.on_event({defines.events.on_entity_died,defines.events.on_preplayer_mined_item,defines.events.on_robot_pre_mined}, function(event)
    onGunTurretMk2Destroyed(event.entity)
end)

.....

function onGunTurretMk2Destroyed(turret_entity)
    Logger.log("Gun Turret Destroyed, Entity name: " .. turret_entity.name) --remove this line
    if turret_entity.name == "ammobox-gun-turret-2" or turret_entity.name == "ammobox-gun-turret-2-ui" then
        .....
Just removing this one line reduced CPU from 0.5/0.6 to 0.01 (when deconstructing)


edit: for future reference I would recommend removing all but essential error logging lines when you release a mod as writing to a log file is very slow. There are a couple of others in the mod I would recommend you remove although they won't have any major impact, it's just good practice.

User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

Re: [MOD 0.12.11+] AmmoBox 0.3.0 - Fun with Turrets & Logistics

Post by Afforess »

WarriorOfAvalon wrote:So I was just investigating the performance of this mod after having some issues with it, specifically when using construction bots to destroy large areas, and have found something kinda weird in the code.

In control.lua your event handler for destroying or mining an entity does not filter the entity before calling 'onGunTurretMk2Destroyed(event.entity)'. This function ALWAYS logs the entity destroyed, before checking if it is a mk2 turret. This means every single entity that is destroyed is written to the text file, which is a massive CPU overhead. I assume this was something left behind from testing but you should remove asap.

Code: Select all

script.on_event({defines.events.on_entity_died,defines.events.on_preplayer_mined_item,defines.events.on_robot_pre_mined}, function(event)
    onGunTurretMk2Destroyed(event.entity)
end)

.....

function onGunTurretMk2Destroyed(turret_entity)
    Logger.log("Gun Turret Destroyed, Entity name: " .. turret_entity.name) --remove this line
    if turret_entity.name == "ammobox-gun-turret-2" or turret_entity.name == "ammobox-gun-turret-2-ui" then
        .....
Just removing this one line reduced CPU from 0.5/0.6 to 0.01 (when deconstructing)


edit: for future reference I would recommend removing all but essential error logging lines when you release a mod as writing to a log file is very slow. There are a couple of others in the mod I would recommend you remove although they won't have any major impact, it's just good practice.
Good find, and totally valid. I'll remove the logging entirely in the next release.

Post Reply

Return to “Mods”