• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Changing alliance: Projectile vision problem

Status
Not open for further replies.
Level 9
Joined
May 21, 2014
Messages
580
I have a problem over my end.

I have this trigger:
  • Player - Make (Triggering player) treat EnemyPlayer as an Enemy
  • Player - Make EnemyPlayer treat (Triggering player) as an Enemy
  • Sound - Stop makeEnemy <gen> Immediately
  • Sound - Play makeEnemy <gen>
As you can see, the above triggers changes alliance.
Is that the right way of doing it?

Whenever the player who declares war on another player happens, the trigger will work as expected; but there is a twist. The projectiles from all the towers built (or possibly ranged units) are shown, even when the map is fogged to the opposing player. This happens to the both of them.

Why is this even happening?
 
Level 9
Joined
May 21, 2014
Messages
580
What if I try to play around with Vision Modifiers along with alliances? If only I have my hands on W.E. ...

EDIT:
May I request for someone to check it out? I don't have currently my laptop with W.E.
 
Last edited:
Level 3
Joined
May 12, 2016
Messages
51
  • Player - For (Triggering Player), turn Shared vision Off toward EnemyPlayer
  • Player - For EnemyPlayer, turn Shared vision Off toward (Triggering Player)
Have you tried putting this before the Change Alliance actions?

I tried simulating your issue with the test map below, with some of the stuff in the editor regarding vision yet I can't replicate it so far.
 

Attachments

  • The Story of Us.w3x
    19.3 KB · Views: 132
Last edited:
Level 9
Joined
May 21, 2014
Messages
580
Actually it also happens to other units. This happened so many times when I and my friends played dota

Thank you for that wonderful information (though stated on your previous post).

I guess I really need to check it out, or probably I wouldn't be able to solve it if DotA hasn't.

It's still worth a try.

Points:
1. Forces doesn't have to do anything with the bug. (DotA)
- UNLESS... the forces in DotA is implemented in such a way the Sentinel and Scourge are different forces from the players themselves. @Almia if you remember which units caused this and on what side they are on?
2. The bug happens on:
- Changing alliances, for my case.
- how did this happen in DotA?
 
Level 12
Joined
Nov 3, 2013
Messages
989
I know this can happen if you have allies but don't share vision.

You can't see the units but you will see the projectiles through fog, I know this because in a map I made years ago you was allied with the computer but you didn't share vision so you couldn't see the creep-wave but if you looked you'd still know where they were fighting because of the archers' arrows flowing back and forth in the air where they met with the enemy creep-wave.
 
The AI aggro still works:
1) Sentinel hero attempts to attack a Scourge hero in lane. Both have creeps around them. If that sentinel hero attacks the scourge hero, the scourge creeps will change aggro and attack the sentinel hero.

2) Towers will hit first those who hit them (so if there are creeps that are attacking the tower and those creeps found a nearby target, they intend to attack those targets, now if you are still attacking the tower, the tower will then attack you)

3) Towers can change aggro depending on their enemy hero
 
Level 12
Joined
Nov 3, 2013
Messages
989
The AI aggro still works:
1) Sentinel hero attempts to attack a Scourge hero in lane. Both have creeps around them. If that sentinel hero attacks the scourge hero, the scourge creeps will change aggro and attack the sentinel hero.

2) Towers will hit first those who hit them (so if there are creeps that are attacking the tower and those creeps found a nearby target, they intend to attack those targets, now if you are still attacking the tower, the tower will then attack you)

3) Towers can change aggro depending on their enemy hero

If you make a map and leave a player slot empty the units owned by this player slot won't do any of these things by default.

Just try it yourself, place a hero and attack another hero surrounded by units, if the enemy hero and units are owned by an AI controlled enemy the units will change their target to attack your hero but if it's instead owned by another human player or an empty slot then it won't happen.

Also I've got a basic one lane "AoS"-esque creep vs creep map just to try things like the unit behaviour and as soon as I place a computer AI as controlling player slot it's units will constantly switch targets to focus the low health units and so on, which won't ever happen with human controlled or empty player slots.

As for why it's still working in DotA: My guess is that there's some custom AI run for the empty player slots or triggers (or both).
 
Level 9
Joined
May 21, 2014
Messages
580
I know this can happen if you have allies but don't share vision.

