Re: [MOD 0.15] Charge Transmission - Wireless Bot Charging
Posted: Sun Oct 22, 2017 11:06 pm
(See below for full answer.)
old
www.factorio.com
https://forums.factorio.com/
I don't. Though better layout wouldn't hurt.Dustine wrote:Agh, I hate the quoting system.
I told a friend after you told me... and he already bought it. So technically i could play if i wanted ^_^. But i tend to play any game only "once" so if i play it now i'll do the first two chapters and never go back. So i'd rather wait until it's complete. Not in any hurry either. I've got so much stuff on my want-to-play/do/watch lists that there's no point in rushing into EA games .Dustine wrote: - Opus Magnum (well, Codex, it is only a level pack) were my late childhood and a big part on getting me interested on programming so no waiting for me. No regrets either, it's all I would have wanted and more so far. And nobody out the company knew they were working on it, it was announced on this Monday to be released on Thursday. It was a really good surprise!
I guess you're using the unit_number indexing for on_build/mined? I usually just iterate in those two events because they don't happen often enough to make me care. Though ofc building a local (not-saved) index for quicker lookup might be an option there. But that's hardly worth to change now unless you really care. It'd also mean annoying migration code for your existing player base anyway so...bleh. It's not on_tick -> /care.Dustine wrote: - It's sparse because there's a lot of times I need to quickly find a node either by the roboport/cell it targets, or by the chargers it includes (altho that second part is me not trusting circular references). Easily solved with a separate index for the on_tick iterating and leaving global.nodes unit_number indexed still, bigger savefile size or not. (so yeah i'm changing this, thank you <3) Altho that "complex" math is one extra if and modulo, I forgot I simplified the math since 0.3 (it was... much worse back then), so it's not thaaaat bad.
There's also the potential case of "1 0 1 0 1 0 1 0" btw. But i haven't thought about a solution for that or if it's even worth it.Dustine wrote: - So it is 2 1 1 1 1, I wrongly assumed and didn't check it before accusing it of being clumping. Sorry.
Duh. Yes. Obvious. I don't know how i got the idea that most bots were mostly empty. I'll blame it on sleep-deprevation and general stress. I'm sorry for the fuss caused and the smugness i probably radiated while saying that stuff. I'm kinda tempted to just "[stroke]" all of those above posts...but i'll keep them for the record i think.Dustine wrote: The limit issue
*snipsnap*
I already replied on my github but to repeat it here: I was hoping the mod rewrite would be done by now (life... got in the way), but as it hasn't I'll do a quick port of it, if not tonight, by tomorrow the latest.dewitpj wrote:Hi,
Any plans to update to 0.16 ?
Thanks !
Hah, hadn't noticed it! I don't think I got a notification for your post, only the github issue (which is why I responded faster to that one).dewitpj wrote:In a twist of faith I posted here first
Thanks anyways !
Huh. I'll see what I can do, probably will fix itself once I do push 0.16 (and good news, it was a rather painless update so I'm getting ready to upload it!)dewitpj wrote:Oh - not sure if you can fix this one, but the version on the mod portal is 0.3.3 (?) while 0.4.4 is out ?
Remember when I said I couldn't use the to_be_charged table because I couldn't find a way to make the robots give up on charging after topping them off? Or at least a way that wasn't UPS intensive (replacing them with a copy)?eradicator wrote:Grats!
Kinda interested in what solution you lastly went with but no time to read large amount of code currently . Maybe later...
Teleport does nothing, they still fly to the roboport they were initially going to, even if it's now several miles away. Can't teleport entities (but players) between surfaces too, so no luck there. Active toggling, even over several ticks (deactivate one tick, activate the next), also didn't do anything. Rotating, uh, never tried but I'm assuming it doesn't work. The only thing I didn't try off the top of my head is to see if update_connections() did anything or not, and that's because I found out right then that changing forces *did* something, which was progress compared to everything else not stopping the charging march ^^"eradicator wrote:That sounds like quite a neat hack :3. It sounds a bit strange though that they remember their current job even after "changing" force. Or maybe it's because they don't actually change that it still works. Did you try any similar methods (micro-optimization!) like teleporting the bots to their current position, or not rotating it, or active=true , so many possibilities. Active suonds like the only one where you don't have to transfer any objects (force, position, etc) from c to lua, hm...but i guess only if one assumes the robot is actually active. No..stop...brain. You did a good job. You deserve a break
If they don't remember their task doesn't that make the wireless charging kinda meh again? As another bot then needs to be assigned and fly the whole way again. And cloning sounds expensive again D:. (No actual time to test anything *sigh*)Dustine wrote: Edit: Oh, and they don't remember their task when swapping forces. When I tested out if making a bot copy worked, the logistic network reassigned the task to the clone without a hitch. So I assume it's the same mechanic happening here!
No no, you misunderstood me. The network reassigns the now-vacant job to the "new" robot, which is right where it was before it got charged so it just continues like nothing happened, it doesn't dispatch one bot from storage (I checked). And cloning was expensive, still less than 0.5 if I did it right, but then I found a better way :3eradicator wrote:If they don't remember their task doesn't that make the wireless charging kinda meh again? As another bot then needs to be assigned and fly the whole way again. And cloning sounds expensive again D:. (No actual time to test anything *sigh*)Dustine wrote: Edit: Oh, and they don't remember their task when swapping forces. When I tested out if making a bot copy worked, the logistic network reassigned the task to the clone without a hitch. So I assume it's the same mechanic happening here!