What's the purpose of menu_patch files?

General discussion and help regarding JK2MV.
Post Reply
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

What's the purpose of menu_patch files?

Post by fau »

They can only patch the original .menu files anyway and the format is completely rigid.
I started reading through code and I see you used MV_UI_PATCHMENU approach earlier, but I think any automatic 3-way merge will fail eventually.

As I understand, there is no way to achieve both jk2mp.exe and jk2mv.exe compatibility when creating custom .menu files now, right?

edit: Also messages are kinda confusing. I wrote createserver.menu badly so it didn't work as intended, read "patching menu file ui/jk2mp/createserver.menu... patching skipped: hash mismatch" in the jk2mv log and went into half an hour debugging session :/
Last edited by fau on 22 Dec 2015, 15:14, edited 1 time in total.
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: What's the purpose of menu_patch files?

Post by Tr!Force »

i think because they cant release an existing modified UI menus due legal reasons (no one can "share" jk2 assets), is the reason why they patch over the real ones.
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: What's the purpose of menu_patch files?

Post by fau »

This went through my mind too, but seriously, nobody could release mods with modified menus then (they are not part of sdk)! Is that correct?
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: What's the purpose of menu_patch files?

Post by Tr!Force »

fau wrote:This went through my mind too, but seriously, nobody could release mods with modified menus then (they are not part of sdk)! Is that correct?
there are a lot of mods using they custom menus, but jk2mv release is under opensource (GPLv2). the old single (code,skins, etc) mods (like those on jk2files) arent opensource, i think is related with that. i dont know really.

i proposed fix the 2D rendering streched on jk2mv but i got rejected because thats include menu editing... so they said: we cant support menu modifications because "legal reasons"...
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: What's the purpose of menu_patch files?

Post by Daggolin »

Technically SDK mods can't do that either. But as the readmes in the SDK talk about extracting skins from the assets, modifying them and uploading them somewhere else people consider that modded assets as intended by raven.
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: What's the purpose of menu_patch files?

Post by fau »

How about letting .menu_patch files from outside of mvassets.pk3? I may get a little paranoid too.

The best solution would be rewritting/redesigning whole menus from scratch specifically for jk2mv with all the bells and whistsles, and let ppl switch to old menus if they wish. I'm not going to do that though :P

EDIT: Also jk2mv's "patching" is technically "reverse engineering" menu files which is prohibited as well :D
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: What's the purpose of menu_patch files?

Post by Tr!Force »

fau wrote:How about letting .menu_patch files from outside of mvassets.pk3? I may get a little paranoid too.

The best solution would be rewritting/redesigning whole menus from scratch specifically for jk2mv with all the bells and whistsles, and let ppl switch to old menus if they wish. I'm not going to do that though :P
+1
fau wrote: EDIT: Also jk2mv's "patching" is technically "reverse engineering" menu files which is prohibited as well :D
true :lol: so they said "All kind of mods which "hack" themselves into the engine can't be supported" :lol: :lol: :lol:
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
ouned
Administrator
Posts: 596
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: What's the purpose of menu_patch files?

Post by ouned »

You just hit a sensible point of mine. :lol:

It's basically a compromise me and Daggolin had before the release because of the legal reasons.
My position was to just ship the modified files since noone will ever care.
But Daggolin refused and I didn't want to work on JK2MV alone so I decided to make an own patchfile system for this purpose^^
Existing systems always contain parts of the original file which is why I made this weird own one.

menupatches are disabled from outside of assetsmv.pk3 because you can easily crash the game with "not perfect" patchfiles.
e.g. syntax errors etc.
Like I said, I wrote it myself and didn't spend too much time into it.

If I knew beforehand that I'm the one doing 90% of the work for JK2MV anyway, I most likely wouldn't have done it that way.

Your custom menu files should load though. If it detects a mismatch it means it trys to load yours but doesn't apply JK2MV's menu content because it can't safely do it.

tl;dr: I don't even like them myself, they are shitty and useless.
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: What's the purpose of menu_patch files?

Post by fau »

Your custom menu files should load though. If it detects a mismatch it means it trys to load yours but doesn't apply JK2MV's menu content because it can't safely do it.
Yeah, I realised that during that debugging session, thanks :P Maybe you could hide these hash mismatch messages from release build? It looked to me as if it was mine .menu file being rejected, even if it makes sense now.

Another, similar question. I'm in the process of adding a gametype and everything goes well until this little detail: on the createserver menu, ui module parses .arena files and matches gametype strings like "ffa", "ctf" in order to determine what maps are available for my gametype. Using strings rather than gametype numbers looks like pretty unfortunate choice to me, because you can't override them without changing the ui code. Even if you do, it won't work in the main menu of jk2mv.

I guess you were going to release the ui API (ie let jk2mv load external ui module in the main menu) with mvsdk? Version checking seems to be in place for doing it now, although the menu code isn't compatible with jk2mp.exe but this can be easily fixed.

I still think that adding a gametype shouldn't require modifying ui code (apis change and as history shows, unmaintained mods stay popular for years). Current architecture encourages replacing, rather than adding gametypes. How about adding backwards-compatible .arena format with numbers instead of strings? Or/and some sort of gametype "redirection" like in UI_MapCountByGameType, but defined in ui/jk2mp/gameinfo.txt? I can write a patch, but I'd rather ask first as I only had a quick glimpse of all these.

And finally, would you rather have such discussions here or on github issue tracker?
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: What's the purpose of menu_patch files?

Post by fau »

On second thought, there is quite a bit of gametype customization in the ui module anyway. Let's just hope that mv api doesn't change too often.
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: What's the purpose of menu_patch files?

Post by Tr!Force »

i have converted the GT_SAGA (the N/A) into "Hold The Point" gametype, and the GT_SINGLEPLAYER in a usable gametype for "Co-Op", so i had to edit the ui code to get .arena files read properly. (not the engine, just the game,cgame & ui)
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
ouned
Administrator
Posts: 596
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: What's the purpose of menu_patch files?

Post by ouned »

fau wrote:I guess you were going to release the ui API (ie let jk2mv load external ui module in the main menu) with mvsdk?
not really. the main menu module must be forced because a mod could easily bypass the download popup if it wouldn't be that way.
That's the only part of jk2mv which is incompatible with basejk. We really can't change that.
You can always use modified ui modules ingame though.
fau wrote:I still think that adding a gametype shouldn't require modifying ui code (apis change and as history shows, unmaintained mods stay popular for years). Current architecture encourages replacing, rather than adding gametypes. How about adding backwards-compatible .arena format with numbers instead of strings? Or/and some sort of gametype "redirection" like in UI_MapCountByGameType, but defined in ui/jk2mp/gameinfo.txt? I can write a patch, but I'd rather ask first as I only had a quick glimpse of all these.
Sounds nice. But I have no idea how this works currently.
But If you add something like this it has to be compatible with the current implementation.
fau wrote:On second thought, there is quite a bit of gametype customization in the ui module anyway. Let's just hope that mv api doesn't change too often.
The api is designed to guarantee backwards compatibility.

Code: Select all

MV_APILEVEL defines the API-Level you are working with. MV_MIN_VERSION is the minimum required JK2MV version which implements this API-Level. All future ( >= MV_MIN_VERSION ) JK2MV versions are guaranteed to implement this API-Level.
https://github.com/mvdevs/jk2mv/wiki/API-Overview
Post Reply
Created by Matti from StylesFactory.pl and Warlords of Draenor (modified by jk2.info)
Powered by phpBB® Forum Software © phpBB Limited
 

 

cron