[MOD 0.10.x] Robocharge - Robot Charging Station

Topics and discussion about specific mods
Braddock
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue May 20, 2014 11:44 pm
Contact:

[MOD 0.10.x] Robocharge - Robot Charging Station

Post by Braddock »

Image A Mod to Give Your Robots More Chances to Stay Alive

The mod is pretty much exactly as named. It adds one building, a tower that connects to the robot network and which allows the robots to recharge at it. It has a MUCH smaller catchment zone then the standard roboport, since it's not really designed to extend the network. It also can't store robots or packs inside it, since it's just a pole. but it has the same footprint as a small/medium electric pole, so it can be placed in tighter spaces. It also has the same energy draw as the current roboport, and therefore the same charging speed. I tried to balance the cost with that of the roboport. So it's a little cheaper since it would be physically smaller, but still not too cheap.

This is really my first MOD (the other tweak I posted earlier wasn't very complex) so I please beg your pardon if anything goes arye. I did try playtesting it repeatedly beforehand however, so I'm pretty confident there are no major issues outstanding. If there are any problems please let me know. I'd be happy to try and fix anything that comes up. Same with balancing issues. If you feel it's not effective or to cheap or whatever, I'd be happy for some suggestions.

Additionally, I'm not an artist. Not by any stretch of the imagination. I did my best though to put together something that doesn't make your eyes bleed or your stomach turn when you see it. If there's anybody out there with better modeling/drawing/cave-painting/artistry-thingy skills that's willing to help create a nicer image for this I'd be very appreciative.

Breakdown:
Robot Charging Station
  • small coverage area
  • no robot storage
  • same energy draw as roboport
  • small footprint, same size as small/medium electric poles
  • unlocks at the same time as the Roboport
here's a quick image of the tower in action:
Image

Version 0.1
  • initial release
Version 0.2
  • Quick fix to solve some migration issues
Version 0.3 -Current
  • Refactored code
  • Changed build cost/time to scale it down some more
  • fix for blank image causing some crashes/errors
Previous versions downloaded more then 135 times,
Attachments
RoboCharge.zip
Version 0.3 - new prices and bugfixes
(23.67 KiB) Downloaded 1967 times
Last edited by Braddock on Wed Jun 11, 2014 6:02 pm, edited 2 times in total.
User avatar
SuperSandro2000
Filter Inserter
Filter Inserter
Posts: 742
Joined: Sun Jan 12, 2014 3:54 am
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by SuperSandro2000 »

Great Idea! But I can't find the station and I researched the roboport.
Braddock
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue May 20, 2014 11:44 pm
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by Braddock »

really? that's odd. It should appear right after it. hmm, I'll take a look at the code and run another test game from scratch again. See if I can replicate it being gone.

Do you have any other mods installed? I don't think there would be any conflicts, but it's good to know upfront.

EDIT: Wait, did you start a new game? I've found that mods are sometimes ignored with saved games. Not sure why or what can be done about that. If you were using a saved game, can you start a new game and check the tech description for the logistics/construction robotics? The tower should be listed there.
drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by drs9999 »

SuperSandro2000 wrote:I researched the roboport.
That is the problem. If the mod is added after the tech was researched the recipe that would be unlocked will remain unlocked.

For user:
If you encounter the problem use the console to unlock the recipe by hand:

Code: Select all

game.player.force.recipes["RECIPENAMEHERE"].enabled = true
@Braddock:
You need a migration file to deal with those issues. Something like:

Code: Select all

If game.player.force.technologies["ROBOPORTRESEARCHNAMEHERE"].researched == true then
  game.player.force.recipies["RECIPENAMEHERE"].enabled = true
end
For further reading I recommend to have a look at the base mod, more precisly the migration-folder.

I hope that helps
Braddock
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue May 20, 2014 11:44 pm
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by Braddock »

Hey thanks alot drs999!

I only just started poking around these mods a couple days ago, so I wasn't aware of details like this. Having that kind of direction is really helpful. Again, thanks A LOT. I'll look into that and see about putting up a new version with that stuff in a little bit.
Braddock
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue May 20, 2014 11:44 pm
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by Braddock »

please forgive the double post, but I just wanted to note that I uploaded a new version with a migration script. I only had a chance to test it quickly, since I wanted to get something working for Sandro up as fast as possible, but it worked fine in my saves. Let me know if you still have any problems with it.
Last edited by Braddock on Thu May 22, 2014 2:59 pm, edited 1 time in total.
User avatar
SuperSandro2000
Filter Inserter
Filter Inserter
Posts: 742
Joined: Sun Jan 12, 2014 3:54 am
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by SuperSandro2000 »

I test the mod in a older world.
Now it works. Thx
Braddock
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue May 20, 2014 11:44 pm
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by Braddock »

yay, glad to hear it!
User avatar
SuperSandro2000
Filter Inserter
Filter Inserter
Posts: 742
Joined: Sun Jan 12, 2014 3:54 am
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by SuperSandro2000 »

Can you maybe add a recharge station that can charge 8 or more robots at the same time?
When 400 from my robots want to recharge they take to much time for me.
Gammro
Filter Inserter
Filter Inserter
Posts: 361
Joined: Wed Oct 09, 2013 1:45 pm
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by Gammro »

SuperSandro2000 wrote:Can you maybe add a recharge station that can charge 8 or more robots at the same time?
When 400 from my robots want to recharge they take to much time for me.
Can't you just build another charging station nearby? I thought that was the whole idea of this mod, to easily build more charging stations.
Ignore this
User avatar
SuperSandro2000
Filter Inserter
Filter Inserter
Posts: 742
Joined: Sun Jan 12, 2014 3:54 am
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by SuperSandro2000 »

Gammro wrote:
SuperSandro2000 wrote:Can you maybe add a recharge station that can charge 8 or more robots at the same time?
When 400 from my robots want to recharge they take to much time for me.
Can't you just build another charging station nearby? I thought that was the whole idea of this mod, to easily build more charging stations.
This is the easy way.
Braddock
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue May 20, 2014 11:44 pm
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by Braddock »

SuperSandro2000 wrote:Can you maybe add a recharge station that can charge 8 or more robots at the same time?
When 400 from my robots want to recharge they take to much time for me.
I... don't know. My plan was to always have it charging 4 just like the Roboport, so I never looked into whether that number could be altered. I honestly don't know whether the number can even be physically increased/decreased or not. It'd have to be bigger as well, like the actual Roboport. There's also the issue of the sprite. I'd have to make an entirely new image for it. That wasn't very easy for me in the first place. As I mentioned, I'm not artist. So I lose a fair amount of time fuffing about when trying to create something that doesn't look too terrible. I also can't quite picture what it would look like too. hmm...

Making something bigger wasn't really the point of this version of the mod, but I dunno... maybe I can take a look at how feasible it would be? No promises though.
Gammro wrote:Can't you just build another charging station nearby? I thought that was the whole idea of this mod, to easily build more charging stations.
Indeed. When poking around the forums I had come across a spot where the developers revealed the algorithm that the bots used to determine what station to go to. They take into account the distance between them and the various stations versus the number of bots already waiting at each station. This was amongst comments about bots dieing in droves while waiting at packed stations, and people deploying dozens of roboports in an effort to counter this "death by waiting room boredom" that seems so prevalent among high volume bot-nets.

So I thought rather than build more roboports around the perimeter of large/tight factories, what if you had a smaller footprint device you could squeeze directly near the higher traffic trouble spots or along the longer lines of higher traffic routes. Placing more of them, like you suggested, should help with problems like this. As the bots algorithm should cause them to spread out more to more evenly fill the queues of all nearby ones.

I don't dislike the bigger port suggestion, but when I designed the mod it was definitely more with this idea in mind.
Kiapha
Inserter
Inserter
Posts: 23
Joined: Fri May 09, 2014 2:15 pm
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by Kiapha »

Thank you very much for this mod. My robots love you, and are no longer dying like flys waiting to recharge. I did reduce the number of adv circuits though, seems a bit high for a small charging station.
Braddock
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue May 20, 2014 11:44 pm
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by Braddock »

Kiapha wrote:Thank you very much for this mod. My robots love you, and are no longer dying like flys waiting to recharge. I did reduce the number of adv circuits though, seems a bit high for a small charging station.
Why thank you, I'm glad to hear it's working well for you. For the cost I tried to come up with something that was cheaper then the Roboport but still a little bit on the "higher" end of item costs. The idea being that this is still an advanced piece of tech With a lot of stuff it's got to do and manage. Not to as large a scale as the Roboport certainly, but the complexity of the smaller job would still be the same.

That was my thinking anyway, but I've very open to the idea of balancing it better. What kind of costs did you end up using then?
Kiapha
Inserter
Inserter
Posts: 23
Joined: Fri May 09, 2014 2:15 pm
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by Kiapha »

I changed it to 10 steel, 15 copper, 10 electronic circuit, 10 advanced circuit. Seemed kinda odd to use so many advanced circuits for it that I could almost build a full roboport if I could build one. (Always have issues with the adv circuits, so that was the main thing causing issues)

I find that this cost makes it much easier to use them, and allowed me to boost the cost of roboports themselves so that it is extremely expensive to expand coverage, but reasonably easy to keep much higher numbers of bots in your coverage area.
Braddock
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue May 20, 2014 11:44 pm
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by Braddock »

Wow, I really like that. It spreads the cost out nicely between other objects without dropping it too much overall. I had one small alteration that I wanted to release an update for in a bit, but I think I'll include that cost change as well (though maybe 15 adv. circuits, I dunno). Unless anyone has a better suggestion I think that kind of change balances really well.
Kiapha
Inserter
Inserter
Posts: 23
Joined: Fri May 09, 2014 2:15 pm
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by Kiapha »

I would actually recommend 10 steel, 15 copper, 15 normal and advanced circuits, with an optional package that boosts roboport cost to 100 steel, 75 advanced circuits, 25 normal circuits, and whatever the normal amount of gears is. 10 of each circuit is a bit too low I am finding.
Gammro
Filter Inserter
Filter Inserter
Posts: 361
Joined: Wed Oct 09, 2013 1:45 pm
Contact:

Re: [MOD 0.9.x] Robocharge - Robot Charging Station

Post by Gammro »

This mod crashes the game on linux(at least Ubuntu 14.04). With some help, we discovered the blank.png was the culprit. It had a filesize of 0, possibly resulting in the crash. After replacing it with this png: http://commons.wikimedia.org/wiki/File:1x1.png, the problem was gone.
Ignore this
Braddock
Burner Inserter
Burner Inserter
Posts: 13
Joined: Tue May 20, 2014 11:44 pm
Contact:

Re: [MOD 0.10.x] Robocharge - Robot Charging Station

Post by Braddock »

Hello all. Other aspects of my life have eaten up a large amount of time as of late, so I apologize for taking such a long time to put out an "official" version of this for Factorio alpha 10. I haven't been doing nothing this whole time though. I've lost several days to trying to make a small change to something else in this mod that I just couldn't get to work. So no new functionality or anything this time. I also couldn't make a new mod I wanted to put together work right. That was many hours of hair pulling frustration before I had to give up for now. The game's still developing, so maybe I can come back to those ideas sometime later.

I refactored the code for this update so that it now conforms to the file structure of the base game. This wasn't something I was too concerned about as the mod only adds one object and it's code, and nothing else. Still, it was a fairly easy thing to do and now it should be easier for anyone else who wants to look at the code to know where things are.

I've adjusted the price of the towers so that they should be cheaper overall. They're now steel plate x10, electronic circuit x15, advanced circuit x15, copper cable x15. They're build time has also been reduced a little. If you don't have any copper cable on you and have to build it then the overall construction time will be more like what it used to be. You can avoid that by having some cable on you before you start building. So that should be a little speed bonus to anyone who likes to be prepared. Thanks Kiapha for the discussion on costs we had before.

A big thanks to Gammro as well. For not only finding and letting me know about a bug, but for going even further and figuring out a way to fix it. The prototype needs an image declaration for some things that the tower doesn't use... cause it's just a spike of metal. So I was just passing it an empty file that then gets ignored. If that causes an error on some systems then your suggestion of using a 1x1 transparent pixel as a file is just perfect. It still gets ignored in the game, but if the fileloading mechanics need it be bigger then empty then so be it. I've gone ahead and included your fix in this latest update.
MtNak
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Fri May 16, 2014 4:03 pm
Contact:

Re: [MOD 0.10.x] Robocharge - Robot Charging Station

Post by MtNak »

Thank you very much :) I will try it now!
Post Reply

Return to “Mods”