-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fix: More tweaks to spawns/loot with regards to subgroups. #541
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are arguments which are always 0, should we just remove those arguments?
Arrowgene.Ddon.GameServer/GatheringItems/InstanceDropItemManager.cs
Outdated
Show resolved
Hide resolved
Arrowgene.Ddon.Shared/AssetReader/EnemySpawnAssetDeserializer.cs
Outdated
Show resolved
Hide resolved
Maybe I'm confused over the structure of the assets here. I'll probably have to go back to the drawing board and fix this, but these are my issues/confusions.
|
I also realize now that I was pushing to the wrong repository, but I don't want to remove the conversation here by closing this PR prematurely. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this fixes issues, or makes things clearer, but i'll let others be the judge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future the position index will be something we could set explicitly, i don't think it should be removed from here (#463)
} | ||
|
||
public List<T3> GetAssets(CDataStageLayoutId stageLayoutId, T1 subGroupId) | ||
public TAssetItem GetAssets(CDataStageLayoutId stageLayoutId, int subId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you rename subgroup to sub?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it need not be a sub-group? The second argument denotes one TAssetItem
, which may be a group of smaller objects, but not necessarily. I suppose we can argue the semantics of "ID within/sub the group that is identified by the stageLayoutId
", but I specifically don't want this to be confused with spawn subgroups as the client requests them, because that's not how InstanceAssetManager
should be structured.
It shouldn't be structured around spawn subgroups because even though the client requests enemy lists in that fashion, that's not how any other enemy-related data structure thinks about enemies (or anything else that might be instanced, and these all share an interface so they should think about similar data structures). In every other context, it thinks about them as a stageLayoutId and an index, which we variously call setId
, PositionIndex
, and PosId
.
Once the enemy is dead and we need its loot, we only have access to its stageLayoutId and that index, not what subgroup it came from. Gathering items are also not structured in subgroups. So it seems silly to me to organize the instanceAssetManager
around subgroups when you can just do the filtering at the one point that actually does care about subgroups:
var instancedEnemyList = client.Party.InstanceEnemyManager.GetAssets(stageId).Where(x => x.Subgroup == subGroupId);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point, yeah, we should write down this reasoning somewhere, could you add an explanation to the comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imagine we will revisit again but I can't find anything that sticks out at the moment.
f681006
to
be636e6
Compare
The arguments for various InstanceAssetManager functions were ambiguous as to whether they were using subgroupId or positionId. Some of this has to do with differing data structures; for enemies, each spot (combination of stage layout ID and index) represents a single enemy. For items (both drops and gathering spots), each spot represents a list of potential items. Untangling this is a headache, so for now this fix should let things drop as they should, regardless of what subgroup they fall on, provided that subgroups never overlap in positionId.
Checklist:
develop
branch