Home » MODDING HQ 1.13 » Flugente's Magika Workshop » Absurdly small code changes  () 1 Vote
Re: Absurdly small code changes[message #360494 is a reply to message #360475] Fri, 03 July 2020 01:09 Go to previous messageGo to next message
Flugente

 
Messages:3540
Registered:April 2009
Location: Germany
If you have a slow PC, or are you using a debug exe, you might have come across an annoying issue:
While plotting a path for a squad in the strategic view, there is a noticeable lag. This can range from 'barely noticable' to 'it lags so hard it does barely register me aborting the plot, so it might be necessary to Alt+F4 the process'.
The reason for this behaviour is that the game constantly redraws the plotted path, and constantly recalculates the ETA.
ETA depends on travel speed.
Travel speed depends on encumbrance and stats, thus we constantly recalculate the selected squad's inventory weight. For this we loop over each item and all of it's attachments...

Well, no more of that. As our squad and their inventory cannot be changed while we plot the path, and we cannot advance the time either, we do the above evaluation only once from now (r8832) on. This stops the lag, even on a debug exe the plot is now lag-free.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Absurdly small code changes[message #360496 is a reply to message #360494] Sat, 04 July 2020 02:23 Go to previous messageGo to next message
Flugente

 
Messages:3540
Registered:April 2009
Location: Germany
One has two possible solutions to solving the Doreen quest: convincing her to leave peacefully, or killing her. The first solution yields double the loyalty bonus in Drassen.
Sirtech's intention was that if you kill her after already having solved the quest, you lose the loyalty gain you got for the peaceful solution. But due to not taking into account twon sentiment properly, the bonus was never fully removed. As a solution the optimal approach was to first convince her of the error of her ways, and then to kill her. Which, frankly, shouldn't be a thing. The population shouldn't cheer you most when you convince someone to do something for you and then immediately stab you in the back.

Fixed in r8835.

[Updated on: Sat, 04 July 2020 02:23]




I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Absurdly small code changes[message #360500 is a reply to message #360496] Sun, 05 July 2020 15:11 Go to previous messageGo to next message
Flugente

 
Messages:3540
Registered:April 2009
Location: Germany
As you may or may not know, if an insured merc dies, an investigation might be called into the death. There are three reasons for that, with three different results:

  • If the merc died within one hour of finalizing the contract, this counts as 'very suspicious'. You get no payout.

  • If the merc died with no hostiles being in the sector, or if another merc killed them, this counts as 'suspicious'. You get the payout.

  • If several investigations happened earlier, an investigation is called even if the above conditions do not apply. You get the payout.
My issue is with the second one - why the hell does the insurance company pay if we straight off murder a merc to get the insurance money?

So I've changed that. As of r8843 & GameDir r2556, you also get no payout in the second case. If you want to commit insurance fraud, at least put a bit of effort in, dammit!

[Updated on: Sun, 05 July 2020 15:11]




I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Absurdly small code changes[message #360551 is a reply to message #360500] Fri, 10 July 2020 19:56 Go to previous messageGo to next message
Flugente

 
Messages:3540
Registered:April 2009
Location: Germany
On longer campaigns, loading savegame can take quite a while. How much exactly, and why?
As of r8856, we now have a small log about that. Time spent is logged in the LoadSavedGame_TimeLog.txt file:

Load savegame: SavedGames\QuickSave.sav
Shutdown stuff								: 0.028000s
LoadTacticalStatusFromSavedGame done					: 0.000000s
LoadLaptopInfoFromSavedGame done					: 0.430000s
LoadSoldierStructure done						: 0.410000s
LoadStrategicInfoFromSavedFile done					: 0.023000s
LoadStrategicMovementGroupsFromSavedGameFile done			: 0.012000s
LoadMapTempFilesFromSavedGameFile done					: 0.123000s
LoadMilitiaMovementInformationFromSavedGameFile done			: 0.205000s
LoadLuaGlobalFromLoadGameFile done					: 0.078000s
File read done								: 0.001000s
Update functions							: 0.035000s
LoadSavedGame total							: 1.345000s
This aren't all the functions we call when loading a savegame - not by a longshot - but seemed natural locations to me.

Hopefully this will allow us to easier track issues with the loading process, as well as allowing us to benchmark possible improvements.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Absurdly small code changes[message #360601 is a reply to message #360496] Wed, 15 July 2020 18:09 Go to previous messageGo to next message
gougluinn

 
Messages:241
Registered:September 2018
Flugente wrote on Sat, 04 July 2020 02:23
One has two possible solutions to solving the Doreen quest: convincing her to leave peacefully, or killing her. The first solution yields double the loyalty bonus in Drassen.
Sirtech's intention was that if you kill her after already having solved the quest, you lose the loyalty gain you got for the peaceful solution. But due to not taking into account twon sentiment properly, the bonus was never fully removed. As a solution the optimal approach was to first convince her of the error of her ways, and then to kill her. Which, frankly, shouldn't be a thing. The population shouldn't cheer you most when you convince someone to do something for you and then immediately stab you in the back.

Fixed in r8835.
i read somewhere that we can able to recruit loreen. is this possible? if it is then what are the requirements?
Re: Absurdly small code changes[message #360604 is a reply to message #360601] Wed, 15 July 2020 22:53 Go to previous messageGo to next message
Flugente

 
Messages:3540
Registered:April 2009
Location: Germany
Iirc there is some mod where you can recruit pretty much every NPC, so likely Doreen too. Many Mercenaries Mod or something like that. But in stock... nope.



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Absurdly small code changes[message #360606 is a reply to message #360601] Thu, 16 July 2020 09:10 Go to previous messageGo to next message
Hawkeye

 
Messages:2204
Registered:October 2005
Location: Australia
You can recruit Doreen in Deidranna's Side Mod as well as a heap of other bad guys.

http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=24401&start=0&



Re: Absurdly small code changes[message #360608 is a reply to message #360606] Thu, 16 July 2020 20:33 Go to previous messageGo to next message
gougluinn

 
Messages:241
Registered:September 2018
thx for that happy
Re: Absurdly small code changes[message #361399 is a reply to message #348524] Mon, 28 September 2020 17:35 Go to previous messageGo to next message
Kurt

 
Messages:411
Registered:March 2004
Flugente wrote on Fri, 27 January 2017 23:41
I slightly altered the chances for bullets to pass things in r8378 & GameDir r2360:

The AmmoTypes.xml- tag <canGoThrough> has been replaced with <usPiercePersonChanceModifier> (unsigned integer). If value is > 0, a bullet can pierce a person after hitting. Higher values increase the chance to do so. This is the same mechanic as before, only now can we modify the thing.
Is that supposed to work in 8796 SCI?

I can't get it to work, in 8796 the slightest object stops the bullet, which means those heavy anti-material rifles have lost their main interest, the ability to reach out and touch targets behind walls and light cover. They're heavy and expensive, their ammunition is heavy and expensive, but they can go where no other rifle can go...


Flugente wrote on Fri, 27 January 2017 23:41
In case you want to create downright nasty results, set usPiercePersonChanceModifier to 100 and structureImpactReductionMultiplier to 0. Pretty much the only thing stopping these bullets will be Newton suprised
I tried that setting, and my 12.7x108mm rounds didn't even go through one single wall. Which makes me think something is broken.

Note I tried that using a KSVK rifle, on a wall I can routinely shoot through in 3356, aiming at a civilian behind the wall using a thermal visor (yes, SciFi mod), so there is no way I could miss him. I also positioned a merc in the target's room, just in case, to see if the bullet keeps flying on the other side of the wall - It doesn't.

In short, in 8796 any value over 0 for "usPiercePersonChanceModifier" seem to be ignored in-game. speechless



-------- Edited to add:

Found the culprit: Apparently the "anti-material" flag (AmmoFlag 4) does negate the "usPiercePersonChanceModifier". I posted a Bug Report.

[Updated on: Mon, 28 September 2020 18:33]

Re: Absurdly small code changes[message #361875 is a reply to message #350400] Mon, 16 November 2020 23:07 Go to previous message
sevenfm

 
Messages:2355
Registered:December 2012
Location: Russian Federation
Flugente wrote on Wed, 26 July 2017 18:49
Another result of this year's convention is a new skill for our mercs: Focus.
I don't think it should be stackable with bonus from watched locations as it plays similar role, in my opinion if focus skill is active, bonus from watched location should be disabled.



7609+AI (r1792) | Experimental project | Unofficial Modpack | Youtube | Trunk (r8916) | 1.13 Starter Docs | 1.13 How to get

Кто в Москве не бывал, красоты не видал.


Previous Topic: Expanded Feature: Move militia in strategic map, part 2
Next Topic: New feature: enemy generals
Goto Forum:
  


Current Time: Sat Dec 05 08:19:38 EET 2020

Total time taken to generate the page: 0.03610 seconds