[A12C] Mechanical Defence 2 (Update 23 - quick fix)

Started by mipen, November 10, 2014, 03:58:33 AM

Previous topic - Next topic

Mrshilka

One of my droids just took a charge lance shot and lost it's cpu, it's been sitting there repairing now for around 10 minute at speed 4 and nothing is happening, the body damage was fixed in seconds but this is just sitting there endlessly working.

Simulacrum0

the repair station needs Steel Not SteelBar Ninefinger mod pack is to blame.

Mrshilka


Leucetius

Added a self-preservation routine to the MD2Droids. It fires under the following conditions:
- droid not drafted (player controlled)
- power below 10%
- not charging or on its way to a chargepad (should be clear :) )
- chargepad available

What does your droid do? Simply dropping whatever it's doing at the moment and running for the nearest chargepad.


Commit awaits pull by mipen and then he surely will release the new dll (nothing else changed - was savegame friendly in my tests)

Ninefinger

Quote from: Leucetius on July 19, 2015, 05:48:38 AM
Added a self-preservation routine to the MD2Droids. It fires under the following conditions:
- droid not drafted (player controlled)
- power below 10%
- not charging or on its way to a chargepad (should be clear :) )
- chargepad available

What does your droid do? Simply dropping whatever it's doing at the moment and running for the nearest chargepad.


Commit awaits pull by mipen and then he surely will release the new dll (nothing else changed - was savegame friendly in my tests)

Cool i was thinking just change the 10% to 20% would probably be all that was needed but this sounds good too. Cheers!

Leucetius

The problem is not the 10% as such but that the bot has a job choice before reaching that level but not during a job. Increasing the limit to 20% would've limited the problem only to those really long jobs that run through 20% droid power but wouldn't have solve it.
The root of this evil - as recognized by a few, you included - is, that once a job is started the bot tries to finish it. No matter what. That is because the stock jobgiver/driver_work don't know a "critical energy" interupt-condition.

harpo99999

Quote from: Triple H3lix on July 19, 2015, 06:13:05 PM
Lovely pack, but I would rather like a no seeds please option, I tried removing it myself but it didn't really work too well.  Removing it also removes the vegetable garden mod and whatever gives the omnigel plants.  This means no aloe, which means no medicine, which means no bionic parts.

I would be willing to use the seeds mod if it would give more seeds when harvested.  As is I only get about half the crop's seeds back, which seems like it should be the other way around.
are you sure you postied in the correct thread? I have not seen ANY seeds in mechanical defences. perhaps you meant the seeds mod thread

Vas

Quote from: Leucetius on July 19, 2015, 10:29:21 AM
The problem is not the 10% as such but that the bot has a job choice before reaching that level but not during a job. Increasing the limit to 20% would've limited the problem only to those really long jobs that run through 20% droid power but wouldn't have solve it.
The root of this evil - as recognized by a few, you included - is, that once a job is started the bot tries to finish it. No matter what. That is because the stock jobgiver/driver_work don't know a "critical energy" interupt-condition.

I still think the mod should let the user choose what power levels are critical for them.  I mean, I spent 300 energy going to the opposite end of the map in a heavy thick snow.  There's no way he would have made it back, had he been low on energy.

On top of that, I think that Mipen should also make the droids not explode when their power goes out.  I mean.  My laptop doesn't explode when it's power runs out.  Last I checked, my phone didn't explode when it's power ran out, otherwise I'd be legless right now and be only half a man.  It's not like we build these droids to self destruct if their power runs out.  In fact, why are we building these droids with built in bombs in the first place?  The only way to make them explode the way they do is if we build them with a bomb inside.  Which is hugely wasteful.  If anything, the only droid I'd build with a bomb in it is a combat or suicide droid that runs up to the enemy and explodes against them.  A droid that runs out of power should just simply shut down, and wait to be rescued.

If the mod includes source (I forget) I may just take a look at it and see if I might be able to change anything.  I'm not a coder myself so, I doubt I can.  But I have ideas and such that might be interesting if someone was able to help me get them functioning and all.
Click to see my steam. I'm a lazy modder who takes long breaks and everyone seems to hate.

mipen

Quote from: Leucetius on July 19, 2015, 05:48:38 AM
Added a self-preservation routine to the MD2Droids. It fires under the following conditions:
- droid not drafted (player controlled)
- power below 10%
- not charging or on its way to a chargepad (should be clear :) )
- chargepad available

What does your droid do? Simply dropping whatever it's doing at the moment and running for the nearest chargepad.


Commit awaits pull by mipen and then he surely will release the new dll (nothing else changed - was savegame friendly in my tests)
Thanks for this leucetius, I'll merge it right away :D I was trying to think of a way to do this and this is a nice simple way

Quote from: Vas on July 19, 2015, 08:56:36 PM
Quote from: Leucetius on July 19, 2015, 10:29:21 AM
The problem is not the 10% as such but that the bot has a job choice before reaching that level but not during a job. Increasing the limit to 20% would've limited the problem only to those really long jobs that run through 20% droid power but wouldn't have solve it.
The root of this evil - as recognized by a few, you included - is, that once a job is started the bot tries to finish it. No matter what. That is because the stock jobgiver/driver_work don't know a "critical energy" interupt-condition.

I still think the mod should let the user choose what power levels are critical for them.  I mean, I spent 300 energy going to the opposite end of the map in a heavy thick snow.  There's no way he would have made it back, had he been low on energy.

