[MOD 0.14.2] Electric vehicles

Topics and discussion about specific mods
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by mknejp »

DRT99 wrote:So the charging stations, i absolutely hate the flashing 'no power' symbol when they have nothing to charge. I realize this may be due to technical issues so I cant legitimately complain about it. Just venting.
This one is still puzzling me. In none of my testing have I ever managed to get a charging station that is connected to the grid and has electricity to draw from but flashes the red icon. As soon as I connect them to the power grid the icon disappears, whether it's charging something or not. I have no idea what is causing this but ultimately the placed entity's behavior is controlled by the game so I really don't know how to troubleshoot this.

As for the rest, all valid points. I knew that balancing this would be a major issue and that everyone would have other expectations. I totally get that nobody wants to put batteries in their tank, the risk of getting stranded is too high. And the car, well, meh. As you say yourself it gets obsolete rather quickly. As for a dedicated "engineering truck" for outpost building, if I were to make such a vehicle it should probably be its own mod. Any vehicle that has an equipment grid and supports the "electric-vehicles-equipment" category can be run on a transformer regardless whether it has fuel slots or not and I think (but haven't tried) that it should have priority over fuel.

About the transformers, yes they are mandatory for technical reasons, but it's also a system that allows other mods to create a progression system. If the vehicles wouldn't flash the red icon when underpowered they would allow for more customization (e.g. put more transformers in your car and it has more power). That's why I currently don't favor the "get it for free" part but I was seriously considering it.

The high power charging stuff is meant to be expensive, and intended primarily for trains. Especially if they go very long distances. As you mentioned it's not the most practical to use it for cars or tanks, but trains have predictable movement patterns and the risk of stranding should be low with the proper planning and use of the charger's circuit conditions. Unfortunately I cannot undo the fusion reactor and it's going to be the bane of these two mods for as long as it exists in its current form. Ultimately it's for everyone to decide whether thy go with the reactors or induction.

Iorek
Inserter
Inserter
Posts: 41
Joined: Wed Sep 07, 2016 4:09 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by Iorek »

Is there any way to make the Train/Car go faster based on the number of transformers used?

50% speed bump from 2, 75% speed bump from 3 etc?

or simply... more power/more engines = more speed!



Loving using roboports on a car for tree clearing, all the trees fill the car's trunk not my bags. Shields and lasers help trains survive those ramming encounters with evolved 10000 hp biters and the roboport is great for repairing track and outposts.

Sadly I find myself not using the Charge platform. 3x3 for charging at stations which I need to setup at each station and make sure the train spends time on, or I can simply drop a reactor in for 4x4 which allows for less/no batteries.
I think its an issue with scaling on bobs mods but I find the charge speed is too low to use just batteries. A large battery built into the transformer would be good.

mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by mknejp »

Iorek wrote:Is there any way to make the Train/Car go faster based on the number of transformers used?

50% speed bump from 2, 75% speed bump from 3 etc?

or simply... more power/more engines = more speed!
I wish this was possible but if the engine doesn't get enough energy you get the red "out of fuel" icon flashing and increasing the power output or max speed of a locomotive dynamically is not possible.
Iorek wrote:Sadly I find myself not using the Charge platform. 3x3 for charging at stations which I need to setup at each station and make sure the train spends time on, or I can simply drop a reactor in for 4x4 which allows for less/no batteries.
I think its an issue with scaling on bobs mods but I find the charge speed is too low to use just batteries. A large battery built into the transformer would be good.
Considering I just removed batteries from the transformer recipes... yeah no.
I can't account for all the mods' needs out there. If bob adds huge energy consuming equipment it's up to him to provide a means of powering them. If his locomotives are meant to run on regular fuel then you only have yourself to blame for changing that :)

DRT99
Inserter
Inserter
Posts: 25
Joined: Mon Jul 11, 2016 5:11 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by DRT99 »

mknejp wrote:And the car, well, meh. As you say yourself it gets obsolete rather quickly
Dont you consider that a problem? Would you consider upping the grid size to 10x10 to match the rest?

mknejp wrote:About the transformers, yes they are mandatory for technical reasons, but it's also a system that allows other mods to create a progression system. If the vehicles wouldn't flash the red icon when underpowered they would allow for more customization (e.g. put more transformers in your car and it has more power). That's why I currently don't favor the "get it for free" part but I was seriously considering it.
My primary issue with the transformers is that they take up a fair amount of space and dont really contribute anything other than letting me put the keys in the ignition. I still think letting them function as batteries would not be overly imbalanced, even if they were less powerful per tile than current batteries (they are after all cheaper)
EDIT: just re-read your previous post and that you dont want to make them function as batteries. Damn.

Also, i did a bit of sciencing just out of curiosity. Results not really relevant but here for anyone interested
"Hybrid" Diesel Locomotive with 2x Exoskeleton vs Electric Locomotive, no exoskeletons
Results were very close in terms of pulling power / acceleration, difference being the Hybrid is significantly cheaper, fueling is pretty trivial especially with a logistics system, and the exoskeletons can easily be powered by low power induction.

Gotta say, Hybrid is probably the way to go for me. May splurge on electric + exos + high power induction for fast travel inside my base.

mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by mknejp »

Further attempts at balancing this.

Code: Select all

electric-vehicles 0.3.1
===============================================================================
FEATURES
* New tech and equipment for regenerative braking allowing electric vehicles to gain energy while slowing down. The faster and heavier they are the more is recovered.
CHANGES
* The low voltage transformer now only takes up 1x2 slots in the equipment grid.
* The high voltage transformer now only takes up 2x2 slots in the equipment grid.
* Increased the electric car's power to 250 kW allowing it to reach almost 110 km/h.
* Updated to electric-vehicles-lib 0.2.4
The regenerative brakes are still experimental. They do pretty much what they say: if equipped (2x2 slots) they generate power if the vehicle's absolute speed is decreasing. It is barely noticeable on the car, but can significantly extend the range of tanks and (to some degree) trains. Car/tank don't seem to have an assigned top speed and actually seem to be limited by power and friction, so if you are at top speed it is beneficial to let go of the W key and let it cruise to allow the slowdown to recharge batteries. It works similarly for locomotives, if the train is slowing down, but obviously in automatic mode you can't just let go of W and let it cruise. An electric locomotive with three cargo wagons can recover about a quarter of a battery when hitting the brakes, which hopefully should be any time the train has to stop for a signal or station. This is highly variable and I am sure people will come complaining that I created a perpetuum mobile for some train/track configurations :)

This is an attempt at fighting the max power consumption of trains at max speed but the game doesn't give me enough information to manually reduce the energy draw directly because it depends on the train configuration and prototype data that isn't available to control scripts. So hopefully this helps.

mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by mknejp »

DRT99 wrote:
mknejp wrote:And the car, well, meh. As you say yourself it gets obsolete rather quickly
Dont you consider that a problem? Would you consider upping the grid size to 10x10 to match the rest?
Not really. The vanilla car doesn't have any grid at all. And as you said yourself, at some point it almost becomes faster and safer to just run around with exos.
DRT99 wrote:My primary issue with the transformers is that they take up a fair amount of space and dont really contribute anything other than letting me put the keys in the ignition.
Then I hope you like the 0.3.1 update.
DRT99 wrote:Also, i did a bit of sciencing just out of curiosity. Results not really relevant but here for anyone interested
"Hybrid" Diesel Locomotive with 2x Exoskeleton vs Electric Locomotive, no exoskeletons
Results were very close in terms of pulling power / acceleration, difference being the Hybrid is significantly cheaper, fueling is pretty trivial especially with a logistics system, and the exoskeletons can easily be powered by low power induction.

Gotta say, Hybrid is probably the way to go for me. May splurge on electric + exos + high power induction for fast travel inside my base.
Yeah I don't really understand how exoskeletons make trains go faster, but hey, I also don't understand how coal makes diesel engines work. As a side not, the 0.3.1 update for Wireless Charging makes the low power coils 2x2. I feel like the whole usefulness of this mod hinges on the sad fact of trains not reducing their power consumption at the speed limit. And fusion reactors. And exoskeletons. And... my sanity...

ParadoxHeart
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Sep 15, 2016 7:58 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by ParadoxHeart »

Looks like your latest updates are broken (for all three recently updated mods). All of the files except for the LICENSE file are in an additional level of directory, so Factorio can't find the info.json.

mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by mknejp »

ParadoxHeart wrote:Looks like your latest updates are broken (for all three recently updated mods). All of the files except for the LICENSE file are in an additional level of directory, so Factorio can't find the info.json.
Well damn, that's what happens when you do last minute changes to your package scripts. It's fixed now, thanks for letting me know.

ParadoxHeart
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Sep 15, 2016 7:58 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by ParadoxHeart »

No problem. I think Factorio is also handling this sort of problem badly, IMO.

Iorek
Inserter
Inserter
Posts: 41
Joined: Wed Sep 07, 2016 4:09 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by Iorek »

"exoskeletons make trains go faster"
really?
I was told this was currently not working?


I bumped the capacity up on your charging station. Been using it in power armor, stand on tile for a few second, go build do power armory things, return to pad. started lining all empty spaces in my base with charging station on the floor!

I don't think you need to worry so much about charging while breaking. This seems very Eco warrior! Simply having the electric engine move a train/car/tank is great.


one small question, Why use

Code: Select all

math.ceil(150 / 60) .. "kJ"
instead of "2kj"

mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by mknejp »

Iorek wrote:"exoskeletons make trains go faster"
really?
I was told this was currently not working?
Not faster, but more powerful.
Iorek wrote:one small question, Why use

Code: Select all

math.ceil(150 / 60) .. "kJ"
instead of "2kj"
Because it's generated from preprocessed files

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by Optera »

mknejp wrote:
Iorek wrote:"exoskeletons make trains go faster"
really?
I was told this was currently not working?
Not faster, but more powerful.
Sadly yes. Any 600kW locomotive will have max speed reduced according to this table viewtopic.php?f=18&t=8145#p64914
Exoskeletons only help to reach their calculated top speed faster. Exoskeletons, how do they work... :roll:
It would be nice to put electric engines in the grid to increase the power.

On a side note, could you add an electric FARL?

mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by mknejp »

If FARL has an equipment grid I can make it compatible, but I assume they are hooking up to their locomotive's prototype name, so creating a new one might cause problems.

On the other hand with equipment grids they could create a "FARL equipment" that would allow every locomotive to become a FARL.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by Optera »

mknejp wrote:If FARL has an equipment grid I can make it compatible, but I assume they are hooking up to their locomotive's prototype name, so creating a new one might cause problems.
That's my problem. FARL functionality seems to hook up on the item-name.
I guess i could mod VehiclesEquipement_0.0.2 to not only add a grid to everything including the farl, but also the categories to include electric-vehicles-equipment. It would turn every farl into a hybrid though.
mknejp wrote: On the other hand with equipment grids they could create a "FARL equipment" that would allow every locomotive to become a FARL.
That's a great idea, you should suggest it in the FARL thread.

Edit:
I've added this file to your electric_vehicles. It turned my FARLs into hybrids and remains compatible with VehiclesEquipment.
data-final-fixes.lua
I noticed two drawbacks:
- Hybrid FARLs seem to prefer burning fuel over electricity
- brakes don't show electric charge when breaking, no idea yet if it simply doesn't show or if they aren't working
- When mining FARLs with equipment the equipment is destroyed

mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by mknejp »

Optera wrote:Edit:
I've added this file to your electric_vehicles. It turned my FARLs into hybrids and remains compatible with VehiclesEquipment.
data-final-fixes.lua
I noticed two drawbacks:
- Hybrid FARLs seem to prefer burning fuel over electricity
- brakes don't show electric charge when breaking, no idea yet if it simply doesn't show or if they aren't working
- When mining FARLs with equipment the equipment is destroyed
If the vehicle prioritizes fuel then there's nothing I can do as I can only fill up the empty space in the energy buffer.
I do not want to add an equipment grid to FARL in case they have their own plans for that, I might do if it has no grid, but then if FARL does add its own grid it might cause all kinds of problems for the stored equipment. It's not a risk I'm willing to take.
To preserve the equipment you need to change the FARL item type from "item" to "item-with-entity-data".

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by Optera »

mknejp wrote:
Optera wrote:Edit:
I've added this file to your electric_vehicles. It turned my FARLs into hybrids and remains compatible with VehiclesEquipment.
data-final-fixes.lua
I noticed two drawbacks:
- Hybrid FARLs seem to prefer burning fuel over electricity
- brakes don't show electric charge when breaking, no idea yet if it simply doesn't show or if they aren't working
- When mining FARLs with equipment the equipment is destroyed
If the vehicle prioritizes fuel then there's nothing I can do as I can only fill up the empty space in the energy buffer.
I do not want to add an equipment grid to FARL in case they have their own plans for that, I might do if it has no grid, but then if FARL does add its own grid it might cause all kinds of problems for the stored equipment. It's not a risk I'm willing to take.
To preserve the equipment you need to change the FARL item type from "item" to "item-with-entity-data".
If FARL's get it's own special grid equipment grid

Code: Select all

if obj.equipment_grid == nil or obj.equipment_grid == "large-equipment-grid" then
could prevent any changes to it while overriding VehiclesInventory.

Is changing item type even possible in data-final-fixes? At this point i might as well edit FARL directly. Factorio needs a clean way of modding mods.

mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by mknejp »

Optera wrote:If FARL's get it's own special grid equipment grid

Code: Select all

if obj.equipment_grid == nil or obj.equipment_grid == "large-equipment-grid" then
could prevent any changes to it while overriding VehiclesInventory.
No idea where this line is supposed to go but the problem stands that if FARL change the equipment grid to what they want then it could mess with category filters or grid topology and do all kinds of stuff to existing equipment in it. I'm just not gonna do it. Ask the FARL dev to give their vehicle an equipment grid and then I can add the category once the grid is there.
Optera wrote:Is changing item type even possible in data-final-fixes? At this point i might as well edit FARL directly. Factorio needs a clean way of modding mods.
You have to move the prototype from data.raw["item"] to data.raw["item-with-entity-data"] and adjust the .type

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by Optera »

mknejp wrote:
Optera wrote:If FARL's get it's own special grid equipment grid

Code: Select all

if obj.equipment_grid == nil or obj.equipment_grid == "large-equipment-grid" then
could prevent any changes to it while overriding VehiclesInventory.
No idea where this line is supposed to go but the problem stands that if FARL change the equipment grid to what they want then it could mess with category filters or grid topology and do all kinds of stuff to existing equipment in it. I'm just not gonna do it. Ask the FARL dev to give their vehicle an equipment grid and then I can add the category once the grid is there.
Optera wrote:Is changing item type even possible in data-final-fixes? At this point i might as well edit FARL directly. Factorio needs a clean way of modding mods.
You have to move the prototype from data.raw["item"] to data.raw["item-with-entity-data"] and adjust the .type
Thanks it was educational to try, but somehow it just won't patch reliably with my other mods. For now I've edited farl directly, giving it an unique grid with electric-vehicles-equipment category.
Considering FARL might become just an equipment, I've spent way too much time making a compatibility mod for electric farls :D

judos
Filter Inserter
Filter Inserter
Posts: 266
Joined: Mon Dec 08, 2014 11:17 am
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by judos »

I tried by chance to insert two regenerative brakes into a train and that produced the following error:

Error while running event on_player_placed_equipment (ID 38)
__electric-vehicles-lib__/src/main.lua:160: attempt to index field '?' (a nil value)

Maybe just a message would be enough which says that only one brake is allowed?

Thanks for the great mod!

mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Electric vehicles

Post by mknejp »

Fixed in 0.3.4

Code: Select all

electric-vehicles 0.3.4
===============================================================================
CHANGES
* Updated to electric-vehicles-lib 0.2.7
* Better performance when updating transformers and regenerative brakes
FIXES
* "__electric-vehicles-lib__/src/main.lua:160: attempt to index field '?' (a nil value)" when equipping more than one brake.

Post Reply

Return to “Mods”