You can't see the units but you will see the projectiles through fog, I know this because in a map I made years ago you was allied with the computer but you didn't share vision so you couldn't see the creep-wave but if you looked you'd still know where they were fighting because of the archers' arrows flowing back and forth in the air where they met with the enemy creep-wave.

So, that means... I need to really add vision modifiers in my trigger posted?

It will make sense now, if alliance really isn't directly related with vision...

EDIT:
Successfully implemented the right functions and modifiers.
Will have to test before +rep.
 
Last edited:
Level 9
Joined
May 21, 2014
Messages
580
Bump:

So my map still has the recurring problem as stated on the OP.

The test map given by LimitingBounds works, but not on my map after inserting the correct triggers in changing alliance.

EDIT:

I have set Gameplay Constants, Interface, Triggers (except changing alliance), Map Properties, Player Forces and settings to their DEFAULT STATE.

I can still see PROJECTILES on Fog of War AND Black Mask. What the hell is the deal with this? I used the default Watch Tower and I can really still see flying projectiles. All are in default, except the Object Manager and custom objects. Ugh... I'm really stumped.

I don't know what to do anymore.
 
Last edited:
Level 12
Joined
Nov 3, 2013
Messages
989
How about going about it in reverse? Make it so everyone are enemies from the beginning and then make the alliances through triggers.

Basically a workaround.
 
Level 19
Joined
Dec 12, 2010
Messages
2,074
scourge/sent players in dota occupied by players 0 and 6, they do have default AI just like any other AI slot. when observer ingame, sent/scourges switched for 13 & 14 slots, and 0 6 are observers. game sends observers for the first "unused" slots, thats why.

I've never seen any kind of projectiles issues in dota, although I didn't play with switch option much either. this case pretty unique, I'd say, since I've never met any kind of reports. Would you share the map?
 
Im using these for my map when player is switched to other team
works fine, no problem with vision, projectiles, try it

JASS:
function SetTwoPlayersEnemy takes integer p1, integer p2 returns nothing
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_PASSIVE, false)
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_HELP_REQUEST, false)
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_HELP_RESPONSE, false)
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_SHARED_XP, false)
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_SHARED_SPELLS, false)        
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_SHARED_VISION, false)
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_SHARED_CONTROL, false)        
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_SHARED_ADVANCED_CONTROL, false)
    // ------------- 2 sided  ---------------
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_PASSIVE, false)
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_HELP_REQUEST, false)
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_HELP_RESPONSE, false)
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_SHARED_XP, false)
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_SHARED_SPELLS, false)        
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_SHARED_VISION, false)
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_SHARED_CONTROL, false)        
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_SHARED_ADVANCED_CONTROL, false)
endfunction
//-----------------------------------------------------------------------------
function SetTwoPlayersAlly takes integer p1, integer p2 returns nothing
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_PASSIVE, true)
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_HELP_REQUEST, true)
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_HELP_RESPONSE, true)
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_SHARED_XP, true)
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_SHARED_SPELLS, true)
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_SHARED_VISION, true)
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_SHARED_CONTROL, false)
    call SetPlayerAlliance(Player(p1), Player(p2), ALLIANCE_SHARED_ADVANCED_CONTROL, false)
    // -----  must be 2-sided-------
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_PASSIVE, true)
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_HELP_REQUEST, true)
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_HELP_RESPONSE, true)
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_SHARED_XP, true)
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_SHARED_SPELLS, true)
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_SHARED_VISION, true)
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_SHARED_CONTROL, false)
    call SetPlayerAlliance(Player(p2), Player(p1), ALLIANCE_SHARED_ADVANCED_CONTROL, false)
endfunction
 
Level 9
Joined
May 21, 2014
Messages
580
Okay guys. I tried doing what you have suggested, and I was about to share the map until I found this fact:

I am seeing projectiles under fog because:
The other players that are allied to me and at the same time are allied to the enemy player will cause this effect.
Any player's unit/structure that was attacked or is attacking that meets the requirement above will make projectiles visible.


Solution:
Remove flexible and dynamic alliance changes that can be done anywhere in the game. It has its flaws and abuse to/for other players to begin with. The alliance must be set at the beginning and cannot be changed anymore.
OR I can remain with the current setup and see this as a feature, because basically it's a plausible thing to see what your allies can see except vision, but because it has flaws to begin with it isn't really that great...

