Jump to content

Adjusting sv_init.cpp


Go to solution Solved by Circa,

Recommended Posts

Hi guys.

So, since i ported the Battlefront 2 model of Boba in other games some time ago, and i was replaying jedi academy lately, i thought, "Hey why not". I mean there are a lot of cool versions of him around, but i guess i've got too fond of this one. Problem is glm import export and jedi academy game system are *really* a pain in the arse. Aside all the restrictions of the exporter, not more than 1000 vertices per part, not more than 4 vertices rigged per bone... But even then, and even if i optimized a lot, than in game i've got the crash with too much glm2 transorm ecc. And it says i should 'adjust' the gl2_mine_heap size on sv_init.cpp.

So, could someone tell me where is this file stored and how edit that value?

If i can fix it i would release it as mod too, if site allowes, but i can't optimize the model more than i did, or it gets too ruined.

Link to comment

lf you wanted to do that you would need to make a fork of openjk, edit the code and compile a new .exe for the game to do that.

Are you testing the model in multiplayer or Singleplayer? The limit is higher in Multiplayer.

Are you using OpenJK already?

OpenJK Sp has lifted the limit to match the Multiplayer limits.

If you are already using openJk, I would still suggest a more sensible route than adjusting the game code to up the limit.

This alternative solution would be to add at least one, better two, LODs to your model. An LOD is a lower detail variant of a model that is used at Higher distances and also used for collision detection when available. The error you are encountering is related to collision detection for glm models.

If you add two LODs and make sure that the second LOD sits at 25% of the vertcount of the original you should be good.

Link to comment
  • Solution

In simpler terms, you have to edit the source code to raise such limits. OpenJK and its various forks already raise them a decent amount.

Also like you said, there are a lot of Boba models out there that look really good already. Verts and polys will only get you so far before you need to also have a modern renderer to make it look worth using. There's a reason modelers still optimize their high res models to work in JKA properly. They still look great, just not as great as they would in a modern game with a modern engine and renderer like Battlefront II.

It's best to aim for OpenJK's limits at the most. You could also look into making it compatible with rend2, which is an experimental modern renderer that can be used with OpenJK.

Link to comment

Dang. If there's something that i'm definitely not capable of is editing string codes. Yeah, i use openjk of course, if not the game would probably barely load the vanilla resources.

About the model, as i said, i optimized a lot, but there's a limit you can optimize a model before it gets too shitty.

About rend2 i read it is only for mp right now? I play only sp so i suppose i'll have to wait if they will make a sp version.

Thanks for the answers by the way.

 

 

Link to comment

You seem to have glanced over the LODS I mentioned.

evQobFu.png

LODS are lower detail Versions of a model, packaged into the model. If a model has LODs, you can view them in Modview by using the F1 to F4 keys on your keyboard.

How can they help?

The Transform Space error occurs on collision against a model. If the model it is performing the collision check against is very heavy in geometry, the available memory does not suffice for the required calculations, resulting in the aforementioned error message.

Luckily for us, the devs where rather smart about it and made it so that the game tries to use a lower LOD mesh for collision detection if one is available.

This means that if your additional LODs are low enough, the game will not crash and continue running just fine.

LODS are only shown to the player if:

  1. Low graphics settings are used
  2. The model is so far away from the player that he generally wouldn't notice in normal gameplay

You could import a vanilal jka model into blender to see how the LODs are set up. Usually it should jsut be copies of every mesh with a _<number> at the end of their names.

Do you have any further questions?

Circa likes this
Link to comment
6 hours ago, AshuraDX said:

You seem to have glanced over the LODS I mentioned.

evQobFu.png

LODS are lower detail Versions of a model, packaged into the model. If a model has LODs, you can view them in Modview by using the F1 to F4 keys on your keyboard.

How can they help?

The Transform Space error occurs on collision against a model. If the model it is performing the collision check against is very heavy in geometry, the available memory does not suffice for the required calculations, resulting in the aforementioned error message.

Luckily for us, the devs where rather smart about it and made it so that the game tries to use a lower LOD mesh for collision detection if one is available.

This means that if your additional LODs are low enough, the game will not crash and continue running just fine.

LODS are only shown to the player if:

  1. Low graphics settings are used
  2. The model is so far away from the player that he generally wouldn't notice in normal gameplay

You could import a vanilal jka model into blender to see how the LODs are set up. Usually it should jsut be copies of every mesh with a _<number> at the end of their names.

Do you have any further questions?

This should be in the tutorial section, that's a good summary that I'm sure would be useful for new people.

Link to comment
8 hours ago, AshuraDX said:

You seem to have glanced over the LODS I mentioned.

evQobFu.png

LODS are lower detail Versions of a model, packaged into the model. If a model has LODs, you can view them in Modview by using the F1 to F4 keys on your keyboard.

How can they help?

The Transform Space error occurs on collision against a model. If the model it is performing the collision check against is very heavy in geometry, the available memory does not suffice for the required calculations, resulting in the aforementioned error message.

