Author Topic: Dyson Sphere tweaks  (Read 16340 times)

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Dyson Sphere tweaks
« Reply #15 on: October 17, 2017, 04:56:20 pm »
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".

"So I hear you like bashing through ludicrous quantities of shields..."

This pattern would be followed by other faction-specific fields like intensity (for the dyson sphere) and starting alignment (for stuff like the neinzul roaming enclaves, if we wind up with an equivalent of those here: rather than having one faction produce 3 different alignments of units, you can add multiple factions of that type, each with different alignments, intensities, etc).
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: Dyson Sphere tweaks
« Reply #16 on: October 17, 2017, 05:36:24 pm »
Neat!

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: Dyson Sphere tweaks
« Reply #17 on: October 17, 2017, 05:49:13 pm »
So I think I figured out the GameCommand thing. So I can get a ship on a planet and queue up a few commands. But is there a mechanism to tell when there are no active move commands for a patrolling GameEntity so I can give it some additional commands? Otherwise I just have to queue up a very large number of commands and hope the ship doesn't run out before the code wants to send it to another planet.

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: Dyson Sphere tweaks
« Reply #18 on: October 17, 2017, 11:23:12 pm »
I found an adequate hack that involves setting the entity Behaviour to know whether I should send it on patrol, and resetting it on a regular basis to make sure a unit never runs out of things to do. It's not great or usable elsewhere in the code base, but it suffices.

This patch will very pleasantly update the Dyson Sphere behaviour. I also implemented how the Dyson Sphere can handle a DysonAntagonizer, though there is not an Antagonizer in the game yet. There are no current balance or XML changes, but I felt it was more important to get a foundation on which to build balance.

Patch submitted for review.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Dyson Sphere tweaks
« Reply #19 on: October 18, 2017, 04:57:18 pm »
To see if it still has points you can check its EntityOrderCollection for Orders.Count > 0, or check to see which orders those are, etc.

We'll eventually want to move logic of the kind you're talking about into behaviors, but I'm glad you've found a solution for the meantime :)

Still wrestling with the AI-types-in-the-lobby thing. Actually that part is working but now I'm trying to change how you add special factions (so their per-faction controls are handled similarly to the AI's) and I'm wrestling with some obscure UI bug that's making another dropdown not really respond to selection changes. UI debugging always takes forever, especially when I can't find any code that's actually getting called by the on-change event. Plenty of code that _should_ be executing, but none that is.

Screenshot attached of the current lobby state
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: Dyson Sphere tweaks
« Reply #20 on: October 18, 2017, 05:28:07 pm »
Human Remnant?! AI Sentinels?!?!

This release can't come soon enough!

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Dyson Sphere tweaks
« Reply #21 on: October 18, 2017, 09:02:56 pm »
Human Remnant?! AI Sentinels?!?!

This release can't come soon enough!
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 :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: Dyson Sphere tweaks
« Reply #22 on: October 18, 2017, 09:53:11 pm »
You meant I should check EntityOrderCollection.QueuedOrders.Count, right? It doesn't seem to have an Orders field.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Dyson Sphere tweaks
« Reply #23 on: October 18, 2017, 10:27:28 pm »
You meant I should check EntityOrderCollection.QueuedOrders.Count, right? It doesn't seem to have an Orders field.
Yea, QueuedOrders.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: Dyson Sphere tweaks
« Reply #24 on: October 19, 2017, 12:01:36 am »
Okay great, the QueuedOrders check seems quite straightforward. Here's a version that uses that check instead. I also slightly modified the percentages for Dyson Ship movement and moved the tunings for that to be globals. Feel free to tweak those numbers. 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. Otherwise, give me some feedback on how it can be improved! I hope I at least captured some of the spirit of the original Sphere.

Also, Dyson Ships will definitely sometimes destroy planetary controllers or warp gates. I'm not sure how to go about debugging that further, but I definitely observe it happening. It feels pretty random though. I've started the same game (same map, same seed) repeatedly and observed different behaviours. Some sort of race condition?

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!

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Dyson Sphere tweaks
« Reply #25 on: October 19, 2017, 10:16:27 am »
Okay great, the QueuedOrders check seems quite straightforward.
Glad it's working out.

