Page 1 of 1

Alt-F4 #55 - The Dark Alleys of Modding

Posted: Fri Dec 17, 2021 11:15 am
by AlternativeFFFF
For issue #55 of Alt-F4, stringweasel prepared a very special treat for everyone, getting various modders to talk about the deepest, dankest hacks they’ve come up with to make their mods work. We’ve got MagmaMcFry, raiguard, Deadlock989, Anachrony, PFQNiet, and Earendel all confessing their sins!

Continue reading:

Re: Alt-F4 #55 - The Dark Alleys of Modding

Posted: Fri Dec 17, 2021 12:14 pm
by vjbone
:o great post

Re: Alt-F4 #55 - The Dark Alleys of Modding

Posted: Fri Dec 17, 2021 4:15 pm
by mmmPI
yes !

Re: Alt-F4 #55 - The Dark Alleys of Modding

Posted: Fri Dec 17, 2021 11:39 pm
Very interesting stories. As a long-time modder for various games, engine limitations have always been a particularly tricky thing to deal with, but sometimes people come up with the most amazing solutions.

Re: Alt-F4 #55 - The Dark Alleys of Modding

Posted: Sun Dec 19, 2021 5:54 pm
by Ranakastrasz
For my Modular Armor Revamp mod, back when modular armor solar panels were terrible, I had two things I wanted to do which I had to work around.
Burner generators, and fusion reactors running on alien artifacts, both just looked at your inventory, but had to loop through the whole equipment grid to manually just add power to stuff. Not ideal. As for conduits, letting you get power from the grid, I think I used an accumulator, until those were forbidden from having priorities, then I used a laser turret dummy. Invisible and no pathing, just constantly teleporting to the player. Since then, burner equipment is a thing, if not in vanilla, and solar panels got buffed, so there isn't much need for that mod anymore. As for conduits, I could use the Electric interface now, If I wanted to recreate it.

I think the only other thing was my attempts to use cluster grenades to chain effects together, like to give a gun inaccuracy. It would shoot, cluster grenade effect to throw a second effect in a random direction, which would then causes the explosion randomly offset. But sadly cluster grenade was for 2+ effects only, and last I checked was never changed.

Re: Alt-F4 #55 - The Dark Alleys of Modding

Posted: Wed Dec 22, 2021 1:54 am
by Zaflis
I can share one issue i had with VehicleSnap. I'm still not 100% on why it worked like this but it's probably some weird case of internal vehicle physics.

If you drove a vehicle towards a coastline or cliff at an angle that was not along a snap axis, for example 11, 70, 350... or you name it - degrees, the vehicle would become stuck. As much as you tried to drive backwards it just wouldn't budge.

The issue as far as i saw it was that the control loop of my mod was trying to turn the vehicle towards the snap angle but it was unable to because it collided with the coast. And when that same tick registered a collision it "signaled" the game engine that the vehicle should just remain stopped. The act of collision probably sets speed to 0 regardless of input direction.

The solution at first was to only snap when vehicles speed was higher than some arbitrary X threshold. And obviously when you drive backwards the speed is negative, so you deal with Abs() values that turn all numbers positive. It did work but if you had a vehicle that was innately very slow it wouldn't be able to snap... And it was only through trial and error with many X values to find one that works for most vehicles.

While still not solving the slow vehicle problem, i still went another route. Instead of focusing on vehicle speed i could be looking at distance travelled in a period of time, in order to enable or disable snapping. This felt much more robust way to control the threshold, and it would never activate the snapping the same tick the speed goes high. Imagine some super car with insane acceleration, with the speed method it would probably remain stuck in the wall forever.

Later on the distance method was further supported by discovery of onPlayerChangedPosition() event which enabled the entire onTick event to disable itself when not needed. With this the script time when no player was driving was also reduced to nothing.

Re: Alt-F4 #55 - The Dark Alleys of Modding

Posted: Tue Feb 08, 2022 4:32 am
by CaptainSlide
Currently Steam tells me I have over 5800 hours in Factorio. Unlike most of the posters above I have only been playing since 0.18, so 2 years or so and yes I guess that is kind of sad, at leas t my wife would tell me so.

That said if it wasn't for all the wonderful mods you guys have provided for this game I probably would have tapped out 4000 hours ago and found something else to play.

So to all the modders out there a very BIG THANK YOU for keeping a wonderful game alive, fresh and interesting, at least for this addict.