Jump to content

Attack notification


Recommended Posts

If you just push once you've removed it from the C++ side, I'll do some other stuff for a while. We should still fix this:

Finally, this implementation suppresses repeated attack signals from the same location, so as to not inundate the player with warnings from the same battle, but not attack signals from the same unit. If the unit is moving (fleeing), it's conceivable that the player will get multiple warnings for the same skirmish.

Either you can have a crack at it, or I will do it when I get back.

Link to comment
Share on other sites

Also, I've been thinking that we should probably suppress the sound if the camera is already trained on the location where the attack is happening. This would require an engine function exposed to the GUI context that returns the current camera position. But if that is too difficult to implement, we'll just wait and see what others say.

Link to comment
Share on other sites

Well AoE doesnt, though the sound does start after about 1 or 2 seconds. I think if the player is maneuvering close to the enemy he may want to notified by sound immediately if any unit it attacked. Especially if the number of units is large and the camera view is large. The minimap's little blinking dot may not immediately attract attention.

Edited by madmax
Link to comment
Share on other sites

Ah yeah, the weapon sounds you mean. Hmm. Well the position of the camera is gettable I guess. Somewhere in CGameView there would probably be a function. I am not sure in terms of what it will return it though. Probably 3D co-ordinates which will need to be converted to the co-ordinates being used by the sim JS code.

Well lets see what others say about attack notification suppression in camera view.

I mean there are cases where its useful, like if the attack is happening on an entity at the edge of the map by say an archer while there are your own archers also firing at something in the middle of the screen. The player may not notice as the attacking weapon sound and the player's weapons sounds are the same...arrows whooshing through the air.

Edited by madmax
Link to comment
Share on other sites

Finally, this implementation suppresses repeated attack signals from the same location, so as to not inundate the player with warnings from the same battle, but not attack signals from the same unit. If the unit is moving (fleeing), it's conceivable that the player will get multiple warnings for the same skirmish. This should be fixed.

I've fixed the above thusly: https://github.com/z...254adced42f6877

If you agree with the change you can either generate a new patch against SVN and attach that on the ticket, or simply post this diff there: https://github.com/z...tification.diff

Edit: Actually, this solution has the unintended consequence that it stops the pinging after a while, even if a unit continues to be hit. I'll need to think about how to fix that and post another diff.

Edited by zoot
Link to comment
Share on other sites

Edit: Actually, this solution has the unintended consequence that it stops the pinging after a while, even if a unit continues to be hit. I'll need to think about how to fix that and post another diff.

Fixed the above like this: https://github.com/zootzoot/0ad/commit/82cbc564fbb7c172ba302138fb51365c880359f4

Latest diff: https://github.com/zootzoot/0ad/compare/attack-notification.diff

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Working on this one again today. Just updating my code from zoot's repo.

ok, right away I have messed up something. So for updating the code I switched to the attack-notification branch :

$ git checkout attack-notification

$ git pull zootzoot attack-notification

$ git pull k776-master master

abhi@ABHI-PC /f/Code/0ad/0ad (attack-notification|MERGING)

$ git pull k776-master master

The I realized I probably don't need to update from master as it will erase all changes from zootzoot. I knew it the minute I saw that curious MERGING thing at the branch name.

Now if I do

$ git pull zootzoot attack-notification

I get an error :

...

.....

M source/third_party/mongoose/mongoose.cpp

M source/tools/dist/build.sh

Pull is not possible because you have unmerged files.

Please, fix them up in the work tree, and then use 'git add/rm <file>'

as appropriate to mark resolution, or use 'git commit -a'.

How do I fix this now :(

I want to get back to the current state of the attack-notification branch which has pulled in all zoot's changes.

Edited by madmax
Link to comment
Share on other sites

ok, I did a git reset :

abhi@ABHI-PC /f/Code/0ad/0ad (attack-notification)

$ git reset

..

.....

abhi@ABHI-PC /f/Code/0ad/0ad (attack-notification)

$ git pull zootzoot attack-notification

From https://github.com/zootzoot/0ad

* branch attack-notification -> FETCH_HEAD

Already up-to-date.

abhi@ABHI-PC /f/Code/0ad/0ad (attack-notification)

$

So all seems good now. I ll check if I have zoot's latest changes.

Edited by madmax
Link to comment
Share on other sites

Hmm, that reset doesnt seem to have fixed it. The git diff is showing up a lot of changes that I never made. Maybe some other command is needed.

ok did a git checkout .

Phew, got to be more careful with this.

Edited by madmax
Link to comment
Share on other sites

Hmmm, I did a clean build, But I get a crash when I start the game, after the setup screen :


Much to our regret we must report the program has encountered an error.
Please let us know at http://trac.wildfiregames.com/ and attach the crashlog.txt and crashlog.dmp files.
Details: unhandled exception (Access violation reading 0x00000046)
Location: unknown:0 (?)
Call stack:
C7660C48

errno = 0 (No error reported here)
OS error = 126 (The specified module could not be found.)

Link to comment
Share on other sites

-quickstart disables the sound engine. There was a bug for a short while that caused this to segfault, but has since been fixed. It's possible that zoots code was added after the bug was introduced, but before it was fixed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...