|
Camera Not Updating after Reload
#471989
03/31/18 21:30
03/31/18 21:30
|
Joined: May 2005
Posts: 868 Chicago, IL
Dooley
OP
User
|
OP
User
Joined: May 2005
Posts: 868
Chicago, IL
|
I added a new feature to my game in which a small panel shows a top down view of the level. It works great, and it even works after leaving the level and coming back to it.
However, I just noticed that if I leave the game, then come back and reload a saved game, any levels I try to go to with the top down viewer, will cause an error.
The level seems to load fine, but the screen is no longer updated, somehow the main camera object no longer works. I can move my character, fire his weapon, even call up panels and swap equipment, but none of the 3D cameras are working after reloading these levels.
Obviously, it's a huge complex issue where one would have to understand the code I used to figure it out. Before I burden anyone else with my code, I though maybe someone might have a vague idea of what might be causing this so I could investigate further.
I will be researching to find out exactly where this problem began to manifest itself, but if you have seen anything like it before, especially when using multiple views, I would greatly appreciate any advice or suggestions!
Last edited by Dooley; 03/31/18 21:31.
|
|
|
Re: Camera Not Updating after Reload
[Re: Dooley]
#471993
03/31/18 21:39
03/31/18 21:39
|
Joined: May 2005
Posts: 868 Chicago, IL
Dooley
OP
User
|
OP
User
Joined: May 2005
Posts: 868
Chicago, IL
|
Okay, I can confirm that this is caused by my extra VIEW that I'm using. I commented out all references to it in my code and now the levels load fine and work normally.
This is strange because I have another additional VIEW object (in my spaceship) which works fine when loading and reloading the game. It is only when landing on a planet when the third VIEW object will come into play, so only two VIEWS will be used at the same time - the main camera and the additional view screen in the spaceship, or top down map on planets.
So there is some combination of views perhaps that prevents the main camera from updating properly. The additional strange bit is that it works fine during the first play session. Only after leaving the game and coming back will the camera view be disrupted upon reloading an existing level, and also when loading a new planet level.
The good news is that I know the approximate cause of the problem - my new VIEW object. The bad news is that I can't use this object in the game until I figure this out ...
Last edited by Dooley; 03/31/18 22:06.
|
|
|
Re: Camera Not Updating after Reload
[Re: Dooley]
#471998
04/01/18 05:27
04/01/18 05:27
|
Joined: May 2005
Posts: 868 Chicago, IL
Dooley
OP
User
|
OP
User
Joined: May 2005
Posts: 868
Chicago, IL
|
Okay, I have narrowed it down to one line of code that is causing the failure. scan_view.bmap = scan_bmp; Everything else works if I remove this one line. But this is the line that makes the map work.
|
|
|
Re: Camera Not Updating after Reload
[Re: Dooley]
#472012
04/01/18 20:52
04/01/18 20:52
|
Joined: May 2005
Posts: 868 Chicago, IL
Dooley
OP
User
|
OP
User
Joined: May 2005
Posts: 868
Chicago, IL
|
Okay, I think I have stabilized it. I have been calling the following line in the while loop: scan_bmp = bmap_for_entity(my,1); But it looks like it only needs to be called once when the view is created. In any case, it seems to work, and has not crashed after a long play session.
|
|
|
|