By the way, if you're working with non-player-controlled units, and you're in the per-sim-step logic (not the long-range-planning logic), you can just do something like this:

Code: [Select]
entity.EntitySpecificOrders.ClearOrders();
entity.EntitySpecificOrders.QueueOrder( EntityOrder.Create_Move( somePointOnThisPlanet, false ));
// if multi-point path desired, make more calls to QueueOrder

Quote
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.

Quote
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.

Quote
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 :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: Dyson Sphere tweaks
« Reply #26 on: October 24, 2017, 02:47:27 pm »
Okay, here's a real first pass at things. All the tuning/balance should in theory be doable in the XML now (specifically ExternalConstants/Dyson_Constants.xml).
The primary difference with the previous pass are that the ship spawns are done in C# now. At the moment I think the Dyson Sphere is perhaps underpowered. It definitely should be incapable of freeing itself from the AI and wrecking havoc on the galaxy without human aid, but I think it could become a powerful ally. Unfortunately I don't have any saved games far enough in to check how powerful it will feel.

   
Here's how it works right now. The Dyson Sphere spawns ships with the BaseDysonSpawn tag.
The actual ship creation is done in C# so there's more fine-grained control over what's happening.
   
The Dyson sphere spawns ships at different rates depending on who owns the planet.
The Dyson Sphere spawns ships slowly when it's on an AI planet.
If the humans liberate the sphere then the Dyson Sphere will spawn faster to help against the AI.
If the humans capture the planets then the Sphere will spawn units very quickly to get rid of the humans.
The above spawn rates are tunable in the XML.
   
Sometimes the Dyson sphere will do a "Big Spawn", where it will spawn a bunch of ships instead of just 1.
The rate and size of these larger spawns is tunable in the XML.
   
Once a ship is created it will Patrol the planet it's on for a while; this time is tunable in the XML.
   
When the ship decides to move, it will examine its neighbors and choose where to go. The chance of moving to a given planet is tunable in the XML. If a "patrol friendly factions only" behaviour is desired, for example, then change the percentMoveFriendly to 100. Here is the algorithm for how it picks the planet to move to.

First, if the ship is next to a Friendly planet that is under attack, always go there.
Then check if it wants to go to a friendly planet.
If it doesn't want to go to a friendly planet, check if it wants to go to a Neutral planet.
If it doesn't want to go to a neutral planet, check if it wants to go to a weakly defended Hostile planet.
If it doesn't want to do that, pick a planet at random.

Note there are some changes in Nanocaust files because I track "Last time a ship was spawned" in ExternalData and use the same code for the Nanocaust. The nanocaust C# spawning code isn't sufficiently polished to hand over yet though.
« Last Edit: November 03, 2017, 05:39:55 pm by BadgerBadger »

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: Dyson Sphere tweaks
« Reply #27 on: November 01, 2017, 12:00:31 pm »
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).

Does anyone have any clever ideas as to what's happening? The fact that everything works perfectly if I make the AI like the Dyson Sphere is really confusing.

Edit: Also, for Keith, if I have the Dyson Sphere only spawn single-target ships then they will not kill the controller. Area of effect damage (self destruction guardians, lightning guardians, etc) will take out the Planetary Controller even if it's not supposed to. I ran two experiments, one where I only spawned laser guardians and one with laser guardians and lightning guardians being spawned. When I spawned lightning guardians the planetary controller was killed even with GetShouldAttackNormallyExcludedTarget returning false always.
« Last Edit: November 01, 2017, 12:35:09 pm by BadgerBadger »

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Dyson Sphere tweaks
« Reply #28 on: November 01, 2017, 01:32:19 pm »
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.

I thought that logic was moved to the external library, but just checked and its still in core. Will move it out soon.


Thanks for the note about the AOE-killing-controller thing, I'll take a look.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: Dyson Sphere tweaks
« Reply #29 on: November 02, 2017, 11:32:50 pm »
Okay, on .601 I think my previous code submission seems to work pretty well. Feel free to tweak the code or the XML, or to give me some feedback as to how you'd like it improved.

 

SMF spam blocked by CleanTalk