On top of that, I think that Mipen should also make the droids not explode when their power goes out.  I mean.  My laptop doesn't explode when it's power runs out.  Last I checked, my phone didn't explode when it's power ran out, otherwise I'd be legless right now and be only half a man.  It's not like we build these droids to self destruct if their power runs out.  In fact, why are we building these droids with built in bombs in the first place?  The only way to make them explode the way they do is if we build them with a bomb inside.  Which is hugely wasteful.  If anything, the only droid I'd build with a bomb in it is a combat or suicide droid that runs up to the enemy and explodes against them.  A droid that runs out of power should just simply shut down, and wait to be rescued.

If the mod includes source (I forget) I may just take a look at it and see if I might be able to change anything.  I'm not a coder myself so, I doubt I can.  But I have ideas and such that might be interesting if someone was able to help me get them functioning and all.
I am currently working on a rewrite of the droids that will include the ability to set the three different percentage levels for the charging, and will also have upgradable power cells. I'll also work on a system of recharging droids that are out of power (so they won't explode anymore) which should be good

Quote from: Ninefinger on July 18, 2015, 10:03:29 PM
Quote from: Mrshilka on July 18, 2015, 09:18:25 PM
Quote from: Ninefinger on July 18, 2015, 09:08:59 PM
Quote from: Mrshilka on July 18, 2015, 06:52:24 PM
Where would I have to change it so droids go back to charge at say 100 power then? I have lost 9 in my current game because they stupidly continue to go haui when about out of power.

There is one way to balance this better. you can set droids max energy to something smaller and reduce there energy use rate, but im not sure if you can adjust the droid charge pad charge rate by adjusting its efficiency or not but probably i will test this now and make it balanced the exact same as it is set now just with smaller numbers that drains and charge slower that way to 50 or 60 energy will last longer and carry the Droids to safety.

Thanks again Nine, these big maps and ice and heavy snow really slow them down so they go off hauling at 101 energy and die before every getting back to a charge pad.

Im sorry i tried but it seems that is hard coded as a percentage that the droid needs to go home, my tests worked as intended with making smaller max energy ans smaller energy use rate but the lower i made the max health the lower the critical limit went too so basically you end up with the exact same situation only with smaller slower moving numbers. sorry this needs dll coding.
Yeah sorry, the percentages are hard coded. But I am working on a rewrite of the mod now which will include the ability to set these percentages yourself in game. Just to let you know, if you want to change the material needed to repair droids, there is an extra tag in the repair station def that sets it, you can also change how much it repairs per repair tick there

Ninefinger


mipen

Hey everyone, just a quick update here. I've been quite busy so I haven't been able to reply to messages as much, but I am reading them when I can and taking notes on what is being requested / what issues are coming up. I am currently working on a rewrite of the droids module which will (I believe) greatly increase the functionality of it. Droids will now be fully customizable by the player. To build one, you will create a new blueprint for it, which will define the jobs it can do, the graphics it uses, the different parts it has (power cell etc) and a few other things. Everything you choose will affect how much it costs to build. You can save the blueprint to be used however many times you want. The power cell you use will determine how much power it can store, with some generic ones being manufacturable, and more powerful unique ones being bought from a new trader. You will be able to set the percentage at which droids will go to get recharged, and they will no longer explode when they run out of power, but instead be 'minified' and have to be reset at a special table. There will be a new architect option which will contain all the droid related buildings.
I can't say when this will be ready, as the UI parts of things is difficult to do, but hopefully it won't be too long :) if you have any suggestions, please do let me know!

Ninefinger

Quote from: mipen on July 19, 2015, 10:35:25 PM
Hey everyone, just a quick update here. I've been quite busy so I haven't been able to reply to messages as much, but I am reading them when I can and taking notes on what is being requested / what issues are coming up. I am currently working on a rewrite of the droids module which will (I believe) greatly increase the functionality of it. Droids will now be fully customizable by the player. To build one, you will create a new blueprint for it, which will define the jobs it can do, the graphics it uses, the different parts it has (power cell etc) and a few other things. Everything you choose will affect how much it costs to build. You can save the blueprint to be used however many times you want. The power cell you use will determine how much power it can store, with some generic ones being manufacturable, and more powerful unique ones being bought from a new trader. You will be able to set the percentage at which droids will go to get recharged, and they will no longer explode when they run out of power, but instead be 'minified' and have to be reset at a special table. There will be a new architect option which will contain all the droid related buildings.
I can't say when this will be ready, as the UI parts of things is difficult to do, but hopefully it won't be too long :) if you have any suggestions, please do let me know!

You should use those textures from jabbamonkey I am using them for the Ultimate Overhaul Modpack and I think they look real slick. ;)

Mrshilka

Sorry to be a bother but droids are still killing themselves in my game, the low power threshold is simply to low for large maps and snow and ice slowing movement.
The drop everything and charge feature its fantastic and works exactly as you state but it trigger far too low a power rating already lost 4 droids in my current game.

If you cannot change the power limits can they please stop blowing up and not say simple fall over and need recovery to a charge pad?

*Edit*


THIS is where the low power must charge kicked in for this droid, it used 200+ power to get to this point ignoring the power is low warning to keep on moving out, this is the issue I have with the droids they should soon as battery goes to low power turn around and use remaining power to get to a charge point not continue on to a point where the only ending is death.

mipen

I am working on a rework of the droids that should help fix the problems you are having, but I can't say when it will be ready

Iwillbenicetou

Are you going to make them rescuable or work in another form of power detection. Maybe like a program (don't know if possible) that detects the power needed to go to the nearest power charging point, and the power left. Just an idea
Mod Help! The basics on how to download mods!