[Fixed] Gravity must not be negative

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Gravity must not be negative

Postby Player701 » Thu Oct 15, 2020 3:43 pm

Attempting to set the Gravity actor property to a negative value results in a script error. The error message claims that gravity must not be negative; however, setting the Gravity field to a negative value in ZScript code works just fine: GZDoom doesn't crash or abort, and actors with negative gravity get pulled to the ceiling instead of the floor, as expected. Should this error message really be there?

BTW, certain special effects (like rising smoke) appear to look MUCH better if you give them negative gravity instead of just setting a constant upwards velocity for them. I'd love to use it in my mod, unless the current behavior is not officially defined and might break in later versions.
User avatar
Player701
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Gravity must not be negative

Postby Major Cooke » Thu Oct 15, 2020 4:36 pm

It would be nice to support actors that are inverted with gravity I must say.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: Gravity must not be negative

Postby Arctangent » Thu Oct 15, 2020 9:18 pm

I'd imagine the warning is because the effects of negative gravity are incidental, not intentionally defined. If you're using it for graphical effects that are spawned airborne, then you're not likely to notice it, but:

  • Gravity isn't applied to actors that are on the ground, period. So, an imp with negative gravity will not only still stick to the ground as it walks around, it's unlikely to ever actually rise unless it's blasted off a cliff by an external force.
  • Touching the ceiling with negative gravity doesn't count as being grounded. Monsters end up becoming immobilized and players don't fare much better unless you jack their aircontrol way up.
  • The only way to actually descend without some sort of scripted jump or jetpack or something is through ceiling "lifts." You can't go down ceiling slopes nor upside-down stairs. If you're on the ceiling, a difference of even just 0.1 mapunits is insurmountable.
  • Scrolling ceilings don't have any functionality for carrying things that touch them, unlike scrolling floors. This goes for a lot of thing, really - there's no such thing as a "hurtceiling," despite hurtfloors being pretty iconic in idtech1 games.

So, yeah. There's a lot of interactions that could change across versions should negative gravity one day be properly supported, meaning using it now could result in parts of your mod behaving noticeably different later on.
User avatar
Arctangent
squawky
 
Joined: 06 Nov 2014
Discord: SquawkyAtan#2371

Re: Gravity must not be negative

Postby Major Cooke » Thu Oct 15, 2020 9:26 pm

Yeah. Hence, It'd be neat to have support for it. All that good stuff could be useful for adding more unique gameplay mechanics such as walking on ceilings with gravity boots.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: Gravity must not be negative

Postby Player701 » Thu Oct 15, 2020 11:11 pm

I only wanted to use negative gravity for special effects, not for players or monsters. However, since the mechanics might change in later versions, I guess I'll refrain from that for now.

All this still doesn't change the fact that GZDoom doesn't let you set the Gravity property to a negative value even though you can circumvent this restriction by setting the value of the corresponding backing field instead (e.g. in BeginPlay). Considering that, and also what's been said here, I think that the error message should be changed to a warning instead.
User avatar
Player701
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Gravity must not be negative

Postby Graf Zahl » Sat Oct 17, 2020 1:11 am

Ok then...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest