[MOD 0.14.2] Wireless Charging

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

[MOD 0.14.2] Wireless Charging

Post by mknejp »

banner.PNG
banner.PNG (263.89 KiB) Viewed 13298 times
Name: Wireless Charging
Version 0.3.3
Requires Factorio 0.14
Licensed under MIT.
Get it on the mod portal

Charge your equipped batteries using the newest in near-field wireless energy transfer technology. Simply equip an induction coil in your armor or vehicle and be in close proximity to an induction ground station to have it transfer energy directly form your power grid into your batteries. Designed to be used together with Electric Vehicles. Gives batteries a purpose!
Long description
Pictures
For modders
Last edited by mknejp on Sun Sep 18, 2016 12:37 pm, edited 7 times in total.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by Optera »

You should rebalance the needed materials for wireless charging a single Locomotive.

High power induction coil
2.0k Iron Plate
3.5k Copper Plate
709 Plastic Bar
25,5 Sulfuric Acid

High Power Induction Rail
2.0k Iron Plate
3.6k Copper Plate
20,5 Steel
724 Plastic Bar
35,5 Sulfuric Acid

10x Mk1 Batteries
50 Iron Plate
50 Copper Plate
100 Sulfuric Acid
100 Steel

total per electric locomotive
4.0k Iron Plate
7.1k Copper Plate
1.4k Plastic
120 Steel
160 Sulfuric Acid


In contrast I can slap 2 Fusion Reactors, which will provide eternal power to your electric locomotives without batteries or any changes to my rail network
2x Fusion Reactor total
4.8k Iron Plate
8.0k Copper Plate
800 Plastic
100 Sulfuric Acid
30 alien Artifact

Trains which are mostly standing around since they are used to build outposts or wait for oil/mines to fill them up can work with 1 Fusion Reactor and some batteries making them ridiculously cheap in contrast.
single Fusion Reactor Powered Train
2.4k Iron Plate
4.0k Copper Plate
800 Plastic
150 Sulfuric Acid
30 alien Artifact
100 Steel

Conclusion:
If you cut the material requirement to 1/4 or 1/3 it'd become feasible to use instead of Fusion Reactors. Otherwise it's nothing but a really nice toy to play around with if you have set up a decent working base and need resource sinks.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by mknejp »

Well yeah, I sort-of hate the portable fusion reactor. It is a one-time investment with infinite return and completely trivializes all the energy management for vehicles. I wish it didn't exist or at least had some form of half-life, or other form of limitation.

So if you add the mod to an endgame factory then of course you're going to put fusion reactors in all your trains, at that point who cares? But the recipes are also meant for those who are playing through the game from the start going through a progression without access to mass-produced fusion reactors, so putting two in every locomotive is not an option.

There has already been a lot of discussion about the electric locomotive cost and the issue is being addressed. I currently do not intend to significantly change the charging stuff though.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by Optera »

Well unless you get the devs to change Portable Fusion Reactors to be more expensive, you should use them as baseline for how expensive alternatives to them are.
I'd love to see a progression from diesel to electric with charging to electric with fusion power.

If I add wireless charging to my existing factories, I won't notice how much resources they eat up. If you try to make players use wireless charging as part of progression though, you have to cut the cost by a lot or they simply skip to fusion.

I refrained from addressing how insane expensive the electric locomotives currently are. This is simply about costs of wireless charging in contrast to fusion power.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by mknejp »

Optera wrote:Well unless you get the devs to change Portable Fusion Reactors to be more expensive, you should use them as baseline for how expensive alternatives to them are.
I'd love to see a progression from diesel to electric with charging to electric with fusion power.

If I add wireless charging to my existing factories, I won't notice how much resources they eat up. If you try to make players use wireless charging as part of progression though, you have to cut the cost by a lot or they simply skip to fusion.

I refrained from addressing how insane expensive the electric locomotives currently are. This is simply about costs of wireless charging in contrast to fusion power.
Unfortunately it's *impossible* to compete with the fusion reactor because it has an infinite return of investment regardless of how expensive it is. Its only competition are bigger fusion reactors. It is ultimately superior to anything else in the long run. If the wireless charging could work in reverse (there is no technical reason against it) you could power your entire factory with cars full of portable fusion reactors in a fraction of the space and zero pollution. One vehicle with a 12x12 grid would be the equivalent of 13 steam engines or 112 all-day solar panels. That's how broken the item is.

To be honest the fusion reactor was not allowed to go into locomotives for the most part of development. It was literally minutes before releasing the mod that I removed the restriction because I was expecting people to want to put them in and would complain about not being able to. Now I'm faced with the problem that the fusion reactor isn't sufficiently more expensive to prevent pople from rushing it without making the wireless charging equipment ridiculously cheap.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by Optera »

Indeed Fusion Power should have a limited lifetime.

I've had 3GW Solar arrays and 10GW Nuclear plants just because I could and still wireless charging is no alternative for me simply because it's basically the same cost in resources and even more costly in space as a Fusion Reactor.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by mknejp »

Code: Select all

wireless-charging-lib 0.3.0
===============================================================================
CHANGES
* Removed accumulator from high power induction station/rail recipe
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by mknejp »

Code: Select all

wireless-charging-lib 0.3.1
===============================================================================
CHANGES
* The low power induction coil now only takes up 2x2 slots in the equipment grid
Together with the 0.3.1 update of Electric Vehicles this should free up quite a bit of space in the car.
keryja
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon May 23, 2016 11:43 am
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by keryja »

Both this and Electric Vehicles no longer load because info.json can not be found, due to it being one folder too deep, for example: wireless-charging_0.3.1/wireless-charging/info.json while it should be wireless-charging_0.3.1/info.json
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by Optera »

