Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (NewbieZorro, Grant, TipmyPip, AndrewAMD), 12,885 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Another 3rd person camera problem :) #141900
07/18/07 17:57
07/18/07 17:57
Joined: Jan 2007
Posts: 63
Oregon
mbartman Offline OP
Junior Member
mbartman  Offline OP
Junior Member

Joined: Jan 2007
Posts: 63
Oregon
In many third person RPG's, if the players view is obstructed by a tree or a house, the object in the way fades into transparency and then back out when no longer obstructing.

I am trying to think of a good way to manage this, and I have an idea but I don't know if it is the best way to go about it.

I am running a c_trace from the camera to the player each frame, and I know that if an obstruction occurs, c_trace will set 'you' to that object. That takes care of fading it out, but what about after it is no longer obstructing?

I am thinking of perhaps creating a linked list that tree's would be added to as they obstruct the view. Each element of the list would then represent an object and whether or not it should be fading in or out. If the object is all of the way faded back in, then it would be removed from the list.

Is that overkill, or is that the best way to do this? Any ideas appreciated,

Thanks,


Michael Bartman A6/A7 Commercial Edition Programmer By Nature
Re: Another 3rd person camera problem :) [Re: mbartman] #141901
07/19/07 04:06
07/19/07 04:06
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
I think when you set an entity transparent start a function that checks this entity every frame if its still between the camera and player, and if not make the entity intransparent and end the function. This is certainly easier than a linked list and also the third person camera of the templates used it (I believe).

Re: Another 3rd person camera problem :) [Re: Spirit] #141902
07/19/07 07:21
07/19/07 07:21
Joined: Jan 2007
Posts: 63
Oregon
mbartman Offline OP
Junior Member
mbartman  Offline OP
Junior Member

Joined: Jan 2007
Posts: 63
Oregon
Linked lists aren't difficult Though I don't know if there are restrictions in place with Lite-C, but at least the concept is fairly simple

I think I will need to check more than one entity at a time, and simply using c_trace will only return a single obstructing entity. I may have several trees blocking the view at once.

I am contemplating setting triggers on the trees that will trip when the player comes within a certain distance. I'm not sure how that will affect the speed of the game though.

Thanks for your help,


Michael Bartman A6/A7 Commercial Edition Programmer By Nature
Re: Another 3rd person camera problem :) [Re: mbartman] #141903
07/19/07 18:08
07/19/07 18:08
Joined: Jan 2007
Posts: 63
Oregon
mbartman Offline OP
Junior Member
mbartman  Offline OP
Junior Member

Joined: Jan 2007
Posts: 63
Oregon
SOLVED

I used triggers and the pythagorean theorem to achieve this effect. Hopefully having a trigger for each tree won't hurt the performance too much, but I really can't think of any other way to do it efficiently.

Thanks for your help


Michael Bartman A6/A7 Commercial Edition Programmer By Nature

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

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