Luckily for us, the devs where rather smart about it and made it so that the game tries to use a lower LOD mesh for collision detection if one is available.

This means that if your additional LODs are low enough, the game will not crash and continue running just fine.

LODS are only shown to the player if:

  1. Low graphics settings are used
  2. The model is so far away from the player that he generally wouldn't notice in normal gameplay

You could import a vanilal jka model into blender to see how the LODs are set up. Usually it should jsut be copies of every mesh with a _<number> at the end of their names.

Do you have any further questions?

Aside the fact that i use 3ds max, but i guess it's more or less the same, what i mean when you can't optimize more than a certain point is that if i do, the pro-optimizer plugin can't find the right route to maintain the shape while lower the vertices and it simply leaves holes. Missing faces. I think it has something to do with models made with zbrush. They are too detailed. I tried sometime ago with one made for 3d printing (and those are insanely high poly) and there was no chance.

But still, is it really necessary different lods for the player model? I mean, the 90% of time you see your character really close, so why bother? Besides my pc is good (i can play fallout 4 with almost max garphics) so i have all set to max.

Anyway, i sorta fixed it putting many stuff (like bracers, kneepads..) from other models with lower vertices. Of course now it's like a 'mix mesh-up' but i guess it'll have to do.

Thanks for your explanations anyway, i was really puzzled about that sv_ini.cpp. Still seems odd that game tells TO US to edit the game code, but ookay.

Link to comment

Hey, that's even better. I'm kinda the local 3ds max guy, responsible for the JKA Animation CAT Rig and developing a Mapping plugin.

Do you use the glm import/export plugins or do you work with the xsi->Carcass->glm route?

I would recommend the latter.

Pro optimizer has a lot of settings, but unfortunately when you import models from other games you often get open edges on a mesh. These often relate the hard edges or uv seams and can fuck with prooptimizer.

A good idea would be to apply a weld modifier to the whole mesh and then optimize. 

You could go even further and retopologize over top of the imported model, then use render to texture to transfer the textures to your new retopologized mesh.

That way you can quickly build a smooth, low detail surface over many small geometry objects that cover a mesh and project all of the detail in a texture map to use for your new lowpoly model.

This is the way to deal with zbrush models btw, as this gives you full control over the mesh topology, which also makes for a faster rigging process and better animateability.

About LODs,

Yes they are absolutely required to avoid crashing with high poly models as you encountered. They help to prevent the Transformspace error by feeding the game with a lower detail mesh to do the collision calculations with while still keeping your immaculate, high detail model on display. 😉

Link to comment

Well... i use glm importexport plugin, downloaded here, and i just load a standard model, then load the humanoid.gla (as it asks the plugin on loading) and then replace the parts with mine ones and export. So... i have no idea if this has something to do with carcass or whatever. (i have no idea what's that).

About applying weld modifier and then optimize it's the first time i heard about, i'll have to try that. Honestly, many modifiers such that one i don't even know what's their purpose, so take your guess.

And about lods, in any case, i have no idea how make them, i mean, on export as glm 3ds max does not ask about them, only when i load a model so boh?

Besides, i'm still trying to rig the model decently so in game does not create holes when moving the arms, lol. The splitting of model parts of this game isn't really of my taste.

 

Link to comment

I just checked back with the plugin dev and it seems that LODs can be exported hjust as well as imported, regardless of what the outdated guide says.

You just need to make copies of your model and tags/bolts for every LOD you want to add and add a number suffix to the copied meshes and bolts.
You can import a base jka model with LODs to see how they are set up.

I would suggest working with scene layers for the individual LODs to easily switch between them while working in max. I usually also keep the bones on a seperate layer.

About rigging with no gaps:

Have you ever used a skinwrap modifier before?
One of its functions is to copy skin data from one object to another. This means you can rig a merged copy of your model that has not been split and then transfer those weights over to the split copy of the mesh.

This is how I rig my models to avoid splits between parts. I actually have a premade, perfectly weighted base mesh that I always transfer from to get a good base to work up from whenever I make a new model.

Fell free to add me on discord if you want a more in depth explanation

ashuradx#1192

Link to comment

Of course i used skinwrap before, in oblivion terms we could say i'm a journeyman on 3ds max. And i usually avoid gaps simply merging my mesh on the previous one and deleting the previous (and keeping the skin modifier intact, so to speak). But, as i said, the splitting of the model parts in this game is just on parts that if my mesh differs a lot on number of verts it gets gaps anyway. Especially becouse this game does not have a model rigged on the whole. They're all split. On games like fallout or elder scrolls it's easier since models are mostly a single mesh.

Anyway, thanks, if i remember what's my nick on discord i'll catch up.

Link to comment
On 8/13/2022 at 1:01 AM, John Barleycorn said:

Well... i use glm importexport plugin, downloaded here

The version on this website is outdated, I have yet to get around to uploading the latest version (I want to do some more fixes/improvements first). I would recommend updating, because older versions may not work on the latest Blender and can lose vertex normals on import.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...