Page 1 of 1

Pathing&Concealment compatibility

Posted: Mon Apr 10, 2017 7:24 am
by sentinel
I was wondering with all these lovely mods mentioning custom pathing & hardcoded concealment, if the benefit of having this hardcoded in native code brings enough performance benefit to outweight the work & slowdown by having mod authors redoing it themselfes.
I have seen it being mentioned in Comments:
- Gotcha Again
- Peek from Concealment
- True Concealment
- Perfect Information
- Tactical Surpressors

Re: Pathing&Concealment compatibility

Posted: Wed Apr 12, 2017 9:36 pm
by dstar3k
sentinel wrote:I was wondering with all these lovely mods mentioning custom pathing & hardcoded concealment, if the benefit of having this hardcoded in native code brings enough performance benefit to outweight the work & slowdown by having mod authors redoing it themselfes.
I have seen it being mentioned in Comments:
- Gotcha Again
- Peek from Concealment
- True Concealment
- Perfect Information
- Tactical Surpressors
I thought -- though I could be wrong -- that the problem was that it was in a section of code that only one mod can replace; therefore, changing it would make the mod incompatible with any other mod that made changes to it, such as LW2.

Re: Pathing&Concealment compatibility

Posted: Thu Apr 13, 2017 5:30 am
by sentinel
Why do people have to create their own version though? Isn't that something worth having a global function they could all connect with?

Re: Pathing&Concealment compatibility

Posted: Thu Apr 20, 2017 11:01 am
by Soldier9
I cannot speak for mods other than Gotcha Again, but the reason I use a custom system for creating pathing indicators is so I can avoid having the default system place an indicator somewhere where I need to place one of the custom ones I'm implementing and have things look weird.

Instead I take care of all types of indicators myself so I can properly combine them into one indicator if several are needed at the same tile.

You are mixing two problems together here though:
-Modifying XComGame objects, which is possible, but only 1 mod can do it.
-Native code, which is code that is not visible or modifyable to modders. The native code is implemented in C++ which runs faster than UnrealScript.

For the custom path-indicators in Gotcha Again I needed to do both, but luckily TrackTwo knew a trick that allowed me to avoid having to modify the XComGame object, which left me with only needing to modify a native implementation. Since this is never possible, my solution was to override the implementation, replacing it entirely. This will undoubtedly cost a bit of performance, but the functionality of the code Gotcha Again overrides is so simple that it should not matter: Native code still takes care of figuring out where to place the indicators, it is simply the placing of them that I took over doing...