Light Style© by Fisana

Jump to content


Photo

Stances


  • Please log in to reply
60 replies to this topic

#1 Mythos_Ruler

Mythos_Ruler

    Senator

  • WFG Retired
  • 14,966 posts

Posted 28 October 2010 - 12:50 PM

STANCES

Stances 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 Behaviors


Violent or Impetuous
Posted Image
Behavior: 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 Eager
Posted Image
Behavior: Will attack any enemy unit that wanders into vision range. Will not pursue enemy units out of vision range.

Defensive or Reluctant
Posted Image
Behavior: "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 Stand
Posted Image
Behavior: 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 Passive
Posted Image
Behavior: 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 by Mythos_Ruler, 09 July 2011 - 07:52 PM.
Removed the "Choosing a Stance" section.

  • 0

#2 Mythos_Ruler

Mythos_Ruler

    Senator

  • WFG Retired
  • 14,966 posts

Posted 28 October 2010 - 12:53 PM

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.
  • 0

#3 Kimball

Kimball

    Rise of the East

  • WFG Retired
  • 1,620 posts

Posted 28 October 2010 - 06:53 PM

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

Rob Kimball
Scion Development Producer (Rise of the East)

Posted Image Posted Image Posted Image Posted Image Posted Image Posted Image Posted Image


#4 Wijitmaker

Wijitmaker

    0 A.D. Old Timer

  • WFG Retired
  • 9,540 posts

Posted 28 October 2010 - 11:13 PM

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) :ok:

More info: http://trac.wildfire...ntity.Traits.AI
  • 1

Jason Bishop [ aka Wijitmaker ]

0 A.D. Founder

Contact me: jason@wildfiregames.com


#5 k776

k776

    Centurio

  • WFG Retired
  • 724 posts

Posted 29 October 2010 - 04:42 AM

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?).
  • 0

Kieran P [ aka k776 ]


#6 Kimball

Kimball

    Rise of the East

  • WFG Retired
  • 1,620 posts

Posted 29 October 2010 - 04:50 AM

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.
  • 0

Rob Kimball
Scion Development Producer (Rise of the East)

Posted Image Posted Image Posted Image Posted Image Posted Image Posted Image Posted Image


#7 Mythos_Ruler

Mythos_Ruler

    Senator

  • WFG Retired
  • 14,966 posts

Posted 29 October 2010 - 07:58 AM

Good thinking. Changed.
  • 0

#8 Mythos_Ruler

Mythos_Ruler

    Senator

  • WFG Retired
  • 14,966 posts

Posted 07 June 2011 - 07:13 PM

I moved this discussion to the development forum.
  • 0

#9 Badmadblacksad

Badmadblacksad

    Discens

  • WFG Retired
  • 35 posts

Posted 07 June 2011 - 09:15 PM

I thought I should link this thread to this trac ticket http://trac.wildfire...com/ticket/865

My 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 :)
  • 0

Martin F [ aka Badmadblacksad ]

Wildfire Games Programmer
Contact me: badmadblacksad@wildfiregames.com


Support Wildfire Games!


#10 Ykkrosh

Ykkrosh

    Primus Pilus

  • WFG Programming Team
  • 4,921 posts

Posted 08 June 2011 - 03:45 PM

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
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#11 Badmadblacksad

Badmadblacksad

    Discens

  • WFG Retired
  • 35 posts

Posted 17 June 2011 - 10:32 PM

Thanks for your answer Philip.
I commited a patch. Feel free to tell me / change all the things you don't like. :D
  • 0

Martin F [ aka Badmadblacksad ]

Wildfire Games Programmer
Contact me: badmadblacksad@wildfiregames.com


Support Wildfire Games!


#12 plumo

plumo

    Centurio

  • 0 A.D. Art Team
  • 979 posts

Posted 24 June 2011 - 03:47 PM

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?
  • 0
B. Guns [aka Plumo]
0 A.D. Community Liaison
Contact email: plumo@wildfiregames.com

#13 Mythos_Ruler

Mythos_Ruler

    Senator

  • WFG Retired
  • 14,966 posts

Posted 24 June 2011 - 03:50 PM

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.
  • 0

#14 plumo

plumo

    Centurio

  • 0 A.D. Art Team
  • 979 posts

Posted 24 June 2011 - 03:59 PM

Sounds good to me :) !
  • 0
B. Guns [aka Plumo]
0 A.D. Community Liaison
Contact email: plumo@wildfiregames.com

#15 Mythos_Ruler

Mythos_Ruler

    Senator

  • WFG Retired
  • 14,966 posts

Posted 24 June 2011 - 04:22 PM

Like this.

Click the sword/shield icon, which in this case should mean he is currently in Defensive stance.
Posted Image

Little menu pops open.
Posted Image

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.
  • 0

#16 plumo

plumo

    Centurio

  • 0 A.D. Art Team
  • 979 posts

Posted 24 June 2011 - 07:22 PM

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.
  • 0
B. Guns [aka Plumo]
0 A.D. Community Liaison
Contact email: plumo@wildfiregames.com

#17 Mythos_Ruler

Mythos_Ruler

    Senator

  • WFG Retired
  • 14,966 posts

Posted 24 June 2011 - 07:31 PM

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.
  • 0

#18 Pureon

Pureon

    Primus Pilus

  • 0 A.D. Art Team
  • 3,618 posts

Posted 24 June 2011 - 09:23 PM

I really like those stance icons. The icons could just toggle from one to the other, giving more space for other stuff.
  • 0

Pureon
0 A.D. Part time Designer / Texturer / 3D Artist
Contact email:
pureon{@}wildfiregames.com


#19 gudo

gudo

    Duplicarius

  • Community Members
  • PipPipPip
  • 239 posts

Posted 24 June 2011 - 09:37 PM

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.
  • 0
Did you contribute to 0 AD?
Make sure you're in the credits!


AI Players
JuBot | RootBot | SplitBot | qBot | Marilyn | arBot

#20 Jeru

Jeru

    Factotum

  • Web Development Team
  • 4,979 posts

Posted 24 June 2011 - 09:39 PM

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 (y)
  • 0

Aviv Sharon [ aka Jeru ]

Wildfire Games 0 A.D. PR & Social Media Contributor
Contact me:
E-mail & Google Talk: aviv dot sharon at gmail dot com
MSN: lc_jerusalem at hotmail dot com
Facebook, Twitter, LinkedIn