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

g_gravity resets on map change. #202

Closed
Kr3m opened this issue Jan 21, 2023 · 26 comments
Closed

g_gravity resets on map change. #202

Kr3m opened this issue Jan 21, 2023 · 26 comments

Comments

@Kr3m
Copy link

Kr3m commented Jan 21, 2023

This has got to be one of the oldest bugs in the game, but if you set g_gravity to anything but the default, it resets on map change. While there are workarounds, these workarounds don't work in mods that use mappools unless you don't use the mappool features e.g. in OSP since they require you to set gravity on each map in your map rotation.

@ensiform
Copy link
Contributor

ensiform commented Jan 21, 2023

Not an engine bug, it's a design feature in the server side mod code.

It is set by the worldspawn code when it checks for gravity key existing, and overrides the cvar even if it's default in g_spawn.c

https://github.com/ec-/baseq3a/blob/master/code/game/g_spawn.c#L570-L571

@Kr3m
Copy link
Author

Kr3m commented Jan 21, 2023

Not an engine bug, it's a design feature in the server side mod code.

It is set by the worldspawn code when it checks for gravity key existing, and overrides the cvar even if it's default in g_spawn.c

https://github.com/ec-/baseq3a/blob/master/code/game/g_spawn.c#L570-L571

How does that by definition not make it a bug rather than a feature? Shouldn't g_gravity be read-only if it's not meant to be overriden? It certainly makes server setup less flexible.

@The-Gig
Copy link

The-Gig commented Jan 21, 2023

Maybe at idsoftware they thought that losing the custom gravity on a map restart was better than risking to end up bringing the old custom gravity to a new map which could end up making it unplayable? Or maybe they just didn't care.
Afaik, the only workaround is using some mod which has got its own workaround. As example, OpenArena introduced g_gravitymodifier (default 1.0) as an alternative to tweaking g_gravity.

@Kr3m
Copy link
Author

Kr3m commented Jan 21, 2023

Maybe at idsoftware they thought that losing the custom gravity on a map restart was better than risking to end up bringing the old custom gravity to a new map which could end up making it unplayable? Or maybe they just didn't care. Afaik, the only workaround is using some mod which has got its own workaround. As example, OpenArena introduced g_gravitymodifier (default 1.0) as an alternative to tweaking g_gravity.

I just added a couple of custom pk3s I created to the mods we use and it seems to be working. Thanks for your help. :)

@ensiform
Copy link
Contributor

Not an engine bug, it's a design feature in the server side mod code.
It is set by the worldspawn code when it checks for gravity key existing, and overrides the cvar even if it's default in g_spawn.c
https://github.com/ec-/baseq3a/blob/master/code/game/g_spawn.c#L570-L571

How does that by definition not make it a bug rather than a feature? Shouldn't g_gravity be read-only if it's not meant to be overriden? It certainly makes server setup less flexible.

It is a feature of the gamecode portion, it is irrelevant of which engine is used. Fix it in ec-/baseq3a perhaps but you will not "fix" it in Quake3e or other engine without nasty workarounds. They obviously wished it to remain default on load so that switching from low gravity maps would not retain it that way on purpose.

@Kr3m
Copy link
Author

Kr3m commented Jan 21, 2023

Not an engine bug, it's a design feature in the server side mod code.
It is set by the worldspawn code when it checks for gravity key existing, and overrides the cvar even if it's default in g_spawn.c
https://github.com/ec-/baseq3a/blob/master/code/game/g_spawn.c#L570-L571

How does that by definition not make it a bug rather than a feature? Shouldn't g_gravity be read-only if it's not meant to be overriden? It certainly makes server setup less flexible.

It is a feature of the gamecode portion, it is irrelevant of which engine is used. Fix it in ec-/baseq3a perhaps but you will not "fix" it in Quake3e or other engine without nasty workarounds. They obviously wished it to remain default on load so that switching from low gravity maps would not retain it that way on purpose.

Unfortunately, my fix did not work. I need to get the original source code for one of the mods, and I'm just going to assume that isn't happening with the other one since it's OSP.

@Kr3m
Copy link
Author

Kr3m commented Jan 21, 2023

g_gravity is fixed, but everything else is broken lol.

@ensiform
Copy link
Contributor

Well of course, it is a change that requires game.qvm be updated. If you wish to use OSP mod then you are SOL. Must be a mod with which the source code is available.

@Kr3m
Copy link
Author

Kr3m commented Jan 21, 2023

Well of course, it is a change that requires game.qvm be updated. If you wish to use OSP mod then you are SOL. Must be a mod with which the source code is available.

