aliens

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Alpha Centauri Bear

Pages: 1 [2] 3 4 ... 31
16
Brutal AI / Re: Brutal-OXCE 8.0.3
« on: January 05, 2024, 07:44:36 pm »
No. I didn't hope it will be correct. This is just an illustration that you should handle -1 value separately and not let it to main processing branch. A lot of IFs everywhere, etc.

I usually rename my variable so the code breaks everywhere it is used. This way I can cover all the usage.
Also, it may be cleaner to hide it under extra layer. Say instead of Position introduce something like OptionalPosition that may either contain valid position or no position. Extra methods: bool hasValue(), Position getValue(). Latter should blow if there is no value. Stuff like this, you know.

17
Brutal AI / Re: Brutal-OXCE 8.0.3
« on: January 05, 2024, 03:00:11 pm »
Simply adding this check at the top of this function makes this not to crash anymore. I am not sure if it also screwed the AI computation but, I guess, you can figure the rest.

Code: [Select]
std::map<Position, int, PositionComparator> AIModule::getReachableBy(BattleUnit* unit, bool& ranOutOfTUs, bool forceRecalc, bool useMaxTUs)
{
std::map<Position, int, PositionComparator> tuAtPositionMapDefault;

if (unit->getTileLastSpotted(_unit->getFaction()) == -1)
return tuAtPositionMapDefault;
...
Position startPosition = _save->getTileCoords(unit->getTileLastSpotted(_unit->getFaction()));

18
Brutal AI / Re: Brutal-OXCE 8.0.3
« on: January 05, 2024, 02:34:05 pm »
I found one attempt to set position (-1, 0, 0). Not sure if this is the culprit but it is definitely a dirty code that scratches my eye.

BattleUnit.h
Code: [Select]
int _tileLastSpottedForBlindShotByHostile, _tileLastSpottedForBlindShotByNeutral, _tileLastSpottedForBlindShotByPlayer = -1;

AIModule.cpp
Code: [Select]
std::map<Position, int, PositionComparator> AIModule::getReachableBy(BattleUnit* unit, bool& ranOutOfTUs, bool forceRecalc, bool useMaxTUs)
{
Position startPosition = _save->getTileCoords(unit->getTileLastSpotted(_unit->getFaction()));

With last spottet tile == -1 it sets startPosition to (-1,0,0), which is incorrect, as it does not fit into map tile vector, obviously.

You should treat it as "not spotted" and accurately wrap around it.

19
Brutal AI / Re: Brutal-OXCE 8.0.3
« on: January 05, 2024, 02:52:54 am »
Another thing I don't understand why storing linked list in vector may cause any trouble. Links are stored as pointers. Meaning destructor will just delete the pointer itself disregarding pointed object altogether. It should be completely irrelevant if pointed object is deleted by that time.

20
Brutal AI / Re: Brutal-OXCE 8.0.3
« on: January 05, 2024, 02:49:00 am »
Good observations. I thought about the same.

Few questions.

Is this setBattleGame an OXC/OXCE code? Why BAI suddenly makes it break? Do you speculate there is a trouble waiting to happen and BAI just create a condition for it to popup?

I understand PathfindingNode is application class and not the library one. Didn't understand a reference on "PathfindingNode usually has a problem when deleting ... ". Is it some common knowledge?

21
Help / Re: Physical training facility implementation
« on: January 04, 2024, 10:25:44 pm »
That is what I like to hear!

But how exactly? I don't see any references on PNG files in the ruleset.

22
Help / Re: Physical training facility implementation
« on: January 04, 2024, 09:42:00 pm »
Well, map I can borrow from psi lab, no biggie.
What is this PAK format? No editor recognizes it.

23
Help / Re: Physical training facility implementation
« on: January 04, 2024, 09:29:57 pm »
Oh. It is not that simple. Apparently, I need to embed it into BASEBITS.PCK.

24
Help / Re: Physical training facility implementation
« on: January 04, 2024, 09:16:21 pm »
Thanks! Neat.

25
Brutal AI / Re: Brutal-OXCE 8.0.3
« on: January 04, 2024, 07:28:20 pm »
Where do you see stack trace? I don't see it in stderr.txt or in openxcom.log.

26
Brutal AI / Re: Brutal-OXCE 8.0.3
« on: January 04, 2024, 07:22:16 pm »
And I need to match your mod set, of course. The save complains I am missing some.

27
Brutal AI / Re: Brutal-OXCE 8.0.3
« on: January 04, 2024, 07:12:17 pm »
And this is xcom1, right?

28
Brutal AI / Re: Brutal-OXCE 8.0.3
« on: January 04, 2024, 06:36:51 pm »
Is this error stack trace? Are you able to run it from VS in debugger?

29
Help / Physical training facility implementation
« on: January 04, 2024, 05:20:53 pm »
Hello, fellow modders.
I know it is possible to define a facility for soldiers physical training, similar to psi one. However, the pictures for such facilities are not defined in OG, obviously.
Anybody has already implemented it and created a distinct picture on a base view and willing to share? Thank you.

30
OXCE Suggestions DONE / Re: [DONE][Suggestion] Base info UI changes
« on: January 04, 2024, 05:03:41 pm »
Thanks!

I understand standard compatibility courtesy requires to keep it as an option. However, from my point of view, this changes bars only beyond the point they are unusable anyway. So it may be easier for newbie modders to not even know that such option exists and get this neat improvement automatically.
Just thinking out loud. I am good either way.

Pages: 1 [2] 3 4 ... 31