Jump to content

madmax

Community Members
  • Posts

    165
  • Joined

  • Last visited

Posts posted by madmax

  1. Yeah, I am actually having trouble trying to make the dots blink fast enough since I put in the logic for time based blinking. Maybe its due to the unit's movement too. I will check that.

    Its probably better if I let the blinking happen per frame(color changes in each frame), with perhaps some sort of parameter that controls whether its every 1 frame, or every 2 frames ....etc.

    Then that parameter, read from the config file will allow control over the rate of blinking and should serve our purpose for now. At least till we have some sort of animation going.

    I was thinking of the attack notification animation on the minimap. We can probably start with a simple circle that encircles the main attacking area & blinks rapidly.

  2. ok, why is that ? I mean why cant it be automated too.

    So I just ran update-workspaces.bat --atlas

    Then tried building. Got an error :


    1>------ Build started: Project: AtlasScript, Configuration: Release Win32 ------
    2>------ Build started: Project: AtlasObject, Configuration: Release Win32 ------
    1> ScriptInterface.cpp
    2> AtlasObjectJS.cpp
    1>..\..\..\source ools\atlas\AtlasScript\ScriptInterface.cpp(34): fatal error C1083: Cannot open include file: 'wx/wx.h': No such file or directory
    2>..\..\..\source ools\atlas\AtlasObject\AtlasObjectJS.cpp(27): fatal error C1083: Cannot open include file: 'wx/log.h': No such file or directory
    3>------ Build started: Project: AtlasUI, Configuration: Release Win32 ------
    4>------ Build started: Project: test, Configuration: Release Win32 ------
    3> precompiled.cpp
    3>f:\code\0ad\0ad\source ools\atlas\atlasui\misc\precompiled.h(47): fatal error C1083: Cannot open include file: 'wx/wxprec.h': No such file or directory
    4> test_root.cpp
    5>------ Build started: Project: ActorEditor, Configuration: Release Win32 ------
    5>LINK : fatal error LNK1181: cannot open input file '..\..\..\binaries\system\AtlasUI.lib'
    4>LINK : fatal error LNK1181: cannot open input file '..\..\..\binaries\system\AtlasObject.lib'
    ========== Build: 0 succeeded, 5 failed, 13 up-to-date, 0 skipped ==========

  3. Are you seeing it ?

    Hmm, so about the blinking code for the Minimap :


    virtual bool CheckPing(void)
    {
    double currentTime = timer_Time();
    double dt = currentTime - m_PingStartTime;
    if (dt > m_PingDuration)
    {
    m_IsPinging = false;
    m_PingStartTime = 0;
    m_LastBlinkStartTime = m_PingStartTime;
    }
    dt = currentTime - m_LastBlinkStartTime;
    // Return true for dt > 0 && dt < m_HalfBlinkDuration
    if (dt < m_HalfBlinkDuration)
    return true;
    // Reset if this blink is complete
    if (dt > m_BlinkDuration)
    m_LastBlinkStartTime = currentTime;
    // Return false for dt >= m_HalfBlinkDuration && dt < m_BlinkDuration
    return false;
    }

    Basically CheckPing() returns true if the time elapsed since the current blink was started is less then 1/2 the blink duration. If CheckPing() returns true then the renderer draws in white. CheckPing() is called at the frame rate whenever the Minimap is drawn.

    It can happen though that CheckPing() is called so slowly (very slow frame rate) that the time elapsed is always greater than 1/2 the blink duration. Then CheckPing() never returns true and no blinking is seen. So the user would need to raise the blinkduration in the cfg file. Which is kind of not ideal :closedeyes:

  4. Sure. By the way, I was trying to launch Atlas to create a simple map with just 2 entities to make debugging simpler. Seem to run into an error :


    The Atlas UI was not successfully loaded and therefore cannot be started as requested.
    Location: Atlas.cpp:46 (ATLAS_Run)
    Call stack:
    (error while dumping stack: No stack frames found)
    errno = 0 (No error reported here)
    OS error = 126 (The specified module could not be found.)

  5. ok, I am trying a clean recompile now, lets hope it fixes it.

    This is what happened after I updated last :


    abhi@ABHI-PC /f/Code/0ad/0ad (attack-notification)
    $ git log --branches --not --remotes --simplify-by-decoration --decorate --oneline
    abhi@ABHI-PC /f/Code/0ad/0ad (attack-notification)
    $ git pull zootzoot attack-notification
    remote: Counting objects: 33, done.
    remote: Compressing objects: 100% (9/9), done.
    remote: Total 20 (delta 14), reused 17 (delta 11)
    Unpacking objects: 100% (20/20), done.
    From https://github.com/zootzoot/0ad
    * branch attack-notification -> FETCH_HEAD
    Updating ede7f18..7fffc7f
    Fast-forward
    binaries/data/config/default.cfg | 1 +
    binaries/data/mods/public/gui/session/messages.js | 13 ++++++-------
    binaries/data/mods/public/simulation/components/Armour.js | 2 +-
    3 files changed, 8 insertions(+), 8 deletions(-)
    abhi@ABHI-PC /f/Code/0ad/0ad (attack-notification)
    $ git diff
    abhi@ABHI-PC /f/Code/0ad/0ad (attack-notification)
    $

  6. ok, I am still getting js errors :( :(, should I pull from k776-master

    It was created as follows :

    git remote add k776-master https://github.com/0ad/0ad.git

    So I run this perhaps :

    git pull k776-master master

    I already pulled from :

    git pull zootzoot attack-notification

    It was created as :

    git remote add zootzoot https://github.com/zootzoot/0ad.git

    I see the 'source' argument added in Armour.js. I though if I pull from : git pull zootzoot attack-notification

    that will include the master changes too ? But maybe it does not.

    Yeah for that the blinking dots have to be drawn last. Probably they can be collected in a new vertex array and sent to the gpu after the current vertices which are for non-blinking players.

    It would be good to have some input on this graphical problem from someone more familiar with minimap drawing. Do I add another VertexArray member in Minimap.h & use it ? This has to be done in the most efficient possible way for the GPU.

    interestinglog.html

  7. ok, its just a comment, I am accepting it :


    Armour.prototype.SetInvulnerability = function(invulnerability)
    {
    this.invulnerable = invulnerability;
    };
    <<<<<<< HEAD
    Armour.prototype.TakeDamage = function(hack, pierce, crush, source)
    =======
    /**
    * Take damage according to the entity's armor.
    * Returns object of the form { "killed": false, "change": -12 }
    */
    Armour.prototype.TakeDamage = function(hack, pierce, crush)
    >>>>>>> 5e04aea6bbce9aba0accf2b411acb17621df8cf4
    {

    I have made it like this :


    Armour.prototype.SetInvulnerability = function(invulnerability)
    {
    this.invulnerable = invulnerability;
    };
    /**
    * Take damage according to the entity's armor.
    * Returns object of the form { "killed": false, "change": -12 }
    */
    Armour.prototype.TakeDamage = function(hack, pierce, crush)
    {
    // Alert target owner of attack
    var cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership);
    var cmpAttackDetection = QueryPlayerIDInterface(cmpOwnership.GetOwner(), IID_AttackDetection);
    var cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);

    OK, I pushed my changes to the 2 files. I am still getting a large number of Javascript errors.

    interestinglog.html

  8. ok, there also seems to be a conflict in Armour.js Is that resolved ? How do I resolve it, now that I have pulled from the master :


    abhi@ABHI-PC /f/Code/0ad/0ad (attack-notification)
    $ git pull k776-master master
    remote: Counting objects: 2669, done.
    remote: Compressing objects: 100% (1035/1035), done.
    remote: Total 2041 (delta 1370), reused 1658 (delta 995)
    Receiving objects: 100% (2041/2041), 12.79 MiB | 306 KiB/s, done.
    Resolving deltas: 100% (1370/1370), completed with 337 local objects.
    From https://github.com/0ad/0ad
    * branch master -> FETCH_HEAD
    Performing inexact rename detection: 100% (18204/18204), done.
    Auto-merging source/soundmanager/scripting/SoundGroup.h
    Auto-merging source/soundmanager/scripting/SoundGroup.cpp
    Removing source/soundmanager/js/SoundPlayer.h
    Removing source/soundmanager/js/SoundPlayer.cpp
    Removing source/soundmanager/js/Sound.h
    Removing source/soundmanager/js/Sound.cpp
    Removing source/soundmanager/js/MusicSound.h
    Removing source/soundmanager/js/MusicSound.cpp
    Removing source/soundmanager/js/MusicList.h
    Removing source/soundmanager/js/MusicList.cpp
    Removing source/soundmanager/js/AmbientSound.h
    Removing source/soundmanager/js/AmbientSound.cpp
    Auto-merging source/gui/MiniMap.h
    Auto-merging source/gui/MiniMap.cpp
    CONFLICT (content): Merge conflict in source/gui/MiniMap.cpp
    Auto-merging binaries/data/mods/public/simulation/templates/template_unit_infantry.xml
    Auto-merging binaries/data/mods/public/simulation/templates/template_unit_champion.xml
    Auto-merging binaries/data/mods/public/simulation/templates/template_unit_cavalry.xml
    Auto-merging binaries/data/mods/public/simulation/templates/template_unit.xml
    Auto-merging binaries/data/mods/public/simulation/templates/template_structure_economic_storehouse.xml
    Auto-merging binaries/data/mods/public/simulation/templates/template_structure.xml
    Auto-merging binaries/data/mods/public/simulation/templates/structures/spart_storehouse.xml
    Auto-merging binaries/data/mods/public/simulation/templates/structures/rome_storehouse.xml
    Auto-merging binaries/data/mods/public/simulation/templates/structures/pers_storehouse.xml
    Auto-merging binaries/data/mods/public/simulation/templates/structures/maur_storehouse.xml
    Auto-merging binaries/data/mods/public/simulation/templates/structures/mace_storehouse.xml
    Auto-merging binaries/data/mods/public/simulation/templates/structures/iber_storehouse.xml
    Auto-merging binaries/data/mods/public/simulation/templates/structures/hele_storehouse.xml
    Auto-merging binaries/data/mods/public/simulation/templates/structures/gaul_storehouse.xml
    Auto-merging binaries/data/mods/public/simulation/templates/structures/celt_storehouse.xml
    Auto-merging binaries/data/mods/public/simulation/templates/structures/cart_storehouse.xml
    Auto-merging binaries/data/mods/public/simulation/templates/structures/brit_storehouse.xml
    Auto-merging binaries/data/mods/public/simulation/templates/structures/athen_storehouse.xml
    Auto-merging binaries/data/mods/public/simulation/templates/special/player.xml
    Auto-merging binaries/data/mods/public/simulation/components/Attack.js
    Auto-merging binaries/data/mods/public/simulation/components/Armour.js
    CONFLICT (content): Merge conflict in binaries/data/mods/public/simulation/components/Armour.js
    Removing binaries/data/mods/public/gui/text/tips/mills.txt
    Auto-merging binaries/data/mods/public/gui/session/messages.js
    Auto-merging binaries/data/mods/public/audio/interface/select/building/sel_storehouse.xml
    Removing binaries/data/mods/public/audio/interface/select/building/sel_mill.ogg
    Auto-merging binaries/data/mods/public/audio/interface/complete/building/complete_storehouse.xml
    Removing binaries/data/mods/public/audio/interface/complete/building/complete_mill.ogg
    Removing binaries/data/mods/public/art/textures/skins/props/shield/mace_silver_c.dds
    Removing binaries/data/mods/public/art/textures/skins/props/shield/mace_silver_b.dds
    Removing binaries/data/mods/public/art/textures/skins/props/shield/mace_silver_a.dds
    Auto-merging binaries/data/mods/public/art/actors/structures/romans/storehouse.xml
    Auto-merging binaries/data/mods/public/art/actors/structures/persians/storehouse.xml
    Auto-merging binaries/data/mods/public/art/actors/structures/mauryans/storehouse.xml
    Auto-merging binaries/data/mods/public/art/actors/structures/iberians/storehouse.xml
    Removing binaries/data/mods/public/art/actors/structures/hellenes/mill.xml
    Auto-merging binaries/data/mods/public/art/actors/structures/celts/storehouse.xml
    Auto-merging binaries/data/mods/public/art/actors/structures/carthaginians/storehouse.xml
    Removing binaries/data/mods/public/art/actors/structures/athenians/mill.xml
    Auto-merging binaries/data/mods/public/art/actors/props/structures/romans/storehouse.xml
    Auto-merging binaries/data/mods/public/art/actors/props/structures/persians/storehouse.xml
    Auto-merging binaries/data/mods/public/art/actors/props/structures/mauryans/storehouse_props.xml
    Auto-merging binaries/data/mods/public/art/actors/props/structures/iberians/storehouse.xml
    Auto-merging binaries/data/mods/public/art/actors/props/structures/hellenes/storehouse_wood.xml
    Auto-merging binaries/data/mods/public/art/actors/props/structures/hellenes/storehouse_roof.xml
    Auto-merging binaries/data/mods/public/art/actors/props/structures/hellenes/storehouse_props.xml
    Auto-merging binaries/data/mods/public/art/actors/props/structures/hellenes/storehouse_blocks.xml
    Auto-merging binaries/data/mods/public/art/actors/props/structures/celts/storehouse_shield.xml
    Auto-merging binaries/data/mods/public/art/actors/props/structures/celts/storehouse_2.xml
    Auto-merging binaries/data/mods/public/art/actors/props/structures/celts/storehouse_1.xml
    Auto-merging binaries/data/mods/public/art/actors/props/structures/carthaginians/storehouse.xml
    Auto-merging binaries/data/config/default.cfg
    Automatic merge failed; fix conflicts and then commit the result.
    abhi@ABHI-PC /f/Code/0ad/0ad (attack-notification|MERGING)
    $


    # Unmerged paths:
    # (use "git add <file>..." to mark resolution)
    #
    # both modified: binaries/data/mods/public/simulation/components/Armour.js
    # both modified: source/gui/MiniMap.cpp
    #

  9. Zoot,

    I have pushed the latest changes. Once you confirm, I ll send out a patch.

    Blinking red is confusing with red being a typical player color, white might work better (and some other rendering enhancements in the future) - done

    The interface of ICmpMinimap::GetRemainingPingCount()/SetRemainingPingCount() is awkward and only used in one place, could that be replaced by a single Ping() function that checks and decrements the counter? - done

    More importantly, pinging is tied into the framerate, so at high framerates it will blink too fast, on low framerates it will appear to not blink at all, and also it will blink for a much shorter time at high framerates and much longer at low framerates. I think it should use time instead and measure time between minimap draw calls.

    -done

    Can't the "attacked" sound group be added to the parent template_unit.xml instead of all the inheriting templates?

    - done

    CCmpMinimap::m_PingEntity is a confusing name because it's type bool not entity_id_t that might be expected. Could it be named m_IsPinging instead? Similarly, IsEntityPinging() could be simplified to IsPinging(), since it's a component it will of course be an entity :) - done

    Speaking of configuration, it occurred to me that adjusting how long the attack notifications ping on the minimap would be a useful option, and that is certainly possible (in C++). I believe the function to do that is CFG_GET_VAL. - done

    Braces should go on line by themselves, see lines 476,483 in MiniMap.cpp - fixed

    Something else I thought about, CCmpMinimap should serialize its pinging state. That way saving and reloading won't lose active notifications. I forgot to test this when I had the patch applied, but looking at the code it seems that is missing. Can you confirm? Try quicksave/quickload (Shift+F5, Shift+F8) - Serialized ping state

    https://github.com/laxmax/0ad/commits/attack-notification

  10. 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.)

×
×
  • Create New...