Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (TipmyPip, AndrewAMD, Quad, aliswee, degenerate_762), 970 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Camera Not Updating after Reload #471989
03/31/18 21:30
03/31/18 21:30
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline OP
User
Dooley  Offline 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 Offline OP
User
Dooley  Offline 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 Offline OP
User
Dooley  Offline 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.

Quote:
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] #471999
04/01/18 06:47
04/01/18 06:47
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 868
Chicago, IL
I found out that my other bmap/view entity uses a 16 bit, vs 24 bit image. Maybe that's the issue?

Re: Camera Not Updating after Reload [Re: Dooley] #472000
04/01/18 07:15
04/01/18 07:15
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 868
Chicago, IL
Woooooo!
I fixed it. I changed the bitmap size from 1024 x 1024 down to 256 x 256. That seemed to resolve the problem, so it must have been somehow memory related. Strange that it worked the first time around, bit only failed after exiting and reloading the game. 256 is actually big enough to capture all the detail I need, so 1024 was kind of a waste of memory anyway.

Re: Camera Not Updating after Reload [Re: Dooley] #472010
04/01/18 19:35
04/01/18 19:35
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 868
Chicago, IL
Okay, I thought I fixed it, and it does indeed work better than before. However, now if I go to a few different locations the game will crash. It gave me a directx ZTARG error.

On another thread I saw that someone mentioned that it could not create the buffer, and would then try to render to the screen - causing the error.

Is there any way to avoid this? Maybe a wait statement until it creates the buffer?

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 Offline OP
User
Dooley  Offline 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:

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


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1