Questions

Announcements, support questions, and discussion for Save System for Opsive Character Controllers.
Marcus
Posts: 9
Joined: Wed Mar 30, 2022 8:25 pm

Re: Questions

Post by Marcus »

I just ran threw this package again, and on load instead of switching to the Rifle, I just opened the inventory and the
rifle is equipped but it shows zero ammo loaded and the inventory has the correct ammo amount, when you put the rifle
in the players hands it auto loads its ammo from the inventory.. so its definitely the Rifle not saving its ammo amount or the saver not loading it back correctly for whatever reason. I checked this with my project as well and the same is true for all weapons I've created that have an ammo. I know this isn't helpful really but I wanted to point out that the ammo in inventory will be correct on load if you haven't put the gun in the characters hands, and that the gun has no ammo on load.
User avatar
Tony Li
Posts: 20705
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions

Post by Tony Li »

Hi,

Can you reproduce this in example scene I provided above?

How about in Opsive's own TPC + UIS integration? When you're using TPC + UIS, the Save System for Opsive Controllers hands off the management of ammo to UIS's save system. The UIS Saver component basically just acts as a wrapper for UIS's save system to tie it into the Save System's larger save system ecosystem.

Would it be possible for you to send a reproduction project to tony (at) pixelcrushers.com?

Are you describing the behavior below? If I play TPC's UIS integration scene, unequip the assault rifle, and pick up the ammo, the UIS inventory screen looks like this:

uccuis1.png
uccuis1.png (40.23 KiB) Viewed 8656 times

If I then equip an assault rifle, the inventory screen looks like this:

uccuis2.png
uccuis2.png (40.47 KiB) Viewed 8656 times

This is without doing any saving or loading. This is also the plain TPC UIS integration scene. The Save System for Opsive Controllers isn't involved.
Marcus
Posts: 9
Joined: Wed Mar 30, 2022 8:25 pm

Re: Questions

Post by Marcus »

Yeah, I did reproduce it in the example project you linked, the results would be on the last post of the previous page of this topic, the results were the same. see that post for more details. no this issue you posted about isn't the issue I'm describing.
and no I haven't tried to reproduce it with just Opsive software yet, I'll do that when I can get some time. I'll just post a video of the issue maybe later tonight if I get a moment.


Sorry I'm at work,
Marcus
Posts: 9
Joined: Wed Mar 30, 2022 8:25 pm

Re: Questions

Post by Marcus »

Video Link:
https://streamable.com/6pf159




This is your test project, you can see after saving the game with a loaded weapon, on load its no longer loaded..
then when toggling the equipped weapon back to char hands it loads the weapon from the inventory ammo..

so two completely different projects one being mine and the other being a new project with your scene using basically stock UIS & TPC with the saver asset.. and on both projects everything else so far as UIS TPC & the Saver all function as intended, everything works accept this.. Now maybe this is an Opsive Issue, a version issues with Opsives TPC or UIS or even the integration package or something IDK, but I am fairly sure I didn't have this issue with just TPC & UIS with using the built in saver components when I tested this on the previous version of OPSive software. maybe something is setup wrong but I don't think so, im gonna try some more stuff as I get time, but I wanted to point this out because its kinda a big deal even though its a small issue..

Your thoughts on this would be greatly appreciated
User avatar
Tony Li
Posts: 20705
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions

Post by Tony Li »

I'll look into this with Opsive and reply back by tomorrow.
User avatar
Tony Li
Posts: 20705
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions

Post by Tony Li »

Just checking: Are you using the latest versions of TPC, UIS, and the Save System for Opsive Controllers? Have you imported the "Save System for UIS" unitypackage included the latest version of the Save System for Opsive Controllers?

I put together an example scene that does the same thing as your video, and it appears to work. When loading a saved game, the loaded ammo is correct, not zero. Here's the scene, exported from Unity 2020.3.32. It's named "Test" and it's in the root Assets folder.

SS_TPC_Test_2022-04-04.unitypackage

Would you please give it a try and tell me if it works correctly in your project?

If not, would it be possible for you to send a copy of your project to tony (at) pixelcrushers.com?
(Instructions for packing up reproduction projects)
Marcus
Posts: 9
Joined: Wed Mar 30, 2022 8:25 pm

Re: Questions

Post by Marcus »

I couldn't understand why you can't replicate this, it was literally 100% of the time for me, today though I noticed that sometimes it can work correctly over and over again... the problem mainly seems to manifest, while loading from
another scene or saving and closing the game in unity, then running the game again then loading the saved game.
If I start the game in a main menu >>> load the game scene >> save and then quit the game, if I then restart the game
and load from main menu it always loads the gun with zero ammo.

if I in a single scene, save the game and hit load, it works loading the gun with correct ammo more often then not.


if in a single scene I save the game, close the game in unity and then restart and load the game, the gun won't have ammo and if it does its because it loaded from the ammo in the inventory not because it was restored correctly.

this is such an odd issue.. it's pretty easy to break down though, if the gun or ammo wasn't set up correctly, they wouldn't work, they both work as they are supposed to work.. everything else saves and loads exactly how it is supposed to work all the time, so the save system is also set up correctly, there are no errors, warning etc of any kind in either of the projects im using for this.. in fact my personal project is extremely complex and I've yet to break it in any form what so ever, everything just works as its supposed to work all the time.

so far as your questions goes, I'm using UIS 1.2.6 I think I mentioned in previous post already, its a version behind but still a pretty new version of TPC UIS and the integration.

I'll try the other project with an updated version of everything when I can, very busy with work atm.

have you spoken to the Opsive guys about this at all? I may also post this issue to their site sometime this week.
I think this is a problem that goes unnoticed because of the way the equip works in TPC, if the gun is equipped from inventory and its empty it just loads the ammo from the inventory with out even a sound effect, so I think people just don't realize their ammo is vanishing while testing..
User avatar
Tony Li
Posts: 20705
Joined: Thu Jul 18, 2013 1:27 pm

Re: Questions

Post by Tony Li »

I'll run this by Justin and Santiago at Opsive (we work pretty closely on integrations like this), but I have a feeling it's either a bug in the Save System or a setup difference in your project.

Here's an updated example:

SS_TPC_Test_2022-04-05.unitypackage

I moved the scenes into a folder named Assets / Test_Save_System. To run them, add TestMainMenu and TestTPC to your build settings. These are my test steps:

1. Play TestMainMenu.

2. Click New Game.

3. Pick up the ammo. Confirm that I have 48/957 rifle ammo, with rifle unequipped.

4. Exit play mode.

5. Play TestMainMenu again.

6. Click Load Game.

7. Equip rifle. Confirm it still has 48/957.


If you confirm that these test scenes work on your side, some possible things that could be misconfigured in your own scenes are:
  • Not saving and loading the same slot number.
  • Configuring UIS to run its own save manager saves in addition to the Save System (e.g., any UIS Save System Manager > Auto Load... or Auto Save... checkboxes ticked).
  • UCC Saver's Save Inventory checkbox maybe got accidentally ticked back on
Post Reply