Simikolon Posted November 12, 2012 Report Share Posted November 12, 2012 Hi,we explored the task "Units stop the attack after changing formation" and therefore jumped into the UnitAI.The issue is that when doing an attack with a group of soldiers in some formation and changing the formation while they approach the target, the group will stop attacking and just take the new formation.Responsable for the bug are the not yet implemented parts in the formation cotnroller (orders "atack" , "heal", "gather", "gatherNearPosition", "retournResource" and "garrison") marked with TODOs. What is missing is always the approaching part. Adding this fixes the issue. Anyway, we have to make shure that the current order is finished (e.g. "atack": kill unit, then process next order), so we thought of adding a new state for this in the formation controller (e.g. "attacking"), where we then can finish the order if the target was killed.Hence, we would end up with 6 more states. Do you think it's possible to abstract from these 6 states to decrease complexity?Before implementing stuff we wanted to make shure that this approach is reasonable to the developers of this project that have contributed to it for a longer time.Yannick & Simon Quote Link to comment Share on other sites More sharing options...
leper Posted November 12, 2012 Report Share Posted November 12, 2012 Argh. (because I added a patch for review by another dev for most of those TODOs today)See ticket #1716 for the patch and some thoughts.Formations are pretty much in need of a nearly complete overhaul, as units should go into a column formation automatically when moving and formations like testudo or phalanx should have some bonuses. In the new formation system units shouldn't execute tasks on their own if they are in a formation (like the Total War games).#1624 could still be fixed now, if I haven't discouraged you. I believe the best starting place for this ticket would be helpers/Commands.js in the "formation" case. Adding a statement (to continue the execution of the order prior to changing the formation) after cmpFormation.MoveMembersIntoFormation(true); seems reasonable.If you want to do something else you could give #997 a try (just using domestic animals as a start).Also if you have got any questions join #0ad-dev on QuakeNet. Quote Link to comment Share on other sites More sharing options...
Simikolon Posted November 15, 2012 Author Report Share Posted November 15, 2012 We had a look at your patch and actually this is exactly how we would have done it and how we suggested to do it. This patch fixes the issue we described.However, unfortunately when testing the patch, we discovered that there are still issues when changing the formation more often during an attack. After changing it two or three times the units are just standing still and won't attack on their own anymore (usual aggressive behavior). They are not even defending their selves when being attacked.We had a detailed look at your changes and the UnitAI, but could not figure out why this happens. Maybe you have an idea?! Quote Link to comment Share on other sites More sharing options...
leper Posted November 15, 2012 Report Share Posted November 15, 2012 As I said above the formation change order isn't covered by that patch. I assume the best place to start fixing this is still Commands.js (see above).I assume (and I'm pretty sure that assumption is true as I don't believe that anyone has changed that code a lot since I last fixed at smaller problem with that a while back) that the issue with changing the formation is that the units get stuck in the MoveIntoFormation state (the actual name may differ) and they don't leave that state.You can check the current UnitAI state of a unit with the "Display selection state" option in the developer overlay ingame (Alt-D) Quote Link to comment Share on other sites More sharing options...
Simikolon Posted November 18, 2012 Author Report Share Posted November 18, 2012 As I said above the formation change order isn't covered by that patch. I assume the best place to start fixing this is still Commands.js (see above). ok sorry. checked it and it looks you are right. when the units are in the INDIVIDUAL.COMBAT.ATTACKING state and then get a command to move into formation they never leave this state again.we will try to fix this small issue. thanks for your help so far. Quote Link to comment Share on other sites More sharing options...
Simikolon Posted November 25, 2012 Author Report Share Posted November 25, 2012 Finally, we fixed the bug we initially wanted to fix (#1624). Based on your patch (leper) we introduced a new function in UnitAI to move into formation. Also we added a new order "MoveIntoFormationOrder"to the formation controller to apply a new formation. We did this for conceptual reasons, as changing the formation is now also treated as an order. We think that this is more consistent. We adapted the function MoveIntoFormation in Formation, which actually applies the formation, so it's possible now to get in formation without replacing all individual orders of the formation units. This is the actual fix for the bug #1624.We now would like to submit the patch as an update to leper's patch attaching it to #1716.Unfortunately we can not do so, since registering for the Trac was not yet successful, because we never get a confirmation email to verify our account (tried two different mail addresses). Quote Link to comment Share on other sites More sharing options...
leper Posted November 25, 2012 Report Share Posted November 25, 2012 Could you try it again? We've had some problems with trac recently, but it should work now. Otherwise you could attach the patch to a forum post (see 'More Reply Options'). Quote Link to comment Share on other sites More sharing options...
feneur Posted November 25, 2012 Report Share Posted November 25, 2012 It's the email provider that didn't like our automated emails, I sent him the information in a PM here though (We get an email whenever the server can't send a message through.) Quote Link to comment Share on other sites More sharing options...
leper Posted November 25, 2012 Report Share Posted November 25, 2012 Ah I thought it could have been bad luck with trying to register while trac ate the credential file. (Nice to know though) Quote Link to comment Share on other sites More sharing options...
feneur Posted November 25, 2012 Report Share Posted November 25, 2012 Ah I thought it could have been bad luck with trying to register while trac ate the credential file. (Nice to know though)It might have been one of the time, but GMX really doesn't like them, so we might even want to add that to the register page so people are aware of it before registering. Quote Link to comment Share on other sites More sharing options...
Simikolon Posted November 25, 2012 Author Report Share Posted November 25, 2012 Thanks, patch is submitted now! 1 Quote Link to comment Share on other sites More sharing options...
Simikolon Posted November 27, 2012 Author Report Share Posted November 27, 2012 Comments and reviews are highly appreciated Quote Link to comment Share on other sites More sharing options...
leper Posted November 27, 2012 Report Share Posted November 27, 2012 I'll review it this weekend, but from a quick look (assuming it works as advertised) it doesn't look to bad. Quote Link to comment Share on other sites More sharing options...
leper Posted December 2, 2012 Report Share Posted December 2, 2012 Thanks for the patch! Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted December 2, 2012 Report Share Posted December 2, 2012 Thanks for the patch! Great when its ready for SVN? Quote Link to comment Share on other sites More sharing options...
zoot Posted December 2, 2012 Report Share Posted December 2, 2012 Great when its ready for SVN?http://trac.wildfiregames.com/changeset/12911 Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted December 2, 2012 Report Share Posted December 2, 2012 http://trac.wildfire...changeset/12911 Thank you Zoot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.