Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by jcl. 07/22/26 06:42
ZorroGPT
by TipmyPip. 07/21/26 17:54
New Zorro version 3.11
by jcl. 07/21/26 13:42
Lapsa's very own thread
by Lapsa. 07/18/26 13:40
Purchase A8 full licence version
by ukgamer. 07/17/26 05:52
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (1 invisible), 1,558 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
mem error using custom shadow #442881
07/05/14 10:46
07/05/14 10:46
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Howdy,

Today after I made and added a custom shadow (/that I made in paint shop pro, .png) for enemies, I got a memory error twice so far when testing. Removing the custom shadow lines seem to fix the error. The last ~3-4 weeks (or more) with testing/playing I got no memory error so I think the shadow or the code for it is the cause.

Code (inspired by the manual):

Code:
ENTITY* ent_shadow_enemy = { type = "Shadow_Enemy.png"; }
...
...

function set_resolutionandshadows() 
{
shadow_stencil = 2;
...
}
...

action enemy()
{
 ...
 set(my,FLAG3 | SHADOW);
 my.shadow = ent_shadow_enemy; //this line is the cause
 ...



Link to the shadow file:
http://www.gamefront.com/files/24334113/Shadow_EnemyError.zip

Maybe important (I doubt it though), I also had a second view open with the NOSHADOW flag set.

From the manual; "A function such as ptr_remove, ent_remove, or sys_free was called with an invalid or already-freed pointer; or an allocated memory area was overwritten by a damaged file or script bug.". Probably a bad damaged file than?

Tyty

Re: mem error using custom shadow [Re: Reconnoiter] #442888
07/05/14 11:36
07/05/14 11:36
Joined: Jul 2007
Posts: 620
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 620
Turkey, Izmir
I tried your file with A7 (and with same code). no error. maybe you found a bug, or maybe caused by something else.

Re: mem error using custom shadow [Re: Emre] #442898
07/05/14 15:22
07/05/14 15:22
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Thanks Emre for testing it.

Maybe it was cause I had paint shop pro open? I could try it again with that closed, but since memory errors are not really realiable it could take a while.

Re: mem error using custom shadow [Re: Reconnoiter] #442905
07/05/14 18:10
07/05/14 18:10
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
try this instead:

Code:
action shadow_act(){
     VECTOR temp;
     var distance_to_ground = 25;//set this yourself
     set(my,PASSABLE);
     my.tilt = -90;//or 90
     while(you){wait(1);
               vec_set(my.x, vector(you.x,you.y,you.z-distance_to_ground));
     }
     ent_remove(me);
}

action enemy_act(){
     //begining of action
     ...
     ent_create("sShadow_Enemy.png",my.x,shadow_act);
     ...
     //before the while loop
}



This just creates the shadow under the enemy, and follows it until the enemy is removed.

Last edited by DLively; 07/05/14 18:16.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: mem error using custom shadow [Re: DLively] #442909
07/05/14 18:34
07/05/14 18:34
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Thanks, but it is for a fps game with many hills, so I think looks to much like a sprite.

Re: mem error using custom shadow [Re: Reconnoiter] #442918
07/05/14 20:45
07/05/14 20:45
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Try using a tga file instead


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: mem error using custom shadow [Re: DLively] #442944
07/06/14 16:28
07/06/14 16:28
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
But the entity won't bend/blend over the terrain like a shadow does, right? Making it tga will only enable alpha layers right, like as png? Or am I missing a special feature gamestudio3d/acknex has for tga?

Re: mem error using custom shadow [Re: Reconnoiter] #442947
07/06/14 18:04
07/06/14 18:04
Joined: Jul 2007
Posts: 620
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 620
Turkey, Izmir
Originally Posted By: manual
PNG images behave like 32 bit TGA images with alpha channel (even if the channel was not explicitly created in the pain program). They are not recommended because they are loaded not by the engine, but by the DirectX library, and are not guaranteed to be automatically restored when the video device gets lost. This means that they can lose their content f.i. when a fullscreen application is minimized.

i don't think this is related with your problem but yes tga better than png.

Re: mem error using custom shadow [Re: Emre] #442948
07/06/14 18:15
07/06/14 18:15
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
How do you minimize a fullscreen application? Alt-tab? Cause I have done that plenty of times I think and never have seen something wrong with the png images (e.g. as panels).

It is good to keep that in mind though so thanks Emre, but it seems pretty safe to use png images.

Png images are nice to work with, they are not so big and you can preview them as a icon in (windows) folders, making your folder alot more clear than with lots of tga's (iirc).

Re: mem error using custom shadow [Re: Reconnoiter] #442949
07/06/14 18:36
07/06/14 18:36
Joined: Jul 2007
Posts: 620
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 620
Turkey, Izmir
I totally agree with you. But i can't take a risk for commercial project. that's why i'm using tga&dds always. I just wanted to let you know that risk. wink

Last edited by Emre; 07/06/14 18:41.
Page 1 of 2 1 2

Gamestudio download | 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