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

GLA Terrorist is stuck when ordered to attack into the bounding box of a structure #26

Open
xezon opened this issue Aug 24, 2021 · 8 comments
Labels
Bug Something is not working right Major Severity: Minor < Major < Critical < Blocker NProject Issue has been addressed in NProject Mod

Comments

@xezon
Copy link
Collaborator

xezon commented Aug 24, 2021

Sometimes GLA Terrorist does not attack after given instructions. Happens regularly when targeting terrain close to buildings. Terrorist will walk in place and does not suicide.

Issue can be reproduced by force firing Command Center at this position:

shot_20210824_111248_1

Related Terrorist issues:

@xezon
Copy link
Collaborator Author

xezon commented Sep 13, 2021

Issue might be related to geometry size of buildings. If collision box is larger than the visual presentation of the model and user tries to attack too far inside the geometry bounding box, then infantry unit might not be able to move there.

According to Enlima29, NProject does tweak geometry sizes of buildings and units (accurately). We could look into that.

@xezon
Copy link
Collaborator Author

xezon commented Jul 17, 2022

It is definitely caused by the Geometry as per INI Object definition.

Tested with Object GLACommandCenter:

GLACommandCenter Original

  GeometryMajorRadius = 65.0
  GeometryMinorRadius = 65.0

Issue is reproducible.

GLACommandCenter Test 1

  GeometryMajorRadius = 50.0
  GeometryMinorRadius = 50.0

Issue is still reproducible, but you have to force fire VERY close to the building, making the bug no big deal.

GLACommandCenter Test 2

  GeometryMajorRadius = 80.0
  GeometryMinorRadius = 80.0

Issue becomes very easy to reproduce. Terrorist will get stuck within a very generous margin of the structure.

Conclusion

To mitigate this issue as best as possible, Geometry size needs to be perfectly aligned with the mesh size. I assume GeometryMajorRadius is X and GeometryMinorRadius is Y or vice versa.

@xezon
Copy link
Collaborator Author

xezon commented Jul 17, 2022

To measure structure sizes, it would be nice to have a test map with a giant grid

@xezon
Copy link
Collaborator Author

xezon commented Jul 17, 2022

Enlima29:
many buildings are not centered correctly

airfieldcenter

@xezon
Copy link
Collaborator Author

xezon commented Jul 17, 2022

Ctrl+W = Show Wireframe
Alt+6 = Show Bounding Box

1 terrain tile corresponds to 5 length units that Geometry is specified in. This means we can use Wireframe or Terrain tiles to reliably measure structure sizes. In this Airfield sample, GeometryMajorRadius is 83, and tiles are 16.6 (16.6*5 = 83).

airfieldbbox

@xezon
Copy link
Collaborator Author

xezon commented Jul 17, 2022

Enlima29:

[Fixing W3D model centering] involves manual model reexporting because unlike newer sage engine (like bfme) zh sage don't have geometry offset parameters that allows you to adjust the hitbox center position without manually editing the model itself. Which is why I cried blood when fixing all these off-centered civilian buildings.
https://www.moddb.com/mods/nproject-mod/images/fixed-building-collisions

I usually use 3dsmax for object size measuring, because they use the same unit as the game's geometry size unit. It is much [more] reliable this way because of the aforementioned reason where many models are actually off-centered.

@xezon xezon changed the title GLA Terrorist is stuck when ordered to attack into then bounding box of a structure GLA Terrorist is stuck when ordered to attack into the bounding box of a structure Jul 18, 2022
@xezon
Copy link
Collaborator Author

xezon commented Jul 18, 2022

Use models from NProject as a base before applying recenter fixes, as they already contain other fixes too.

@xezon xezon added the NProject Issue has been addressed in NProject Mod label Jul 18, 2022
@xezon
Copy link
Collaborator Author

xezon commented Jul 18, 2022

Gmax setup for W3D editing:
http://www.cnclabs.com/forums/cnc_postst16946_Generals-Modding-Resource.aspx

Enlima29:

Basically turbosquid's gmax is a discounted/fork version of Autodesk 3ds Max. It is what EA team used when developing renegade/generals/zh using their own renx plugin (not to be confused with the RenegadeX the indie game) to be able to rig Westwood 3D file (aka W3D) for the SAGE engine.

Later on EA team were using 3dsmax7 when developing Lord of The Rings: Battle For Middle Earth, which is why they are releasing the BFME2 Mod SDK plugin to work with widely used 3dsmax back then, which also works for ZH models because they are essentially the same engine your choice if you want to use the gmax or 3dsmax one, just make sure to use the corresponding plugin.

Zeke:

3dsmax handles better than Gmax and it can actuallt make renders. The optimal max version is 8 though not 7, because the UVW unwrapper is much better in 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working right Major Severity: Minor < Major < Critical < Blocker NProject Issue has been addressed in NProject Mod
Projects
None yet
Development

No branches or pull requests

1 participant