Jump to content

Freagarach

WFG Programming Team
  • Posts

    1.126
  • Joined

  • Last visited

  • Days Won

    18

Posts posted by Freagarach

  1. 8 minutes ago, wowgetoffyourcellphone said:

    Them using a bow for hunting could work though if we ever got dual attacks implemented.

    But don't let them use their bow and arrow for hunting and a dagger for defending, AoE-II did that for villies and it looks really weird ;)

    Perhaps we can give hunters a pelt over the back of their horse or something?

  2. On 22/02/2021 at 1:48 PM, faction02 said:

    Woodcutting behavior is sometimes "weird".

    IT seems that when a tree is depleted, the units are searching for the next nearest tree to the spot where the last tree was rather than the most efficient one (the nearest tree to the dropsite). 

    As a result, units are sometimes drawn far away from the forest by a couple of isolated trees.

     

    Fixed in SVN (so for A25).
    (For fun: it was commit r25000.)

    • Like 2
  3. UnitAI \o/

    Spoiler

    Include a file in your components folder, called UnitAI_DE.js (or something alike), with the following content:

    Spoiler
    
    
    UnitAI.prototype.GetQueryRange = function(iid)
    {
    	let ret = { "min": 0, "max": 0 };
    
    	let cmpVision = Engine.QueryInterface(this.entity, IID_Vision);
    	if (!cmpVision)
    		return ret;
    	let visionRange = cmpVision.GetRange();
    
    	if (iid === IID_Vision)
    	{
    		ret.max = visionRange;
    		return ret;
    	}
    
    	if (this.GetStance().respondStandGround)
    	{
    		let range = this.GetRange(iid);
    		if (!range)
    			return ret;
    		ret.min = range.min;
    		ret.max = Math.min(range.max, visionRange);
    	}
    	else if (this.GetStance().respondChase)
    		ret.max = visionRange * 0.9; // << This has changed.
    	else if (this.GetStance().respondHoldGround)
    	{
    		let range = this.GetRange(iid);
    		if (!range)
    			return ret;
    		ret.max = Math.min(range.max + visionRange / 2, visionRange);
    	}
    	// We probably have stance 'passive' and we wouldn't have a range,
    	// but as it is the default for healers we need to set it to something sane.
    	else if (iid === IID_Heal)
    		ret.max = visionRange;
    
    	return ret;
    };

    Note this also affects violent stance.

     

     

    • Thanks 1
  4. 6 hours ago, wowgetoffyourcellphone said:

    Can I advocate once again for an "aggression range" that is separate from vision range? It's the range by which a unit will actively attack another unit or structure. It can be a separate number or a percentage of vision range (kinda like the relationship between walk speed and run speed). Stances would then adjust this range. So, Aggressive would be at 90% of vision range, Defensive would be at 50% of vision range. Point would be to make units easier to control and act less maniacally. 

    This is already how it works in-game? Just that violent and aggressive is 100% vision range, but violent will keep chasing when the player still sees the adversary. Defensive has a query range of 50% of the vision range :)

    That being said, improvements can be done for sure.

  5. 8 hours ago, Stan` said:

    Edwarf had a good point: adding meat decaying will reduce micro a lot (which may or may not be a good thing with regards to hunting). Previously one could attack multiple targets then gather food. Now to prevent decaying as much as possible one will have a lot of gatherers on one single target, to maximise food income.

    So, it _adds_ a lot of micro? You need to be sure to have as many entities on one animal as possible, else you're being inefficient?

    About the templates, the state can be one or more of "alive", "dead", "gathered", "notGathered" and they can be mixed and matched. (So we can let animals fatten when alive and decay when dead and not being gathered from, or farms grow when being tended (gathered) and grow much slower when not.)

  6. Not too hard (tm). It needs a change in:

    binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/PerPlayer/Dropdowns/PlayerCiv.js:onPickRandomItems()

    and an property to

    binaries/data/mods/public/simulation/data/civs/{civ}.json

    added.

×
×
  • Create New...