Which sucks. I'm trying to get the community to migrate to OSP Freeze Tag instead of the Freeze Tag mod we've been using, but without being able to set g_gravity to 700, I'm dead in the water. I can't even set this using a static map rotation in OSP for some reason like I can with our current mod. I could probably get the source code for our current mod once one of the members returns a message, but that doesn't really help at all. Just means we'll be able to remove g_gravity from the rotation file. Ugh.

@The-Gig
Copy link

The-Gig commented Jan 21, 2023

I think years ago I read about the existence of a qvm decompiler, but I don't know how well it works and how much legal it is, nor where to find it.
An alternative for you could be using customized maps, with tweaked gravity in worldspawn entity... You can learn the entities-only editing trick: https://openarena.fandom.com/wiki/Entities-only_editing
But pay attention to do not spread your custom versions of the maps around the internet with the same names!!!!

@ensiform
Copy link
Contributor

I mean are there no other mods with freezetag?

@Kr3m
Copy link
Author

Kr3m commented Jan 21, 2023

I mean are there no other mods with freezetag?

Not that have the features I want. There are plenty of freezetag mods.

@Kr3m
Copy link
Author

Kr3m commented Jan 21, 2023

Oh I might be able to make this happen with both OSP and the Freeze Tag mod we're using. It seems there is no game.qvm in either mod so it must be using the baseq3 game.qvm so if I only put that one file in the vm file in the pk3, it should work I hope...

@ensiform
Copy link
Contributor

ensiform commented Jan 21, 2023

It definitely is using a dll/so or qvm. Osp is mostly server side.

The VM folder contains the qvm in the full install

@Kr3m
Copy link
Author

Kr3m commented Jan 21, 2023

It definitely is using a dll/so or qvm. Osp is mostly server side

It's using qagame.qvm

@ensiform
Copy link
Contributor

It definitely is using a dll/so or qvm. Osp is mostly server side

It's using qagame.qvm

Same damn thing.

@Kr3m
Copy link
Author

Kr3m commented Jan 21, 2023

It definitely is using a dll/so or qvm. Osp is mostly server side

It's using qagame.qvm

Same damn thing.

I don't think that setting is in qagame.qvm. I can't override it anyway though, because there's another qvm file in one of the pk3s. I mean I can override it, but I won't be able to connect without the game crashing and a lot of other issues. Server will be up with custom gravity, but not playable. Trying to find a workaround, but probably not going to happen.

@ensiform
Copy link
Contributor

Forget trying to override any qvm files for mods you do not have the source code for.

This is a non starter. Nothing for you to replace. If you replace qvm with something else, you're no longer running the mod that you intend (OSP). It's all or nothing unfortunately.

@Kr3m
Copy link
Author

Kr3m commented Jan 21, 2023

So it looks like my option are to create a new freeze mod from scratch, get the source code for our current freeze mod and port the OSP functionality that I want into that, or hope the OSP author still checks his email and is willing to make this change for me. None of those options sound too great over such a trivial setting that my community happens to like. Ugh.

@ensiform
Copy link
Contributor

OSP has been dead for years at this point so that is out of the question afaik. Why exactly can't you just put the setting in map configs for each map or in the rotation?

@Kr3m
Copy link
Author

Kr3m commented Jan 21, 2023

I can with our current freeze mod, but utilizing the exact same rotation config in OSP while disabling using the map pool doesn't seem to work. I've also tried using configmap q3dm1 00 16 dt_gravity.cfg to set it in the map pool file, but setting g_gravity 700 in dt_gravity.cfg doesn't seem to work either.

@ensiform
Copy link
Contributor

You might be able to achieve something by using https://github.com/thecybermind/qmm but it will require compiling also, and may degrade qvm improvements in the engine itself.

@Kr3m
Copy link
Author

Kr3m commented Jan 21, 2023

You might be able to achieve something by using https://github.com/thecybermind/qmm but it will require compiling also, and may degrade qvm improvements in the engine itself.

I'd have to revert to the x86 server, but that could work. Thanks. I'll try it out.

@ensiform
Copy link
Contributor

Well yes, but I guess it could be made to compile for x64 server. Though that requires coding experience.

@Kr3m
Copy link
Author

Kr3m commented Jan 22, 2023

Well yes, but I guess it could be made to compile for x64 server. Though that requires coding experience.

Requires a bit of time also which I'm a bit short of at the moment. I'll probably fork it and port it to x64 at some point, but between work, running a gaming community, competing in a tournament, and adult responsibilities, time is not on my side. I'd rather test it first and make sure it works anyway since porting it would be a waste of time otherwise.

@Kr3m
Copy link
Author

Kr3m commented Jan 22, 2023

Okay well I figured it out and got it working. Not exactly the way I wanted to get it working, but meh.

@ec- ec- closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants