Page 1 of 2

[4.5.0] - AirControl does not work on DefaultMap

Posted: Sun Dec 13, 2020 8:35 pm
by SanyaWaffles
It appears DefaultMap properties do not respect AirControl for some reason. I have to define it per map instead.

Re: [4.5.0] - AirControl does not work on DefaultMap

Posted: Mon Dec 14, 2020 10:56 pm
by Major Cooke
Can confirm. This has been a bug for a long time actually, it would appear. I just keep forgetting to report it.

Re: [4.5.0] - AirControl does not work on DefaultMap

Posted: Mon Dec 14, 2020 11:00 pm
by SanyaWaffles
For me this is difficult because I'm working on a project with a bunch of other people where we need the aircontrol to be defined by default, and I don't know the names of the maps yet.

Re: [4.5.0] - AirControl does not work on DefaultMap

Posted: Wed Dec 16, 2020 8:56 am
by Blue Shadow
Do you have something that can be tested?

I couldn't reproduce it on my end. I tested it with the following, and I can control the player's movement in the air while falling in Doom 2's MAP24:

Code: Select all

defaultmap
{
    aircontrol = 3
}

map MAP24 lookup "HUSTR_24"
{
    titlepatch = "CWILV23"
    next = "MAP25"
    secretnext = "MAP25"
    sky1 = "SKY3"
    cluster = 8
    par = 150
    music = "$MUSIC_THEDA3"
} 

Re: [4.5.0] - AirControl does not work on DefaultMap

Posted: Wed Dec 16, 2020 10:14 am
by Major Cooke
Try it with just this instead:

Code: Select all

defaultmap
{
    aircontrol = 3
}
And nothing else.

Re: [4.5.0] - AirControl does not work on DefaultMap

Posted: Wed Dec 16, 2020 10:56 am
by Blue Shadow
That's not how the defaultmap block is to be used:
ZDoom Wiki wrote:defaultmap { properties }

Sets the defaults that will be automatically used for all subsequent map definitions. It resets the default information so anything specified in previous defaultmap sections is lost.

Re: [4.5.0] - AirControl does not work on DefaultMap

Posted: Wed Dec 16, 2020 5:10 pm
by SanyaWaffles
that's how I use it though and it doesn't work as intended with aircontrol - defining it before. I'm using includes and a standalone IPK3 if that helps anything.

It also doesn't work with adddefaultmap.

https://www.dropbox.com/s/u3gxxnuwbygpp ... .ipk3?dl=1

It becomes apparent with this build of SHDX which has an aircontrol in defaultmap but not in the subsequent definitions.

Re: [4.5.0] - AirControl does not work on DefaultMap

Posted: Wed Dec 16, 2020 7:52 pm
by Rachael
Are there any other properties which break in a similar fashion, that you know about? I am looking at the code here (in GZDoom) and I cannot find the exact cause of this, but I am seeing a lot of conditionals which either change or involve the variable it gets saved to after it is read from mapinfo.

I think what is also notable is the following actions will affect Level->aircontrol directly, so it's possible one of these could be tripping up the system:
  • Any possible SetAirControl() ACS calls
  • Any changes to sv_aircontrol cvar
  • Changing Level.aircontrol directly using ZScript
  • Loading/saving a game (possibly even hub transitions)

Re: [4.5.0] - AirControl does not work on DefaultMap

Posted: Wed Dec 16, 2020 9:20 pm
by SanyaWaffles
As far as I know, none are being manipulated. I don't call level.aircontrol or use SetAirControl() or any of the sort directly in SHDX's code, and I recall it being an issue early on.

I'm not using any other mapinfo properties that seem to break.

I'm not really sure what's going on here, me and the dev team have been scratching our heads.

The only thing I can think of is it's related to another bug that Nash and I discovered, but I haven't been able to make a minimal example of because it requires an IWAD/IPK3 involving CVARDEFS. Basically alot of CVARs don't seem to be set by default when you use them (like disabiling texture filtering doesn't work for me).

I dunno, that's all I got.

Re: [4.5.0] - AirControl does not work on DefaultMap

Posted: Wed Dec 16, 2020 9:46 pm
by Arctangent
Do other properties break when put in this specific defaultmap?

Because if this is in a separate MAPINFO than the actual map definitions, I could imagine this being a load order thing where this defaultmap entry is being processed after all the map entries.

Re: [4.5.0] - AirControl does not work on DefaultMap

Posted: Wed Dec 16, 2020 10:25 pm
by SanyaWaffles
Actually, now that I notice it, UsePlayerStartZ isn't carried over either. One of the later maps had at one point a higher start position.

However, others work fine, like Exitpic and Enterpic.

I don't know if Gravity works or not...

As I said, I do use include directives.

The actual ZMAPINFO is this:

Code: Select all

include "mapinfo/gi.txt"

include "mapinfo/damage.txt"

include "mapinfo/doomednum.txt"

include "mapinfo/spawnid.txt"

include "mapinfo/defaultmap.txt"

include "mapinfo/episodes.txt"

include "mapinfo/skills.txt"

include "mapinfo/cluster.txt"

include "mapinfo/titlemap.txt"

include "mapinfo/maps.txt"

include "mapinfo/intro.txt"

include "mapinfo/end_ep1.txt"

include "mapinfo/end_ep2.txt"

include "mapinfo/preboss3.txt"

include "mapinfo/end_ep3a.txt"

include "mapinfo/end_ep3b.txt"
And the defaultmap block in "mapinfo/defaultmap.txt"

Code: Select all

defaultmap
{
	Cluster = 1
	
	// Time
	Par = 70
	SuckTime = 0	// We don't need no stinkin SuckTime

	// Physics...
	AirControl = 0.6
	Gravity = 768
	
	Sky1 = "SKY1"
	
	Music = ""
	
	ExitPic = "INTERPIC"
	EnterPic = "INTERPIC"
	
	// Lightning/Appearance of Level
	SmoothLighting
	ClipMidTextures
	
	UsePlayerStartZ

	// Player Properties
	AllowJump
	AllowCrouch
	AllowFreelook
	AirSupply = 0

	// Monster/Activation Properties
	LaxMonsterActivation
	MissilesActivateImpactLines
	
	// OpenGL Only Options (GZDoom)
	PixelRatio = 1.0	// 1.2 is Mode X (320x200 streched vertically to 320x240)
	/* *************************
	0 (Standard): bright lighting model and stronger fading in bright sectors.
	1 (Bright): bright lighting model and weaker fading in bright sectors.
	2 (Doom): dark lighting model and weaker fading in bright sectors but brightness nearby (req. GLSL)
	3 (Dark): dark lighting model and weaker fading in bright sectors.
	4 (Legacy): Emulates lighting of Legacy 1.4's GL renderer.
	8 (Software): Emulates Doom software lighting, Requires GLSL 1.30 or greater (OpenGL 3.0+).
	************************* */
	LightMode = 0
}

Re: [4.5.0] - AirControl does not work on DefaultMap

Posted: Wed Dec 16, 2020 10:46 pm
by Rachael
If this is what I think it is - then there is definitely a bug here, but it's not exactly what we originally thought it was. Try moving the defaultmap block to the base zmapinfo.txt at the top of the file - if that works, then there's definitely an issue with include order parsing. Also, try fudging around with the include order too - put it both before and after your map includes.

Re: [4.5.0] - AirControl does not work on DefaultMap

Posted: Wed Dec 16, 2020 10:54 pm
by SanyaWaffles
Moving it into the same file (in this case, mapinfo/maps.txt) fixed it. Definitely a load order issue.

Moving it to the beginning of ZMAPINFO.txt did not fix it and exhibited the same problem as before.

Re: [4.5.0] - AirControl does not work on DefaultMap

Posted: Wed Dec 16, 2020 11:07 pm
by Rachael
Okay, thanks.

From what you said here, it actually seems it's not a load order issue, so I may have been wrong about that. Seems like the defaultmap block gets cleared on every include.

Re: [4.5.0] - AirControl does not work on DefaultMap

Posted: Wed Dec 16, 2020 11:18 pm
by SanyaWaffles
now that I actually have gotten a chance to play with the workaround, it seems everything in the defaultmap block is cleared as you said. Including the pixel ratio settings.

With the workaround everything is at the 1.0 pixel ratio, bnefore it was stretched.

So nothing was working.

I suppose this is just how Defaultmap is by design then?

Seems kind of bad for organization IMO, I prefer to keep things neat.

This way works, but I'll need to adjust it for all projects. Not a big deal, but I wonder how many projects were affected by this.