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

ClipWinding: MAX_POINTS_ON_WINDING with moteof map but ioquake3 loads it well #169

Open
illwieckz opened this issue Feb 26, 2019 · 5 comments
Labels

Comments

@illwieckz
Copy link
Member

@illwieckz illwieckz commented Feb 26, 2019

Both ioquake3🗗 and daemon defines MAX_POINTS_ON_WINDING to 64:

#define MAX_POINTS_ON_WINDING 64

But while ioquake3 loads “The Edge of Forever” with that setting, dæmon requires this value to be set to 134.

If this value is less or equal to 133, this message is printed on console and the map loading aborts:

Warn: ClipWinding: MAX_POINTS_ON_WINDING 

There is no reason this map can't be loaded with a max set to 64.

On a side note, because the problem aborts the map loading, this problem must be raised as an error instead of a warning.

How to reproduce

Download map here (it's just a dpk repack of the original pk3 for quake3), load it with +devmap moteof.

@illwieckz

This comment has been minimized.

Copy link
Member Author

@illwieckz illwieckz commented Feb 27, 2019

For some unknown reason, ioquake3 has these functions in cm_polylib.c but dæmon does not have them in cm_polylib.cpp:

RemoveColinearPoints
WindingPlane
WindingArea
WindingCenter
WindingOnPlaneSide
ReverseWinding
ClipWindingEpsilon
AddWindingToConvexHull

See:

@illwieckz

This comment has been minimized.

Copy link
Member Author

@illwieckz illwieckz commented Mar 22, 2019

The functions that are in ioquake3 but not in dæmon were removed in f9d69b9 because being unused.

Some are are dead code in ioquake3 too:

RemoveColinearPoints
WindingCenter
WindingOnPlaneSide
ReverseWinding
ClipWindingEpsilon
AddWindingToConvexHull

But ioquake3 still uses those:

WindingPlane
WindingArea
@illwieckz

This comment has been minimized.

Copy link
Member Author

@illwieckz illwieckz commented Nov 30, 2019

I really have no idea about how to debug this…

The ChopWindingInPlace function does exactly the same on both engines.

@illwieckz

This comment has been minimized.

Copy link
Member Author

@illwieckz illwieckz commented Dec 2, 2019

On a side note, in the past it was an error, not a warning, and it was displayed to the user, see screenshots from Unvanquished 0.35 and Unvanquished 0.17:

max points on winding

max points on winding

It's better to tell the user a cryptic error than just failing silently without notice.

The code that must display such error (instead of a warning printed in console) is:

	if ( f->numpoints > MAX_POINTS_ON_WINDING )
	{
		Sys::Drop( "ClipWinding: MAX_POINTS_ON_WINDING" );
	}

in src/common/cm/cm_polylib.cpp.

@illwieckz

This comment has been minimized.

Copy link
Member Author

@illwieckz illwieckz commented Dec 2, 2019

Unvanquished 0.6.0, the oldest release I have, already raises ClipWinding: MAX_POINTS_ON_WINDING on this map while Tremulous does not (neither XreaL prealpha 20080704).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.