Close

Site Cloud

Login | Sitemap
Welcome, Guest
Please Login or Register.    Lost Password?

Need some input on GameLogic
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Need some input on GameLogic
#142
Need some input on GameLogic 2 Years, 9 Months ago Karma: 2
Hi,

I will explaing you the scenario in the game(KhoKho) I am working now.

Player P1 is the Active chaser who is chasing the defenders.
Player P2 is one of the passive chaser(Sitting player) of the same team.

Now P1 decided to give tag to his team member and chose P2 as Tagger.
So, P1 has to go close to P2 and when they are close enough then P2 will become active chaser and will start chasing defenders. P1 will occupy P2's position.

How I am trying to implement is:
1) Calculate the ChaserToTagger vector between P1 and P2.
2) Calulated the distance between P1 and P2 using ChaserToTagger.Length() method.
3) now devided the distance with chaser's max speed.

Time delay = distance/chaser->MaxSpeed();
chaser can move atmost with Maxspeed velocity, on each and every updated we truncate chaser's velocity to MaxSpeed

4) Send telegram to Tagger with the delay we calculated.
5) After receiving the telegram the Tagger should become active and start chasing the closest defender.

Therotically it looks good, but when implemented this approach it is not giving
good results.

Chaser is going to Tagger's position, even much earlier than I anticipated. Chaser waits at Tagger's position for some time.

Can some one suggest me with better approach or modification in the current approach.



Thanks & Regards,
Lokanatha Reddy
lreddy
Student
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#146
Re:Need some input on GameLogic 2 Years, 9 Months ago Karma: 3
Hi

How about using a distance check between Tagger and Chaser and then activate
the Tagger ?

Something like :-

If ( ChaserToTagger.Length() < 10 )
{
pTagger->Activate();
}

So this approach will not use time delay at all and simply rely on a trigger
distance between Chaser and Tagger.

regards
Shashank
Dixit
Student
Posts: 43
graphgraph
User Offline Click here to see the profile of this user
Location: Bangalore
Last Edit: 2009/05/05 04:37 By Dixit.
The administrator has disabled public write access.
I dont want to be right. I just want to know whether I am right
Albert Einstein
 
#150
Re:Need some input on GameLogic 2 Years, 9 Months ago Karma: 5
Yes, you can try the distance check indeed.

Alternatively, try to simplify the logic. Just make the passive chaser chase when "touched" by the active chaser. P2 can have a tag radius. If P1 is in the tag radius, P2 will take the chase and P1 will use the arrive behavior to take its sitting position.

This way, all you have to do is enter this small radius. Theoretically, the radius should also ensure that both gets time to "prepare" themselves and the arrive will also look smooth.

Try this, until then we don't know if it'll look good.
Manuj
Administrator
Posts: 76
graph
User Offline Click here to see the profile of this user
Gender: Male Location: Bangalore Birthday: 07/04
The administrator has disabled public write access.
"There is a principle which is a bar against all information, which is a proof against all argument, and which cannot fail to keep a man in everlasting ignorance - that principle is condemnation before investigation." - Herbert Spencer
 
Go to topPage: 1
Moderators: Manuj
get the latest posts directly to your desktop

Latest Events

Contact Information

Information (General Information) KODE|academy, II Floor, K R Towers, 100 Feet Ring Road, BTM Layout, Ist Stage Bangalore, Karnataka 560068 India (080)41501410 or 41276688 Mobile: 9741500215