Mark as solved! You guys are god sent. Thanks a lot.
 
Last edited:
Level 12
Joined
Nov 3, 2013
Messages
989
What about
  • Unit - Grant shared vision of (Triggering unit) to Player 1 (Red)
And there seems to be these two constants as well.

ALLIANCE_SHARED_VISION_FORCED

ALLIANCE_SHARED_VISION

There should be some way to not see projectiles of enemies allied to your ally, right?

I mean there's lots of maps with custom alliances, that plays for hours and hours. No way that nobody has noticed this before.
 
Level 9
Joined
May 21, 2014
Messages
580
What about
  • Unit - Grant shared vision of (Triggering unit) to Player 1 (Red)
And there seems to be these two constants as well.

ALLIANCE_SHARED_VISION_FORCED

ALLIANCE_SHARED_VISION

There should be some way to not see projectiles of enemies allied to your ally, right?

I mean there's lots of maps with custom alliances, that plays for hours and hours. No way that nobody has noticed this before.

Well... I'd love to see someone enlighten my statement more... How do I set this in a GUI trigger? I'd give those a try.

EDIT:
Let me correct my previous statement.
I am seeing projectiles under fog because:
The other players that are allied to me and at the same time are allied to the enemy player will cause this effect.
Any player's unit/structure that was attacked or is attacking that meets the requirement above will make projectiles visible.

Vision toggles do not matter between players who are engaging in alliances changes. Let me give an example instead.

Let us take these forces as our primary example in each scenario...
Allied Force 1: Red, Blue, Orange
Allied Force 2: Green


Scenario 1:
  • enemy
    • Events
      • Player - Player 1 (Red) types a chat message containing enemy as An exact match
    • Conditions
    • Actions
      • Player - Make Player 1 (Red) treat Player 2 (Blue) as an Enemy
      • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Enemy
Result:
Projectiles under fog of war will be seen. Why? Because there exists Orange, who is still allied to Blue; which means Orange has a vision around Blue. That said, Red is still allied to Orange; which means Red has a vision around Orange.

Scenario 2:
  • enemy
    • Events
      • Player - Player 1 (Red) types a chat message containing enemy as An exact match
    • Conditions
    • Actions
      • Player - Make Player 1 (Red) treat Player 2 (Blue) as an Enemy
      • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Enemy
      • Player - Make Player 6 (Orange) treat Player 1 (Red) as an Neutral with shared vision
      • Player - Make Player 1 (Red) treat Player 6 (Orange) as an Neutral with shared vision
      • Player - Make Player 6 (Orange) treat Player 2 (Blue) as an Neutral with shared vision
      • Player - Make Player 2 (Blue) treat Player 6 (Orange) as an Neutral with shared vision
Result:
Projectiles under fog of war will be seen. Why? Because there exists Orange, who has a vision around Blue and Red.

Scenario 3:
  • enemy
    • Events
      • Player - Player 1 (Red) types a chat message containing enemy as An exact match
    • Conditions
    • Actions
      • Player - Make Player 1 (Red) treat Player 2 (Blue) as an Enemy
      • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Enemy
      • Player - Make Player 6 (Orange) treat Player 1 (Red) as an Enemy with shared vision
      • Player - Make Player 1 (Red) treat Player 6 (Orange) as an Enemy with shared vision
      • Player - Make Player 6 (Orange) treat Player 2 (Blue) as an Enemy with shared vision
      • Player - Make Player 2 (Blue) treat Player 6 (Orange) as an Enemy with shared vision
Result:
Projectiles under fog of war will be seen. Why? Because there exists Orange, who has a vision around Blue and Red. I added Green player over this in the field of battle with Blue. Green's projectiles are also seen.

What can we say? It was not all about alliances all along, it was about the connection between players who has vision around another.If you noticed, Red can still see projectiles that are not directly related to him as a force (which is Green), but can still see projectiles. It was all about the vision... that acts like a plague. So long as a player treats somebody with shared vision (either ally, neutral, enemy), all players who treats the said player as well with shared vision will see projectiles under fog of war. I hope that was not confusing.

This setting was tested with Custom Forces though, with ALLIED and SHARE VISION checkboxes ticked.
Edit again: Using forces and custom forces changes nothing.
 
Last edited:
Status
Not open for further replies.
Top