Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, AndrewAMD), 822 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
shadow for dynamic map entities? #414601
01/05/13 16:05
01/05/13 16:05
Joined: Jan 2013
Posts: 23
France
M
Mo222 Offline OP
Newbie
Mo222  Offline OP
Newbie
M

Joined: Jan 2013
Posts: 23
France
Hello ,

I am making a small platform game with my old A6 6.60 gamestudio edition.
I have a little problem about dynamic shadows for map entities.
Let me explain .

I put several platforms (as map entity) in the level from wmb files.I give them an "action" to let them react with the player.

The problem is they dont cast shadow on the ground when i set [my.shadow=on;] ,whereas the player casts shadow on the ground with the same flag.

Are not Map entities able to cast shadow?

Re: shadow for dynamic map entities? [Re: Mo222] #414606
01/05/13 17:34
01/05/13 17:34
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I don't think they are. If you have a flat ground surface you can emulate a shadow easily with a transparent sprite (move it if necessary).


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: shadow for dynamic map entities? [Re: Superku] #414609
01/05/13 18:11
01/05/13 18:11
Joined: Jan 2013
Posts: 23
France
M
Mo222 Offline OP
Newbie
Mo222  Offline OP
Newbie
M

Joined: Jan 2013
Posts: 23
France
Originally Posted By: Superku
I don't think they are. If you have a flat ground surface you can emulate a shadow easily with a transparent sprite (move it if necessary).

Hi superku!

Ok thanks for the precision .
In order (for a cube map entity) to emulate a shadow on a flat ground, how should i proceed? :
1- the cube should trace a ray to the ground in the direction of light ray?
2- then place the shadow sprite on the ground at the place hit by the trace ray?

but how can i get the direction of the light ray if i put several lights in the level? (i'll try and think about that)

PS : by the way , i watched a video of your game superku and i say good work , especially for the gameplay which seems entertaining!

Re: shadow for dynamic map entities? [Re: Mo222] #414611
01/05/13 19:11
01/05/13 19:11
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Thanks! wink
Obviously you can use models instead of map entities, the latter don't really have advantages over models since we have polygonal collision detection on models.

You mean dynamic lights, right? If you only have static lights, simply use the sun light direction vector for your trace or a simple vertical trace. If you have dynamic lights instead, iterate over them and use the nearest for calculation.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: shadow for dynamic map entities? [Re: Superku] #414649
01/06/13 08:56
01/06/13 08:56
Joined: Jan 2013
Posts: 23
France
M
Mo222 Offline OP
Newbie
Mo222  Offline OP
Newbie
M

Joined: Jan 2013
Posts: 23
France
Originally Posted By: Superku
Thanks! wink
Obviously you can use models instead of map entities, the latter don't really have advantages over models since we have polygonal collision detection on models.

You mean dynamic lights, right? If you only have static lights, simply use the sun light direction vector for your trace or a simple vertical trace. If you have dynamic lights instead, iterate over them and use the nearest for calculation.


I tried to use cube models instead of map entities.
Indeed cube models cast their shadows on the map ground, but they dont show the shadow of the player when he jumps on them.
Unlike the cube map entities which shows the shadow of the player on them, and dont cast shadow on the ground ....


I dont understand why the engine cannot render the shadow of the map entities.

Thus , what is the benefit of using map entities in a level?

Re: shadow for dynamic map entities? [Re: Mo222] #414652
01/06/13 09:42
01/06/13 09:42
Joined: Oct 2008
Posts: 681
Germany
Ayumi Online
User
Ayumi  Online
User

Joined: Oct 2008
Posts: 681
Germany
Map Entities are static Blocks.Render your Blocks and use the static Shadows.The benefit is the speed (-> Manual->How to...->Use Entities->Sub Level).

Textures and shadow maps of the level and of map entities are preallocated in video memory at loading time, in order to maintain smooth gameplay. Textures of all other entity types are normally only allocated when the entity becomes visible.

And here-> Entity selection guide .

It isn t a Model or Block, it s a Level part.Therefore u can t render Shadows with Maps.


Last edited by Ayumi; 01/06/13 09:43.
Re: shadow for dynamic map entities? [Re: Ayumi] #414653
01/06/13 10:17
01/06/13 10:17
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Map Entities are not static blocks (maybe you meant prefabs?), they are in fact dynamic blocks, if you want to call it that way. Map Entities don't serve any real purpose, they used to be available in A4 (?) because they provided polygonal detection and models didn't.

Mo222, what kind of shadow are we speaking of, stencil shadows?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: shadow for dynamic map entities? [Re: Superku] #414654
01/06/13 10:26
01/06/13 10:26
Joined: Oct 2008
Posts: 681
Germany
Ayumi Online
User
Ayumi  Online
User

Joined: Oct 2008
Posts: 681
Germany
Yes i have forgot to delete this sentence.

Quote:
It isn t a Model or Block, it s a Level part.Therefore u can t render Shadows with Maps.

Re: shadow for dynamic map entities? [Re: Superku] #414658
01/06/13 11:29
01/06/13 11:29
Joined: Jan 2013
Posts: 23
France
M
Mo222 Offline OP
Newbie
Mo222  Offline OP
Newbie
M

Joined: Jan 2013
Posts: 23
France
Originally Posted By: Superku
Map Entities are not static blocks (maybe you meant prefabs?), they are in fact dynamic blocks, if you want to call it that way. Map Entities don't serve any real purpose, they used to be available in A4 (?) because they provided polygonal detection and models didn't.

Mo222, what kind of shadow are we speaking of, stencil shadows?


Ok now i understand ! Map entities are a residue from A4 then.
I am playing with A6 which includes my.polygon=on;(i just discovered yesterday when you talked about that).

If i can emulate a shadow on the model cube , then i 'd rather work with models than map entities.
Now i should see if i can get a normal direction of model faces when trace hit a model face, in order to tilt properly the shadow.

by the way, i am talking about the standard shadow which comes from my.shadow=on; and offered by the sun.

Thank you both of you , superku and ayumi!


Moderated by  HeelX, Spirit 

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