entity.EntitySpecificOrders.Behavior = EntityBehaviorType.Guard_Guardian_Patrolling;
If there are any Friendly planets (ie a planet owned by a Friendly faction) under attack adjacent to this planet then always go to one of the planets being attacked. If there are no Friendly planets under attack, go to a random friendly planet X% of the time (currently X is 80).Does this work regardless of the Dyson's alignment? I.e. it will move to defend an AI planet that you are attacking, if it is friendly to the AI at the time? If so, awesome :) I'm not sure that it would be a real case under the rules as they stand (Dyson is only AI-ally if you own the Dyson's planet, so most of its stuff would be focused on freeing itself) but it's a good sort of emergent behavior.
Still todo: implement Dyson Antagonizer behaviour.I wouldn't worry about that for now.
A few additional questions. For being able to tune faction intensity, should I look to add an Intensity factor in External Code attached to a Faction? Or would it make more sense to have that be part of the Faction class itself? This is a code architecture question so I leave it to you, either way is fine by me.I'm currently working on the architecture for faction-specific per-faction settings like AIType, and intensity would go there too. I hope to have it released within 8 hours.
I have trouble with getting the patrol behaviour I want. I don't see a good mechanism for telling a ship to "wander around a planet". I tried the following with both Guardians and Fleetships but it doesn't seem to work.Right now there may be no EntityBehaviorType setting that does what you want. There are two general solutions to that:entity.EntitySpecificOrders.Behavior = EntityBehaviorType.Guard_Guardian_Patrolling;
Finally, would you prefer factions to use the buildingDronesInternally functionality or to spawn units directly in the C# code? Either one will work (though using buildingDronesInternally may require multiple XML entries for Dyson Spheres at different Intensity levels). Or some combination could be done.If the desired behavior is constant (like a Carrier Starship) and fits within the XML definition, put it there. If it doesn't fit, or it changes during the game in ways that can't be readily expressed in the XML, feel free to do it directly in code (obeying all the usual sync rules, etc).
I think trying to edit GameCommand objects and write my own is a bit tricky for me to figure out without greater insight into how they work (at the moment I only see how to use GameCommands to ship things between planets)Movement within a planet is simpler:
public static void Helper_SendMoveCommand( GameEntity entity, ArcenPoint Destination, bool isQueuedCommand )
{
GameCommand command = GameCommand.Create( GameCommandType.Move );
command.ToBeQueued = isQueuedCommand;
command.RelatedPoint = Destination;
command.RelatedEntityIDs.Add( entity.PrimaryKeyID );
World_AIW2.Instance.QueueGameCommand( command, true );
}
Is there a way to change the team_color of a faction in C#?Not currently, but I've added Faction.ChangeColor(TeamColorDefinition) for next time. Bear in mind that the team color will need to already be defined in the xml.
This has given me a few ideas about how to implement Human Resistance Fighters or Human Marauders, but frankly at this stage I think new content should be avoided. It's gonna be hard enough to balance and polish what already exists.Yea, extra factions isn't a current priority. But I know they're fun to work on, and modders who are having fun tend to be more helpful all around :)
I tweaked the radius of the Dyson Sphere, but the ships still spawn right in the center of the structure, well inside the radius of the structure.That's normal. Same thing happens when the Ark builds ships. The ships should fly out due to normal decollision logic, such that they are entirely outside the circle you see when mouseovering the unit, etc. Is that not happening?
For moving the Dyson Sphere around with SetWorldLocation, is there a mechanism to make sure it doesn't wind up too close to any of the AI structures? Would I have to compute the location of all the AI structures then find a suitable spot?You can call this function on planet:
ArcenPoint GetSafePlacementPoint( ArcenSimContext Context, GameEntityTypeData EntityTypeToPlace, ArcenPoint BasePoint, int MinDistance, int MaxDistance )
Also ships will fly from outside the Dyson Sphere radius back into it. It seems like the collision check isn't working.It only checks stationary things, which is why stuff can fly through other stuff in general. Collision checking that actually treats units as blocking other units from moving through them would basically break the game.
I would love it as a planet graphic rather than as a unit.Oh, me too.
I'm currently working on the architecture for faction-specific per-faction settings like AIType, and intensity would go there too. I hope to have it released within 8 hours.This statement naturally doomed any chance of it being released within 8 hours, so it's looking like tomorrow. But I do have AIType selection working now, as a custom field specific to the "AI" faction type, and an alternative AI type with an apt internal-name of "Annoying".
Human Remnant?! AI Sentinels?!?!Sorry for getting your hopes up, those are just the names I put in for the Human (i.e. player) faction and the AI faction :)
This release can't come soon enough!
You meant I should check EntityOrderCollection.QueuedOrders.Count, right? It doesn't seem to have an Orders field.Yea, QueuedOrders.
Okay great, the QueuedOrders check seems quite straightforward.Glad it's working out.
entity.EntitySpecificOrders.ClearOrders();
entity.EntitySpecificOrders.QueueOrder( EntityOrder.Create_Move( somePointOnThisPlanet, false ));
// if multi-point path desired, make more calls to QueueOrder
I don't intend any further changes for behaviour at this time. If you feel happy with things as they are then I'll start investigating balance.It sounds fine, I just need to finish my current wrestle-ui-into-submission match with the lobby stuff and get this release out before I spend time in that direction.
Also, Dyson Ships will definitely sometimes destroy planetary controllers or warp gates.Odd. I'm assuming this happens with direct-target weapons, not just area-of-effect weapons? The don't-kill-it logic should apply to both, but it's somewhat different code paths.
You guys probably want to bump the release up from the .500 series soon too. The game has come an incredible distance from .500 to where it is now and you should be proud of it!Not until the UI is made less visually awful :)
I observe that sometimes with my current code ships will get stuck trying to go through a wormhole to an AI planet. They just pile up on one side of the wormhole waiting to go through. Now, intriguingly, if I change the faction relationships to make the AI friends with the Dyson Sphere then the ships go through without a problem (it doesn't matter whether the Dyson Sphere likes the AI or not).That's probably the threat waiting behavior, same as when the AI has its ships pile up before going after you, rather than trickling them in like lambs to the slaughter.
Whoops. I renamed NanocaustUtilityMethods in SpecialFactions/Nanocaust.cs to BadgerUtilityMethods. Just rename it, then so a search/replace through Nanocaust.cs to change NanocaustUtility to BadgerUtility.
for(int j = 0; j < 10; i++)
FYI, when you write something likefor(int j = 0; j < 10; i++)
It runs for a very long time ;)
I mean, you could always use var ? = 0 instead.For a moment I was thinking "wow, I know 'var' is there when you can't be arsed to declare a type, but I didn't know they had '?' for when you can't be arsed to declare a name".
Edit, boo, the forum did not like that character. BOO.
For a moment I was thinking "wow, I know 'var' is there when you can't be arsed to declare a type, but I didn't know they had '?' for when you can't be arsed to declare a name".
Nah, that's for the PowerShell version of C#, where $_ basically means "whatever is currently important".I mean, you could always use var ? = 0 instead.For a moment I was thinking "wow, I know 'var' is there when you can't be arsed to declare a type, but I didn't know they had '?' for when you can't be arsed to declare a name".
Edit, boo, the forum did not like that character. BOO.