Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexing can generate clusters with no center or size #812

Open
3 of 6 tasks
Briggybros opened this issue Feb 5, 2024 · 8 comments
Open
3 of 6 tasks

Indexing can generate clusters with no center or size #812

Briggybros opened this issue Feb 5, 2024 · 8 comments

Comments

@Briggybros
Copy link

Briggybros commented Feb 5, 2024

Prerequisites

  • Can you reproduce the problem using ALiVE and CBA Only?
  • Are you running the latest version of ALiVE ?
  • Are you running the latest version of CBA_A3?
  • Have you attached an unbinarized SQM?
  • Have you attached your RPT (If the issue relates to data, also attch Server RPT and ALiVE Plugin Log)?
  • Have you attached screenshots of the Parameters set on the offending Module?

Description

Map indexing fails on Kujari with a zero divisor error in auto_appendClustersCiv.sqf

 1:07:50 Error in expression <elect 0;
private _positionY = _position select 1;

private _gridPosition = [_log>
 1:07:50   Error position: <select 1;

private _gridPosition = [_log>
 1:07:50   Error Zero divisor
 1:07:50 File x\alive\addons\fnc_analysis\fnc_sectorGrid.sqf..., line 331
 1:07:50 Error in expression <t["%1_%2",_sectorID select 0, _sectorID select 1];

if(_sectorID in (_gridData s>
 1:07:50   Error position: <select 1];

if(_sectorID in (_gridData s>
 1:07:50   Error Zero divisor
 1:07:50 File E:\grego\Documents\Arma 3 - Other Profiles\117Briggy\scripts\x\alive\addons\fnc_analysis\tests\auto_appendClustersCiv.sqf..., line 127

Steps to Reproduce

  1. Follow steps on http://alivemod.com/wiki/index.php/Map_Indexing with Kujari map
  2. Check staticData (+ .txt because github doesn't like sqf):
    tem_kujari_staticData.sqf.txt
  3. Continue with process
  4. Test indexing based on wiki steps

arma3_x64_2024-02-05_00-47-16.rpt.txt

Expected behavior: [What you expected to happen]
Map index completes and testing the index (with the same wiki steps) shows civilian clusters around the map

Actual behavior: [What actually happened]
Map index errors in log, but completes in game. Testing the index only shows civilian clusters around Marwey, Mourimadi, and Samari

@marceldev89
Copy link
Contributor

If you have any issues, re-index the map, set the Map Bounds (in the Indexer Module settings) to the size of the map rounded up to the nearest 1000, i.e. 5120 = 6000. Make sure you delete everything under the @alive\indexing\mapname\x\ folder EXCEPT for your @alive\indexing\mapname\x\alive\addons\main\static\mapname_staticData.sqf file. Edit your static data file where the ALIVE_MapBounds value is set. Ensure you select No to object categorisation (in the Indexer Module settings).

It's been a loooooong while since I did some indexing so I'm not quite sure if this error was related to it but I think so. Judging by the errors it seems like it wants to index something that's outside the actual map bounds causing the error. Setting the map bound in the module should fix that.

@Briggybros
Copy link
Author

Briggybros commented Feb 6, 2024

Setting the map bounds leads to the same error:

17:54:47 Error in expression <elect 0;
private _positionY = _position select 1;

private _gridPosition = [_log>
17:54:47   Error position: <select 1;

private _gridPosition = [_log>
17:54:47   Error Zero divisor
17:54:47 File x\alive\addons\fnc_analysis\fnc_sectorGrid.sqf..., line 331
17:54:47 Error in expression <t["%1_%2",_sectorID select 0, _sectorID select 1];

if(_sectorID in (_gridData s>
17:54:47   Error position: <select 1];

if(_sectorID in (_gridData s>
17:54:47   Error Zero divisor
17:54:47 File E:\grego\Documents\Arma 3 - Other Profiles\117Briggy\scripts\x\alive\addons\fnc_analysis\tests\auto_appendClustersCiv.sqf..., line 127

From the map view at least it doesn't look like there are any points outside of the sectors
20240206175619_1

@marceldev89
Copy link
Contributor

Can you try reducing the map bounds by 1000? Judging by the screenshot the sectors 16_* and *_16 or partly outside the playable area or something?

@Briggybros
Copy link
Author

A size of 16000 gives the same error, and looks to be the size it was running at when no size was specified.

20240207222944_1

This size does have some points outside of the sectors though

20240207223011_1
20240207223018_1

@Briggybros
Copy link
Author

Briggybros commented Feb 8, 2024

Dig a bit more digging and the issue is caused by a sector not having a center point:

ALIVE_clustersCivPower is has a single cluster with an empty center:

[
    "#CBA_HASH#",
    ["c_105"],
    [
        [
            "#CBA_HASH#",
            ["nodes","center","size","clusterID","type","priority","debugColor"],
            [[143206: solarpanel_3_f.p3d,143207: solarpanel_3_f.p3d,143055: spp_panel_f.p3d,143054: spp_panel_f.p3d,142933: spp_panel_f.p3d],[],0,"c_105","CIV",40,"ColorYellow"],
            any
        ]
    ],
    any
]

From an outside perspective it feels like a cluster should always have a center and size?

@marceldev89
Copy link
Contributor

Hmm yes it seems like it. The center is literally just the center point of the sector so in theory all of them should have a center. 😅

Maybe try reducing it another 1000 or maybe try the original map bounds and then + 1000? I don't know, kinda out of ideas 😛

@Briggybros Briggybros changed the title Indexing Kujari throws zero divisor error when creating civilian clusters Indexing Kujari generates civilian power clusters with no center or size Feb 10, 2024
@marceldev89
Copy link
Contributor

By the way, did you fully delete the indexing folders when trying again? The only file that's ok to keep is the one with the building categories (tem_kujari_staticData.sqf.txt)

@Briggybros
Copy link
Author

By the way, did you fully delete the indexing folders when trying again? The only file that's ok to keep is the one with the building categories (tem_kujari_staticData.sqf.txt)

Yeah, started with a clean index

@Briggybros Briggybros changed the title Indexing Kujari generates civilian power clusters with no center or size Indexing can generate clusters with no center or size Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants