[Wall of text] X4 tag/situation/policy/behavior stuff

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

strask412
Posts: 618
Joined: Thu, 29. Nov 07, 20:34
x4

[Wall of text] X4 tag/situation/policy/behavior stuff

Post by strask412 »

Hi all, and especially hello Egosoft and thanks for X4!

I have some observations about gameplay that I would like to see more of in X4, and while it's all kind of loosely connected in my head, it's difficult to really name the concept. So I'm going to bullet-point a bunch of things about the game as it is now (version 1.50 at this writing) and the directions I'd like to see it expanded, and hope that by the end of this long post it will make sense to some of you and we can talk about it some. Maybe even come up with a name for the feature set I'm tentatively describing. It's possible to do some of what I'm thinking of via modding, but it would work out best with some support in the core game from Egosoft.

Comments and criticism are quite welcome. But let me pre-empt just one thing: I'm not requesting these features on any particular timeframe and of course bugfixes and stuff should come first and yes some of the things I'm going to talk about are pretty minor. I just think the potential for awesomeness with X4 is great, and want to share a few ideas for the future in case they turn out to be useful.

Ok, so here are some things that are true right now, broken up into related chunks. Note I'm not exactly complaining about any of this, just pointing out the current facts:

1) NPC factions can and do adjust their "score" for us players over the course of the game. When a faction has a high opinion of us, we might get discounts, licenses, etc. When a faction has a low opinion of us, we might have worse trade prices and if bad enough they might shoot us on sight.
2) As players, we can NOT currently reciprocate with the NPC factions in terms of this functionality. There is no way for me to tell X4 (or specific NPCs that work for me) to give a discount to the PAR and ALI folks but charge a little extra to those greedy TEL and MIN people.
2b) Note in particular there is no way for me to tell my employees to consider HOP to be enemies and attack them on-sight. Not if HOP has a positive opinion of me, anyway.
2c) Likewise friend-foe mines: There is no interface for telling them who is friend and who is foe.

3) There seems to be some user interface confusion/blending between the concepts of targeting, and guidance. For example, if I set guidance to a space station, and target that station, all seems fine until I clear the guidance. When I clear the guidance it breaks my target lock on the station. It shouldn't do that, right? Targeting and guidance are two separate concepts, or are more usefully used that way anyhow.
3a) Targeting is selecting an object that you wish to perform further operations on.
3b) Guidance is a navigational aid, to let you know where to go or what to do next.
3c) Consider the case where you have guidance set to an objective and engage in combat along the way. During the combat you may wish to SIMULTANEOUSLY have guidance to your eventual destination (so you can exit on the correct side of the furball if things go badly) and targeting on your opponent to fire weapons.

4) There is also confusion about the color red, what it means, what it should mean, how I should react to it, and how my NPC pilots should be expected to react to it.
4a) A red criminal mass-traffic tour bus isn't a threat, and won't attack me. But my turrets will engage if set to fire on enemies. What made this tour bus my enemy? The fact that the station manager is mad about the unlicensed herbicides or micro-motors they are carrying?
4b) A station turns red when I use an EMP bomb to steal module blueprints. But even though the station has defense modules, it doesn't fire on me. Or on my ship, parked a few meters away. No worries at all despite the red color (which will, after a period of time, go back to ally-blue). Until...
4c) An NPC frigate I own, on assignment to the defense role at a station far away, is moving past due to having been sub-let by the station manager to escort duty for one of the traders also assigned to my station. This frigate sees the station I just EMP-bombed go red, and rushes to my aid, opening fire on the station and causing a big mess.
4z) The point here is that red can mean "a threat", "someone who is grumpy at you", or "someone who you can shoot without penalty in the current context" and it's not always clear which of those things are true.

Ok, so then there's this whole other thing about missions, for those who do them. I tend to collect a lot of missions so that I always have a convenient set available when I'm in the mood to do some. But each time I accept a mission, I have to go into my mission interface and re-set which one is active because the mission I just accepted automatically became active at the expense of the one I was previously tracking. Also when I complete a mission, I need to review my mission list to figure out which one is best to do next... this decision might be affected by my current location, what kind of ship I'm flying, how badly I need cash, the types of missions I would currently find entertaining, etc. And while I'm on the subject of missions I can't resist complaining that the mission briefings DO NOT TELL YOU WHERE TO GO. This is stupid. If my mission is to deliver a fine meal to somebody, I need to know where they are. It should be in the briefing. Right now there is no way to get that information without first climbing into a space ship and un-docking, at which point (if the mission is active) you can look at the yellow guidance markers on the map. But I digress.

And before I go and tie this all together, I also need to mention the property menu. The more ships you have, the harder they get to manage. Sure, some get buried in some station-subordinates sub-menu never to be seen nor thought of again. But the "unassigned" list grows... and grows. Some people in this thread viewtopic.php?f=146&t=411803 have suggested name-able groupings of ships in the property menu. Someone else mentioned the word tags. That's a good word. I like tags.

So here are some thoughts about all of the above.

First step, easiest step: Segregate, separate, and completely un-bind the concepts of targeting and guidance. Once again, I'll define targeting as the selection of an object for further/subsequent operations to be performed on it, while guidance will be an indication or set of indications about what should be done next. Guidance is generally within the context of Missions, which are sets of objectives to be completed, possibly in a defined order.

Second step: Reconsider use of colors on the map and in the HUD, especially the color RED. As discussed in this post viewtopic.php?f=146&t=409455 a lot of people (although surely not everybody) are interested in each faction getting its own color on the map regardless of reputation/relations. They are expressing a wish for color to represent IDENTITY. The existing scheme, in which friendlies are various shades of blue and hostiles are red, uses color to represent ATTITUDE, specifically the AI ATTITUDE TOWARDS THE PLAYER. One could also hypothetically use color to represent PLAYER ATTITUDE TOWARDS AI FACTIONS. More on that later. Finally color (RED again) is used sometimes by the game to denote criminal targets, which are best defined (as far as I can see ... let me know if this isn't right and why) as TARGETS WHICH MAY BE SHOT WITH IMPUNITY IN THE CURRENT CONTEXT. Also with the Ventures feature in 1.5, the color YELLOW was introduced as an identifier for copies of player-owned ships that are spawned into our galaxies. In this case color is being used to represent .... I lack vocabulary. How would you name this distinction? I guess it's a delineation of whether or not the ship originated in your galaxy or the galaxy of another player? Difficult to name. Will think on this.

That's a lot of potential ways of looking at color for ship icons etc. Some have suggested that ship icons should have brackets around them, so that the color of the icon itself could have one meaning, and the color of the bracket another.

A game that has struggled with this problem in the past is EvE Online. I'm not a fan, but CCP has been doing complex online spaceship games for 15ish years (yes, Egosoft has been around a lot longer) and might have some relevant experience. I am in no way advocating making X4 more like EvE online, merely observing how similar problems of coloring objects on a map have been addressed there.

In EvE, the pilot's primary view of objects in space is called the Overview. It's basically a configurable object list in table form. Pilots have extensive customization options to control which objects are displayed on the table at all, in what order, and with what visual presentation attributes (such as color, blinky-ness, etc). I'm going to focus on presentation attributes here. Users can control, among other things
  1. The color of the background in the table row describing the object.
  2. The display or not of various "colortags" which are basically small icons in the lower right corner of the already-small icons representing the ships, and which indicate various attributes of the ship or its pilot (such as being a criminal, being at war with you, having a bounty you could collect, etc.).
  3. The string of text describing/naming the object in space, which usually (but not always) contains things such as the name of the pilot/owner, the specific model of ship (such as kestral or nova, in X4-speak), faction membership, etc. For an example of this see https://wiki.eveuniversity.org/File:Ove ... labels.png where you can see to the left of the table the ship labeled with an icon representing ship class, then the ship model in red, the pilot name in white, and faction in green (plus then distance in white).
  4. Both the colortag and the row background may be set to blink under certain circumstances as the user desires.
I'm not going to solve the second step here. I am simply going to insist that it needs to be solved, and I'll participate in any public discussion that ensues about the specifics. It's more important in this particular wall of text to move on and show a bigger picture.

Third step: Allow us players to manage our factions with at LEAST the same amount of control as the NPC factions get. We should be able to, at a minimum, assign a numeric positive or negative score for any other faction we have met. But while numeric scores are a good, simple way to manage AI attitudes towards the player, there are better ways to handle player attitudes towards the AI. Implement a way for us to define tags for factions. Give us a set of default tags like "Friendly" "Neutral" "Hostile" so that new players and those uninterested in the mechanic can roll with the defaults and ignore the underlying mechanism. But allow users to arbitrarily define new tags as well.

Fourth step: Tags should be used as the basis for BEHAVIORS, given SITUATIONS. This is already happening in the game, although maybe not in an easily extensible way. Take a look at the "Global Standing Orders" section of the player information screen. The response options for "Police Interdiction" and "Pirate Harassment" are identical. Which they absolutely should be, because those are both cases of "somebody asked me to drop my cargo" and the possible ways to respond to that situation are the same. So we've got two SITUATIONS that are identical in format, but we can select different BEHAVIORs based on.... a TAG! The tag in this case is whether the assailant is marked as police, or pirate.

This fourth step stuff is where a lot of the magic happens. Because we don't just want to define the tags. We want to be able to add and modify the behaviors and the situations, as well.

Example: I define a SITUATION like "Current ship receives damage from weapons fire", along with a few BEHAVIORS like "return fire", "flee", and "ignore". We'll ignore the implementation of all of that definition for the moment. Then I can define logic for BEHAVIOR SELECTION based on the relevant tags:

If attacker is tagged FRIENDLY, ignore.
If attacker is tagged HOSTILE, return fire.
Otherwise, flee.

This set of behavior selection rules is part of a POLICY. We can further define the policy by defining which of our OWN assets the policy applies to.

The above simple policy could be for fighters, while an even simpler policy of "always flee" is used for transports, for example. But we don't define the policy selections based on ship class, we define them based on TAGS that we define for our own ships. Default tags pre-created for every ship could include the ship class (scout, fighter, transport, destroyer, carrier, etc.) and the specific model of ship (pegaus, kestral, discoverer, etc.). But players could define arbitrary tags with arbitrary meanings and assign tags to ships as they wish.
"If I were a shadowy nemesis that wanted to strike the Protectorate where it's weakest, Pioneers space is where I'd begin."
- Delilah Shiratori
strask412
Posts: 618
Joined: Thu, 29. Nov 07, 20:34
x4

Re: [Wall of text] X4 tag/situation/policy/behavior stuff

Post by strask412 »

Ok, reality check time: This seems like a lot of work, yes, and a lot of it could be done with mods, yes. Keep reading, please.

We could use the capabilities outlined above to implement a global standing order as follows:

1) Define a situation: "Current ship is within X kilometers of a shipyard && I don't own any satellites within Y kilometers of said shipyard"
2) Define which ships are eligible to complete the mission: "Current ship has non-zero unallocated satellites."
3) Define a priority: PRIORITY_LOW (ideally these priorities should be editable tags as well, but a default low/medium/high or numeric scale could handle the vast majority of needs).
4) Define a behavior: Drop a satellite near the station.

But wait... what if we don't want to depend on our ships randomly flying past shipyards? What if we already know about all the shipyards and just want to set up satellites ASAP? What we have then is something like this:

A set of objectives (have a satellite at each shipyard a, b, c, d, e).
Possibly a defined order or sequence with which those objectives should be accomplished.

Sound familiar? That's because I earlier used that as the definition of the word MISSION.

So let's roll back to when I was talking about missions and the problem with accepting a new mission, and how it usurps priority from your current mission. Wouldn't it be nice if we had a mission QUEUE? We could prioritize our missions so that when one completes, we know which one will become active next. And we could just have new missions added to the end of the queue, or optionally left in a pool of missions that are not in the queue (not yet scheduled). That would be great. But it wouldn't help with one of these frustrating things that happens. Picture yourself flying around in Hewa's Twin, when you pick up a mission to fetch an engagement ring or family heirloom. The target is in Antigone Memorial, which is on the other side of the world. But whatever, you go to Antigone Memorial, fetch the prize. Then you look at your mission log and there's just one item left... you picked up a mission a while back to deliver a fine meal. And that's when you notice the destination for the fine meal is in Hewa's Twin. If only you'd noticed that when you were nearby, right?

Enter SITUATIONS again. What if each mission .... could be assigned missions?

1) Define a SITUATION: I am near Hewa's Twin, destination for this fine meal.
2) Define eligibility: Fine meal mission is in the queue, anywhere. (Active, not inactive)
3) Define a behavior: Send a text message to the messages panel to alert the pilot, or simply pop the fine meal mission to the top of the mission queue.

