BP Logo
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:3536
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:3536
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:3536
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:3536
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:374
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:3536
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:2280
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:374
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:428
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 messageGo to next message
Seven.

 
Messages:2521
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 (r2157) | Experimental project | Modpack | Youtube | Trunk (r9143) | 1.13 Starter Docs | 1.13 How to get | Win10 fix | Discord


Re: Absurdly small code changes[message #362337 is a reply to message #359075] Mon, 08 February 2021 22:33 Go to previous messageGo to next message
Seven.

 
Messages:2521
Registered:December 2012
Location: Russian Federation
sevenfm wrote on Sat, 22 February 2020 22:13
Looks like new M_STAND.JSD makes hitting enemy swimming in deep water impossible.
silversurfer wrote on Sun, 23 February 2020 03:55
M_STAND.JSD wasn't changed much, except you can now shoot between the legs and N, E, S, W directions are not thicker anymore than the other directions.
Just checked again, with new M_STAND.JSD, it's impossible to hit soldier swimming in deep water in certain directions (facing the shooter) when using OCTH.
https://i.imgur.com/5YYd7TG.png



7609+AI (r2157) | Experimental project | Modpack | Youtube | Trunk (r9143) | 1.13 Starter Docs | 1.13 How to get | Win10 fix | Discord


Re: Absurdly small code changes[message #363383 is a reply to message #362337] Fri, 18 June 2021 21:55 Go to previous messageGo to next message
Flugente

 
Messages:3536
Registered:April 2009
Location: Germany
A few recent changes that might be interesting:
  • r9079: Ballistic shields are now drawn better under/over a merc. In particular they are no longer drawn over buildings.
  • r9080: Fixed structure damage from anti-materiel bullets. Damage to structures is now detected and applied a lot better, making these rifles more useful.
  • r9084: The contents of a container are no longer destroyed when the container is damaged. Why destroy items inside a crate if the crate still holds?
  • r9087: Related to the above, if a container is destroyed, the items inside are only destroyed if the cause was an explosion. It no longer happens if the cause was an anti-material bullet or vehicle collision. After all decades of videogames have taught me that shooting a crate is a perfectly legitimate way of opening it!
    This also means that an OSV-96 or a Hummer are now lockpicks. You're welcome. happy



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 #363385 is a reply to message #363383] Sun, 20 June 2021 00:23 Go to previous messageGo to next message
Uriens

 
Messages:340
Registered:July 2006
Now all we need is a way to drag a container to an open street so we can make a roadkill out of it. cheeky
Re: Absurdly small code changes[message #363386 is a reply to message #363385] Sun, 20 June 2021 02:43 Go to previous messageGo to next message
Kitty

 
Messages:321
Registered:October 2017
Location: Germany
Uriens wrote on Sun, 20 June 2021 00:23
Now all we need is a way to drag a container to an open street so we can make a roadkill out of it. cheeky

I think we already can happy Another piece of Flugentes magic:






How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)
Re: Absurdly small code changes[message #363516 is a reply to message #363386] Thu, 15 July 2021 21:39 Go to previous message
Flugente

 
Messages:3536
Registered:April 2009
Location: Germany
A few more changes that might be interesting and aren't fitting into other threads:

  • r9114: Anti-materiel bullets no longer stop when they damage a structure. This means that a sufficiently damaging bullet can destry several structures in it's path, as seen in a recent video.
  • r9120: Dragging a structure no longer repairs it or removes the new decals placed upon it.
  • r9123: On large roofs the destruction can take a while. It's faster now, but still not perfect.
  • r9123: Fixed a method to accidentally corrupt a savegame by saving map changes that weren't meant to be saved. What happened was that the game tried to save an ongoing animation as a structure, which predictably failed.
  • r9133: Fix: cows left no corpse if they died from a gas attack.
  • r9140: Fix: crash when spreading gas tries to inhabit a tile blocked by a structure.
  • r9144: Whether a gun shoots fire or fire retardant is now set on the ammo with the <ammoflag>-tag, not the gun. In case you haven't noticed, we have fire extinguishers now. I also restored the flamethrower in stock to functionality.
    This change means that theoretically, you could have a gun that either causes or extinguishes fire depending on the type of ammo loaded. This is set in the <ammoflag>-tag in AmmoTypes.xml. The following flags exist:
    <ammoflag>			flagmask for various ammo properties:
    							AMMO_CRYO				1			this ammo shock-freezes target (scifi)
    							AMMO_BLIND				2			this ammo will blind if it hits the head
    							AMMO_ANTIMATERIEL		4			this ammo is anti-materiel, bullets can destroy structures
    							AMMO_TRAIL_WHITESMOKE	8			this ammo leaves a trail of white smoke
    							AMMO_TRAIL_FIRE			16			this ammo leaves a trail of fire
    

    https://i.imgur.com/lAzIBur.png




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.


Previous Topic: New feature: interactive actions
Goto Forum:
  


Current Time: Fri Jul 23 19:56:44 EEST 2021

Total time taken to generate the page: 0.03292 seconds