AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Crackin' the Mini-Map (https://forums.alliedmods.net/showthread.php?t=60221)

Wilson [29th ID] 08-29-2007 08:52

Crackin' the Mini-Map
 
For thousands of years, archaeologists and historians have tried to discover how the mini-map of Day of Defeat works. Numerous attempts have been made to block your teammates from showing up on the mini-map in an unrealistic, "radar-like" fashion.

In 322 B.C., Wilson29thID set everyone's ES_SolidState to SOLID_NOT and that seemed to solve the problem, but also created another problem: when you hold your mouse over your teammate, there is no way to tell who it is. That means they can teamwound all they want and no one will know it's them (and many other problems along the way).

In 2 A.D., Wilson29thID used the bug in the DoDx module, dod_set_user_kills() to make them seem dead and thus have the icon above their head not displayed, but it still displayed on the minimap.

To this day, Wilson29thID has made many attempts but not yet cracked the code of the Day of Defeat minimap. But I think we've finally got it this time.

Here's How!
As many mappers know, (at least in DoD,) no matter where you are on the map or what you're looking at, you are rendering all of your teammates 100% of the time. You only render enemies (and all other entities) if you are looking at them or about to look at them. I have always taken this as a grain of salt and irrelevant until now.

One day I opened my minimap and noticed it took a second for the player icons to show up, and started thinking about this...Reason tells me that the reason we render our teammates is to display their icon on the minimap and the icon above their heads.

Now the question is...how to stop that rendering. What tells the engine that a client should render another client no matter where he is in the map? And what tells the engine he should only render a client if he is in view or about to be in view?

Tonight, we write history!

toazron1 08-29-2007 10:11

Re: Crackin' the Mini-Map
 
The first thing to look at is DoD messages. For NS there is a message called EntHier that controls the minimap (http://zerot.nhlrebel.com/wiki/EntHier).

Is there a similar message for DoD?

Wilson [29th ID] 08-29-2007 11:48

Re: Crackin' the Mini-Map
 
I agree - it is the first things to look at, and it was one of the first things I did, a long time ago. There is not a message that affects the minimap. At all. I have checked every message relevant in Day of Defeat, and even many that are not relevant. Thanks for the input though.

toazron1 09-05-2007 00:25

Re: Crackin' the Mini-Map
 
Hmm. There has to be some way that the client is receiving player positions and updating accordingly

Wilson [29th ID] 09-06-2007 14:59

Re: Crackin' the Mini-Map
 
Right, and I'm near certain it's the same system as rendering.

The question is how to change who renders who.

Does anyone know anything about the EntityState hook's "host" parameter? I believe this is how you read the update's "who render's who"..but I don't know enough about it

Wilson [29th ID] 09-08-2007 13:52

Re: Crackin' the Mini-Map
 
Hopefully someone can make sense of this. From what I understand, referring to AddToFullPack, the "ent" parameter is the entity that we're reading or changing, and it's being displayed to the "host" parameter.

So theoretically:

if ent = your teammate, and host = you, ES_RenderMode should always be something that means "yes, it's rendering"

if ent = your enemy, and host = you, ES_RenderMode should be "on" if he's in range, "off" if he's not in range. Perhaps there is a specific mode that automatically does this.

This is the test code I've come up with:

Code:
public fw_addtofullpack( es_handle, e, ent, host, hostflags, player, pSet ) {     if( !player ) return FMRES_IGNORED;         if( ent == get_pcvar_num(pEnt) )     {               new read_rendermode = get_es( es_handle, ES_RenderMode );         new read_renderamt  = get_es( es_handle, ES_RenderAmt  );                 new szEcho[512];         format( szEcho, 511, "[Ent:%i] [Read-Mode:%i] [Read-Amt:%i]", ent, read_rendermode, read_renderamt );                 new set_rendermode = get_pcvar_num( pRenderMode );         new set_renderamt  = get_pcvar_num( pRenderAmt  );                 if( set_rendermode > -1 )         {             set_es( es_handle, ES_RenderMode, set_rendermode );             format( szEcho, 511, "%s [Set-Mode:%i]", szEcho, set_rendermode );         }         if( set_renderamt > -1 )         {             set_es( es_handle, ES_RenderAmt, set_renderamt );             format( szEcho, 511, "%s [Set-Amt:%i]", szEcho, set_renderamt );         }                 console_print( host, szEcho );             }     return FMRES_IGNORED; }

Basically what happens is when I alter the CVARs, it has no affect on the the player showing up on the minimap. I am able to make him invisible by doing this, however, but minimap is not affected at all.

This leads me to believe there is a different way that Rendering is handled. Does this ring a bell to anyone?

EDIT: I've hooked AddToFullPack both regularly and post.

Lee 09-08-2007 17:09

Re: Crackin' the Mini-Map
 
Have you ruled out the possibility that the server isn't even sending origin data about enemies not in view?

Wilson [29th ID] 09-08-2007 17:55

Re: Crackin' the Mini-Map
 
Actually, that would be fine.

What I would like to do is do that with the teammates as well. Eliminate the origin data for teammates, in the same way it is eliminated for enemies.

Zenith77 09-08-2007 22:04

Re: Crackin' the Mini-Map
 
You could do this kind of a brute force way. For example, perhaps it is stored to in one of the ES_iUser fields, just print this out data out to a file and then look for changes in the data when a user comes on the radar, and when he's not. You might also want to create a command to toggle this on and off since this will be called god knows how many times.

sparky99 09-09-2007 06:33

Re: Crackin' the Mini-Map
 
There is a tutorial for coding HL mods with a minimap on the net somewhere. It uses the TriApi to render.

HLguard blocks enemy and allied position if they can't be seen via thier wall block in 1.80 but not in 1.90n (sadly they fixed it, I was quite fond of this bug). You might get some hints from them. Seems like its client side drawing code tho, so good luck.


All times are GMT -4. The time now is 16:04.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.