Now, it would be tedious to enter rules like that to set up reminders for every mission you take on, but doesn't each mission already have a set of objectives defined? And tracking to figure out which of these objectives you should do next? And ... here's the important bit... GUIDANCE for the next step? The reminder/alert/prioritization by proximity for each mission could be automatically generated! And the rules for automatic generation of these reminders or whatever would be pretty straightforward, but, if defined using the same kind of situation/behavior/policy/priority/tags structure as above, could be edited or expanded upon by the user if desired.

Let's see then... we have this structure for defining missions, and it's very similar to the structure for defining global standing orders, and we have ways of categorizing our ships, classifying other factions, and (hopefully) a decent solution for displaying this information. Do we need an editor? Maybe just a very primitive one. Basically we want to be able to see our list of tags and behaviors and missions and orders and such from within the game. We don't need to edit them there, just assign them and plumb them together. Leave the editing up to the user's XML editor of choice. So we really just need an interface for assigning tags to factions and ships and stations, and then matching those tags up with situations to form policies for selecting behaviors. For each of {tag, situation, policy, behavior} we just need something to display the name and description, then one place to drag and drop them onto each other to configure the whole mess. Which is complex, but certainly simpler than the existing interface for building a station megaplex as no graphics are required. :)

Most users, of course, don't really want to edit XML. Furthermore a lot of users don't even want to install mods, for fear of the **modified** tag or because they are simply purists. But I have an idea about that, too:

Look at what's involved in defining tags: Basically, you just give something an arbitrary name. It doesn't change any game state. It doesn't have significant performance impact.
Look at what's involved in defining situations: Using the data available to an entity (such as one of your ships), check if conditions are true or false. It doesn't change any game state. Some methods of evaluating conditions may have performance impact, others not so much.
Look at what's involved in defining policy: Just assign combinations of tags and situations to behaviors. The policy definition doesn't change any game state. Performance impact of a policy definition is minimal.
Look at what's involved in defining behavior: Essentially a behavior is just a command given to a ship. It changes game state insofar as the ship will attempt to do whatever you ask; but it only modifies game state as far as that ship is capable of complying. Performance impact should be identical to any other method of giving a ship orders.

If Egosoft were to make an API filter, a subset of the existing scripting API which contained ONLY methods to accomplish the above (that is, it would EXCLUDE all API calls that change game state OTHER than those that issue orders to your own ships, and EXCLUDE performance-hog calls), then maybe we could all share .xml files containing all these definitions without making our games **modified**.

Because the thing is, the existing API is almost sufficient for all of this. Like I acknowledged above, yeah a lot of this can be done in mods. It's just that it would be very kludgey and some modders would do things differently from others and you'd end up having to install ten mods with various degrees of overlapping functionality to try to get what I really wish I had. :) With a little guidance about how to define each of these things I'm calling tags, situations, policies, behaviors, etc., and an import filter that made sure the modders obeyed the format and didn't use cheating API calls or things that would make performance problems, sharing would be much much much easier.

Alternately, maybe this is all too far from core X4 gameplay and would be best left as an excercise for the modding community. In which case if you have interest in working with me to try to build it, let me know. :)
"If I were a shadowy nemesis that wanted to strike the Protectorate where it's weakest, Pioneers space is where I'd begin."
- Delilah Shiratori
strask412
Posts: 618
Joined: Thu, 29. Nov 07, 20:34
x4

Re: [Wall of text] X4 tag/situation/policy/behavior stuff

Post by strask412 »

[reserved for future expansion]
"If I were a shadowy nemesis that wanted to strike the Protectorate where it's weakest, Pioneers space is where I'd begin."
- Delilah Shiratori

Return to “X4: Foundations - Scripts and Modding”