Jump to content

Writing new save game values...


Go to solution Solved by Dusty,

Recommended Posts

Is this possible in anyway without modding the engine/executable?

 

I tried adding new values to the gclient_s struct in the game code of JA which Raven comments as affecting load-save, but the game crashes when I try to load save games with an NPC spawned. 

Link to comment

Question: is possible some code fix for the save game infinite loading bug screen that occur when a level get more of 4 different NPC with different custom new lightsabers carried as weapons? i ever get this bug every time there are some many sab file too large with melee weapons.

Link to comment

Have you looked at why/where it hangs with a debugger attached?

 

Is this question for me or Asgarath?

 

Assuming it's for me... I have. The execution breaks at line 987 of g_savegame.cpp at the end brace of ReadGEntities. The exact error is get is this: "Unhandled exception at 0x77E5DF58 (msvcp120d.dll) in openjk_sp.x86.exe: 0xC0000005: Access violation reading location 0xCDCDCDD1."  I assumed it was some kind of memory issue like I was accessing a bad address by going outside the range of a pointer or an array, which makes me think more memory needs to be allocated somewhere...

 

The end of this article, https://github.com/JACoders/OpenJK/wiki/Singleplayer-Overview, basically says that you need to modify sv_savegame.cpp in the executable to pass in new savegame values, so that made me think in hindsight I can't just modify a struct in the game code and expect it to work.

 

 

Question: is possible some code fix for the save game infinite loading bug screen that occur when a level get more of 4 different NPC with different custom new lightsabers carried as weapons? i ever get this bug every time there are some many sab file too large with melee weapons.

 

That sounds like a nasty bug. Is it an OpenJK bug or a Jedi Academy bug?

Link to comment

@@Dusty it's a bug of original jedi academy game related to .SAB files. if there is a map with more of certain entities that carry as weapon in NPC file confgiguration wp_saber and they get as weapon a saber with the parameters of melee weapons (bounceonwalls, noblade, nodlight, nowallmarks etc etc ) when level is loaded by ui menu can get the error "a reliable command was cycled out" or simply freeze the loading at the end with the load bar that crazy fade in \ off in the last segment. i tested on my experience if that occur if in the map are spawned more of 5 saberist npcs. or 4 saberist npcs + load a player that get a melee saber with g_saber \ui_saber command setting on menu.  so is some kind of problem of buffer allocation for sab file into the loading system of JKA.

this issue occours also on openjk SP client. many of my custom NPCs on mod get melee sabers and some maps fulls of reborns and saberist cannot load for this issue. (like vjun3, for example, is one of the more bugged loading ) i never discovered why it happen but it's an hold problem (and sorry for the disturb, i need maybe to open another thread about that? :S ) but for this problem i lost years of modding time because i passed many months to reconfig my NPCs \ SAB assets for try to avoid this issue. a level is unplayable with this problem.

 

this not happen if NPCs get in NPC files configuration shooting weapons of every kind. or if the npc receive as weapon WP_SABER + a melee saber into a spawnscripts. tested that with t1_fatal map. stormtrooper that get with spawnscripts saber not overload the load \ savegame system of the level related to quick save or save game. this occurs only with the loading of a level by JKA menu. it's something related to the loading of saberist NPC by menu. i never knew or discover why this happen... or what bug of the engine cause that.

for that, i am curious about all the functions called in the loading of a map. i wanna understand how is loaded a bsp level, and how are loaded the entities of JKA. sure the answers lies in that code part.

 

if you want to test this troubles, you can download by the file section of this site a dozen of melee blades by some melee pack, and assign to NPCs of the games in a way that in a level are present more of 4-5 NPC with the custom mod melee sabers. (katana, climb, maces, swords, scythe etc ) edit with that cultist and reborn. npc files is sufficient. if you load maps like vjun3 or taspir1 you will get the bug i mean.

 

tested now on taspir1 map.

stormtrooopers and reborns of levels carry alls melee saber weapons of different kinds.

the results is that:

 

http://oi65.tinypic.com/2s8r37k.jpg

Link to comment

The SP was unfortunately not designed to be as modder friendly as we might have hoped.  Even having custom models can break saves or tie saves to those models.

 

@@Dusty, chances are your save code is probably ancient by now.  There was some patches recently through a pull request to overhaul the save system (for cross platform compatibility etc) but it may have created some other issues in the process.

 

Access violation doesn't mean you need to allocate more memory.  It means you have a location in the code that is trying to access invalid memory.  IE: reading a pointer which is null or garbage or going out of bounds reading an array (which is basically the same as a bad access to a pointer since somearray[index] is the same as doing *(somearray + index) I believe?  May not need the *

Link to comment

@@Dusty, chances are your save code is probably ancient by now.  There was some patches recently through a pull request to overhaul the save system (for cross platform compatibility etc) but it may have created some other issues in the process.

 

Access violation doesn't mean you need to allocate more memory.  It means you have a location in the code that is trying to access invalid memory.  IE: reading a pointer which is null or garbage or going out of bounds reading an array (which is basically the same as a bad access to a pointer since somearray[index] is the same as doing *(somearray + index) I believe?  May not need the *

 

Do you think the newer save code would allow me to do what I'm trying to do now? Or I would still have to mod the executable to write new save values?

Link to comment
  • 2 weeks later...
  • Solution

Turns out my issue was that I had forgotten that I added a new value to the playerstate in q_shared in addition to the client values I was talking about. I seem to recall being told that modifying the playerstate is much more touchy than just adding new client values, which as far as SP is concerned achieves the same effect?

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...