You can mine induction rails from under a train causing the game to crash.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by mknejp »

keryja wrote:Both this and Electric Vehicles no longer load because info.json can not be found, due to it being one folder too deep, for example: wireless-charging_0.3.1/wireless-charging/info.json while it should be wireless-charging_0.3.1/info.json
It's fixed now.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by mknejp »

Optera wrote:You can mine induction rails from under a train causing the game to crash.
Uhm no you can't. At least you shouldn't. Do you have reproduction steps for this? There are specific safeguards in place to make sure you can't do just that.
If the game actually crashes that's something for the bug report forum.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by Optera »

mknejp wrote:
Optera wrote:You can mine induction rails from under a train causing the game to crash.
Uhm no you can't. At least you shouldn't. Do you have reproduction steps for this? There are specific safeguards in place to make sure you can't do just that.
If the game actually crashes that's something for the bug report forum.
Uhm yes I can. I wouldn't report a bug from your mod if it wasn't happening.
However I did do some more testing and my report wasn't 100% precise. It's the result of a failed/non existing migration from older versions of wireless charging.

Replication:
-the induction rails where placed in version 0.2.4 with lib 0.2.4, the ones not flashing the warning icon are from 0.2.4
2016-09-17-07-20-41-9983008.jpg
2016-09-17-07-20-41-9983008.jpg (573.32 KiB) Viewed 12741 times
-mining these rails always throws a nil reference regardless if a train is on them or not
2016-09-17-07-05-50-3273002.jpg
2016-09-17-07-05-50-3273002.jpg (264.2 KiB) Viewed 12743 times
PS:
You should add migrations files to wireless charging and electric vehicles to reset recipes and technologies.
electric-vehicles_0.3.2.lua
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by mknejp »

Can you provide me with the save and mods? Regardless what versions I use to place or mine the rails I can't get that error to show up.
I have a version prepared that does some validation when loaded and should remove broken rails but I need a save that actually has broken rails to make sure it works.
Optera wrote:It's the result of a failed/non existing migration from older versions of wireless charging.
There is no migration because nothing has changed that would require any.
Optera wrote:You should add migrations files to wireless charging and electric vehicles to reset recipes and technologies.
electric-vehicles_0.3.2.lua
I will when it's necessary.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by Optera »

mknejp wrote:Can you provide me with the save and mods? Regardless what versions I use to place or mine the rails I can't get that error to show up.
I have a version prepared that does some validation when loaded and should remove broken rails but I need a save that actually has broken rails to make sure it works.
Optera wrote:It's the result of a failed/non existing migration from older versions of wireless charging.
There is no migration because nothing has changed that would require any.
Optera wrote:You should add migrations files to wireless charging and electric vehicles to reset recipes and technologies.
electric-vehicles_0.3.2.lua
I will when it's necessary.
I traced the bug down to me running a modified version of wireless_charging under different namespace when placing those stations. :oops:

In electric vehicles you changed some recipes and added a new tech. Unless handling of recipes changed recently player.force.reset_recipes() is needed for running games to update.
Again my mistake, It does reset recipes on mod version changes automatically.
Ratzap
Filter Inserter
Filter Inserter
Posts: 371
Joined: Sun Aug 16, 2015 11:15 pm
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by Ratzap »

We keep getting server crashes (0.14.7 headless) when putting equipment into armour:

Code: Select all

2630.187 Error MainLoop.cpp:747: Exception at tick 7829205: Error while running event on_player_placed_equipment (ID 38)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
	__wireless-charging-lib__/src/main.lua:391: in function 'stop_charging'
	__wireless-charging-lib__/src/main.lua:227: in function 'update_equipment'
	__wireless-charging-lib__/src/main.lua:555: in function <__wireless-charging-lib__/src/main.lua:552>
2630.187 Error ServerMultiplayerManager.cpp:88: MultiplayerManager failed: "Error while running event on_player_placed_equipment (ID 38)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
	__wireless-charging-lib__/src/main.lua:391: in function 'stop_charging'
	__wireless-charging-lib__/src/main.lua:227: in function 'update_equipment'
	__wireless-charging-lib__/src/main.lua:555: in function <__wireless-charging-lib__/src/main.lua:552>"
2630.187 Info ServerMultiplayerManager.cpp:625: mapTick(7829205) changing state from(InGame) to(Failed)
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by mknejp »

Optera wrote:I traced the bug down to me running a modified version of wireless_charging under different namespace when placing those stations. :oops:
What did you modify? Maybe it could be part of the main mod.
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by mknejp »

Ratzap wrote:We keep getting server crashes (0.14.7 headless) when putting equipment into armour:
Give 0.3.3 a try
Ratzap
Filter Inserter
Filter Inserter
Posts: 371
Joined: Sun Aug 16, 2015 11:15 pm
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by Ratzap »

mknejp wrote:
Ratzap wrote:We keep getting server crashes (0.14.7 headless) when putting equipment into armour:
Give 0.3.3 a try
The server won't come up with 0.3.3

Code: Select all

168.094 Error MainLoop.cpp:747: Exception at tick 8594394: Error while running event on_tick (ID 0)
__electric-vehicles-lib__/src/main.lua:384: table index is nil
 168.094 Error ServerMultiplayerManager.cpp:88: MultiplayerManager failed: "Error while running event on_tick (ID 0)
__electric-vehicles-lib__/src/main.lua:384: table index is nil"
 168.094 Info ServerMultiplayerManager.cpp:625: mapTick(8594394) changing state from(InGame) to(Failed)
mknejp
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 27, 2016 8:29 pm
Contact:

Re: [MOD 0.14.2] Wireless Charging

Post by mknejp »

But it starts with 0.3.2?
Post Reply

Return to “Mods”