Mythos_Ruler Posted October 28, 2010 Report Share Posted October 28, 2010 (edited) STANCESStances are purely for behavioral purposes. Formations are for altering stats. Some Formations come with default Stances.Click Here for the Stances Trac Ticket.Stances and their BehaviorsViolent or ImpetuousBehavior: Will attack any enemy unit that wanders into vision range. Will relentlessly pursue retreating enemy units into the Shroud of Darkness for a short distance at a Run (depending upon stamina). Units in this stance tend to not hold their formation.Aggressive or EagerBehavior: Will attack any enemy unit that wanders into vision range. Will not pursue enemy units out of vision range.Defensive or ReluctantBehavior: "Default" stance. Will attack enemy units who come within half vision range distance. Will pursue the enemy until they leave that range. If no more enemies are within range they will return to their original positions.Stand Ground or Last StandBehavior: Will not move unless tasked to move or attack. Soldiers will not pursue enemy units and will only fight back when attacked or when their comrade next to them in formation is being attacked. This behavior is the default for the Testudo and Syntagma formations (and perhaps others).Avoid or PassiveBehavior: Default (and only) stance for support units. Will not attack. Runs away from enemy soldiers in the direction of the nearest Civ Centre or Fortress. A unit with this stance, if tasked to move, will attempt to avoid contact with enemy units. This is the default stance when the Scout command is given to cavalry; if scout(s) come under enemy fire they will attempt to circumnavigate that fire while at the same time completing their way pointed mission. If idle, and attacked, these scouts will run away in the direction of the player's nearest Civic Centre or Fortress. Edited July 9, 2011 by Mythos_Ruler Removed the "Choosing a Stance" section. Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted October 28, 2010 Author Report Share Posted October 28, 2010 A quick guide I whipped up. Subject to change based upon input from the team. I noticed that the Design Document in Trac no longer has information on such things. Quote Link to comment Share on other sites More sharing options...
Kimball Posted October 28, 2010 Report Share Posted October 28, 2010 2 things:In defensive mode, have units stop pursuing enemies once they exit the 10-tile radius. If they pursue them into the SoD, you may find a defensive unit wandering around the map if they're faster than the unit they're pursuing.In passive mode, units should still respond to being attacked. If they just stand there and let themselves be killed, there is no purpose to this stance. 1 Quote Link to comment Share on other sites More sharing options...
Wijitmaker Posted October 28, 2010 Report Share Posted October 28, 2010 A quick guide I whipped up. Subject to change based upon input from the team. I noticed that the Design Document in Trac no longer has information on such things.Nice guide(s) More info: http://trac.wildfiregames.com/wiki/XML.Entity.Traits.AI 1 Quote Link to comment Share on other sites More sharing options...
k776 Posted October 29, 2010 Report Share Posted October 29, 2010 Ideally, passive units should have more speed (+25%), and flee from the enemy.The scenario I'm thinking of is women. If they're attacked while farming, they drop what their doing, and run away (maybe town centre by default?). Quote Link to comment Share on other sites More sharing options...
Kimball Posted October 29, 2010 Report Share Posted October 29, 2010 Ideally, passive units should have more speed (+25%), and flee from the enemy.The scenario I'm thinking of is women. If they're attacked while farming, they drop what their doing, and run away (maybe town centre by default?).This. Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted October 29, 2010 Author Report Share Posted October 29, 2010 Good thinking. Changed. Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted June 7, 2011 Author Report Share Posted June 7, 2011 I moved this discussion to the development forum. Quote Link to comment Share on other sites More sharing options...
Badmadblacksad Posted June 7, 2011 Report Share Posted June 7, 2011 I thought I should link this thread to this trac ticket http://trac.wildfire...com/ticket/865My main concern is about the code in UnitAI.js which will grow steadily throughout the development process. If its not clean now, It will become a real mess over time.So, I've got a few questions concerning simulation:1/ Is there any requirement of maintaining C++ source as small as possible ? should I create new C++ functions when I need them or try to uses a javascript wrapper instead ?e.g. if a C++ function take entity's position as parameter but that it's easier for me to call it with entity's id, can I overdefine it and expose it ?2/ If I need to compute the distance between two entities, should I do it in CCmpPosition.cpp (+++), UnitAI.js (-) or in any helper.js (+?) file ?3/ Is it possible to see how much time takes UnitAI to run ? (benchmarking purpose)Theses questions will probably seems stupid, but.. need answers (I will take them as a guideline) in order to code remorseless and enjoying it Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted June 8, 2011 Report Share Posted June 8, 2011 1/ Is there any requirement of maintaining C++ source as small as possible ? should I create new C++ functions when I need them or try to uses a javascript wrapper instead ? e.g. if a C++ function take entity's position as parameter but that it's easier for me to call it with entity's id, can I overdefine it and expose it ?I prefer to keep the C++ interfaces simple, since that makes them easier to understand and to maintain, and then put the logic in the scripts since they're more flexible. Whenever you do anything with entity positions you have to check for e.g. !IsInWorld() and then respond in some appropriate way, and it's usually easier for the script to decide how to react than the C++ (since only the script knows the context in which it's running - maybe it will ignore the target, or maybe it will have remembered the last known position, or something). So I'd prefer not to pass entity IDs into C++ unless it's either necessary or hugely more convenient.2/ If I need to compute the distance between two entities, should I do it in CCmpPosition.cpp (+++), UnitAI.js (-) or in any helper.js (+?) file ?If it's a script that needs to know the distance, it's probably better to have the script do the computation (to keep the C++ interfaces simple; performance won't matter), and it should probably go in a new file in helpers/ since other code might want to use it (e.g. Attack.js already does some computing distances between units).3/ Is it possible to see how much time takes UnitAI to run ? (benchmarking purpose)Probably not with any accuracy at all. If you build in Debug mode then the F11 profiler should show script functions, but it disables the JIT so it's very unrepresentative. Alternatively you can do Engine.ProfileStart("some name") / Engine.ProfileStop() to explicitly add a region to the profiler tree (it'll be somewhere in the 'simulation update' branch, I think), though the profiler has some cost itself so it'll distort the results if you're timing very short intervals. 1 Quote Link to comment Share on other sites More sharing options...
Badmadblacksad Posted June 17, 2011 Report Share Posted June 17, 2011 Thanks for your answer Philip.I commited a patch. Feel free to tell me / change all the things you don't like. Quote Link to comment Share on other sites More sharing options...
plumo Posted June 24, 2011 Report Share Posted June 24, 2011 I love the Icons, Mythos Ruler. My only comment would be that the selected stance is not clear enough to see, compared to the other stances. Maybe make the Selected stance icon turn bigger than the others or make the colour difference bigger? Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted June 24, 2011 Author Report Share Posted June 24, 2011 I love the Icons, Mythos Ruler. My only comment would be that the selected stance is not clear enough to see, compared to the other stances. Maybe make the Selected stance icon turn bigger than the others or make the colour difference bigger?If I had my way, the stance you select will be easy to see because it's the only one you see. My idea is to click the icon next to the unit portrait, the stance icons pop up, you click one, then the stances go away and the one you chose is now the icon you originally clicked on. Quote Link to comment Share on other sites More sharing options...
plumo Posted June 24, 2011 Report Share Posted June 24, 2011 Sounds good to me ! Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted June 24, 2011 Author Report Share Posted June 24, 2011 Like this.Click the sword/shield icon, which in this case should mean he is currently in Defensive stance.Little menu pops open.Click.Then the menu goes away and the icon changes to what you clicked.The menu can pop up, down, left, right, I don't care. "Passive" would not need to be shown, since Passive is only a default behavior of support units and when you put Cavalry units in scout mode. Quote Link to comment Share on other sites More sharing options...
plumo Posted June 24, 2011 Report Share Posted June 24, 2011 Interesting, I agree it is well-placed there. But maybe you'll need another place then for the parameters like Attack damage, armour and range. Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted June 24, 2011 Author Report Share Posted June 24, 2011 Interesting, I agree it is well-placed there. But maybe you'll need another place then for the parameters like Attack damage, armour and range.Well, currently you mouseover to get the tooltip that tells you this. No reason we couldn't continue. Quote Link to comment Share on other sites More sharing options...
Pureon Posted June 24, 2011 Report Share Posted June 24, 2011 I really like those stance icons. The icons could just toggle from one to the other, giving more space for other stuff. Quote Link to comment Share on other sites More sharing options...
gudo Posted June 24, 2011 Report Share Posted June 24, 2011 Eh, could work. Might be a bit annoying to have to click three times to get to the "previous" stance. It would be great if, like Homeworld, stances were linked to some hotkeys. So whenever you pressed, say, F4, the selected unit would go to agressive. F5 would put them in Stand Ground, etc. Quote Link to comment Share on other sites More sharing options...
Jeru Posted June 24, 2011 Report Share Posted June 24, 2011 I really like those stance icons. The icons could just toggle from one to the other, giving more space for other stuff.There's a thought Quote Link to comment Share on other sites More sharing options...
Pureon Posted June 24, 2011 Report Share Posted June 24, 2011 Eh, could work. Might be a bit annoying to have to click three times to get to the "previous" stance.Left click for back, right click for forward. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted June 24, 2011 Report Share Posted June 24, 2011 I think the stance icons should always be shown, if possible. Either lined up next to the unit portrait or grouped with the formation panel (there's empty space there, too). Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted June 24, 2011 Author Report Share Posted June 24, 2011 I think the stance icons should always be shown, if possible. Either lined up next to the unit portrait or grouped with the formation panel (there's empty space there, too).This is possible (grouped with the formations), and one idea I had considered. Have to take a look at the formations to make sure there isn't an instance where we need the whole panel to show all the formations. If there is never an instance where the bottom row is taken, then let's put them there. Quote Link to comment Share on other sites More sharing options...
chaosislife Posted June 25, 2011 Report Share Posted June 25, 2011 With the formations is probably best since i just thought of another problem, how to set up the stances to work with a selection of units. It would be a horrible pain to have to set each units stance individually, especially if you wanted to switch an entire platoons stance just before they engage the enemy. Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted June 25, 2011 Author Report Share Posted June 25, 2011 Yes, of course you will be able to change the stance of multiple units at once. 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.