[Video] Lane experiments

I’ve long been fascinated by aspects DOTA-style gameplay design, though I mostly avoid the core games of the genre for various reason. Yesterday I did something I’ve been threatening to do for a while and tried adapting some unit control code I’d written in the past to the problem, and this is where I got by the end of the day:

Two carriers send regular waves of reinforcements to the center of the map to do battle with one another. The code needs a bit more tweaking, but I should soon have it attacking the player, but only when there’s nothing else in range to attack.

I put this in it’s own thread rather than the HW:@ thread because while I use the HW:@ ships the same logic should run fine if you put other ships in. The code for this should probably work just fine in multiplayer with minimal changes, and I’m working towards making the AI logic I’m using flexible enough to distribute for potential reuse.

Ed: One difficulty is that SobGroup_FormStrikeGroup seems to have stopped working at some point, and I can’t find any alternative to it in my skimmings of things, so I don’t currently have a good way of keeping mixed groups of ships together :frowning:

7 Likes

This has some amazing potential.

2 Likes

Make a motorway! :wink:

Really, one of my motivations for working on this is curiousity about how esoteric lane arrangments would pan out, such as this one:

http://imgur.com/UXow7pT

Maybe today I’ll get to the point where I’ve got some of that playing out!

3 Likes

Looks good even at the concept!

well, maybe. It doesn’t have any single ‘base’ for either side, so it’s a lot harder to give a defensive advantage and have a front to be pushing one way or another, so for a competitive game mode I’d probably need to flip the sides of one of those lanes, at least. But I’m still curious how the AI battle dynamics would go, anyway.

1 Like

I got that layout implemented! Along the way I made the relevant code a lot more generalized, so I can add or remove lanes fairly easily now. I’m also trying out different options for waves, right now going with pairs of assault frigates. I don’t know if the dynamics of the map are currently good, but they’re definitely interesting.

Screenshots: http://images.akamai.steamusercontent.com/ugc/386541144121465455/61CCA57AC0FAF6BE2FF782B909C504A01C6BDCFF/ http://images.akamai.steamusercontent.com/ugc/386541144121493971/7A4F5967EE5797E20ADAC96352D1792DAC056EDF/ http://images.akamai.steamusercontent.com/ugc/386541144121497866/874C50E0313E9417ACBCEB90F7CCBC9A7E0C3417/

3 Likes

Have 5 likes. (Sorry I can only give one! ;))

Turns out the problem of turning a ship into static defense without giving it a new .ship file is a bit trickier than I’d hoped. SobGroup_SetMaxSpeedMultiplier modifies both move speed and turn rate, so any fixed weapons suddenly become hilariously avoidable. Using scripts to disable the move command instead doesn’t stop them from chasing if combat is joined. Grumble. The other solution that comes to mind would be considerably simpler if we had that sobgroup iteration capability that we don’t have.

I’m working on expanding my unit control code to make more standard moba behaviors possible, and thought I’d toss the notes for currently planned functionality out there for others to look at and see if I’m leaving any gaps. This code is based something I wrote to support very different logic in another mission idea, so if I do it right mission makers should be able to reuse it for a lot of different things.


The AI code controls the behavior of a group of ships, henceforth refered to as units. Units have a list of objectives, with the following options.

Fight: Unit will engage the given sobgroup whenever they come in contact with them.
Hunt: Unit will travel to the given sobgroup no matter where they are, so long as they exist
Waypoint: Unit will travel to the given volume and then discard this objective
Sentry: Unit will return to the given volume if it travels too far from it. When inside it, will act normally.
Guard: Unit will guard-command the given sobgroup so long as they exist.
ProxGuard: Unit will guard-command members of the given sobgroup if they are within the AI consideration radius.

A unit’s objective list is prioritized. For example if we have the list

1 : Fight Foo
2 : Travel Bar
3 : Hunt Foo
4 : Sentry Bar

the unit will travel to point Bar, stoppnig to fight any members of Foo they find along the way since Fight is higher on the list. Once they reach Bar, they’ll travel to attach Foo wherever it is, and if it is defeated they’ll fly back to Bar to guard it. If any new ships are spawned into the group Foo, the unit will leave to attack it again.

Typically you will want Fight commands for all hostile Player_Ships groups at the top of a unit’s orders if it has a hunt or travel command, or it will just drive past enemies trying to kill it in the pursuit of it’s target.

2 Likes

Foo? :no_mouth:

http://www.catb.org/jargon/html/M/metasyntactic-variable.html

1 Like

Now it makes sense! I will not ask small questions next time! :wink:

Update: The rewritten AI I needed is working in isolated tests now. Next step is to integrate it back into the lanes mission and feed it the right orders

Edit: Wow, I have no idea how it passed those isolated tests. But there’s now at least one less horrible bug with the code!

A little update to this, I’ve knocked together a flexible demo of all this that both is easier for me to expand and can be easily reconfigured to use another mod’s ships. Right now I’m rigging it up to stock ships (kus vs taii) so it’s a lot easier to redistribute and isn’t dependent on getting a release-ready HW@ to share. Depending on how expansion, documentation, and polish go this weekend, it may be available for public consumption rather soon.

3 Likes

Very thoughtful of you! I reckon playing stock Kush/Taii lanes will be pretty rad regardless of what other people may do to expand the game mode!

Shows off some of the newer behaviors, such as waypoint moves with stoppage to fight and resumption of movement after. Unfortunately also shows off some bugs that I didn’t know were there before recording it, but still. Progress.

2 Likes

Hi SIber,
It’s looking good, but I want to understand better the scope you’re trying to achieve:
Is this an alternative for MOVE ATTACK?;
Do we need 3 carriers,more or less? Or is it just the example?;
Is the purpose an attempt to provide more natural behavior for the units?;
Also, is this a way to make the game more tactical (which is a good idea)?;

Another issue:
" keeping mixed groups of ships together": you mean keeping SQUADS together?;
The Devs, as far as I remember, are remaking FORMATIONS to get a better behavior. If I got it right, maybe they will solve your problem (of keeping dif-units together).

Just some thoughts, it’s looking interesting.

1 Like

Well it’s MOBA inspired, the three spawns for creeps is a standard there.

Is this an alternative for MOVE ATTACK?;

As far as I’m aware, scripting wise the game has no real concept of a move attack. You’re either moving, or attacking. Moving to a place and fighting when you get there requires scripting to move, then fight when you get there, or fight when you encounter enemies, and it’s easy to have situations where you skirmish with an enemy group and then disengage, and now they don’t remember where they were supposed to go. You can avoid this by doing things like giving the enemy a blanket attack player command or similar measures, but this is clumsy.

What the piece I call “UnitAI” does is automate giving a group of ships a prioritized list of objectives to pursue. In the above example, the spawned frigates have the following orders

  1. Fight the other NPC team when encountered
  2. (‘red’ team only) Fight the player when encountered
  3. Go to a waypoint in the middle of the map
  4. Go to the location of the spawner opposite them.

So the NPC ships will fight each other and ignore the player if both options are available, they’ll fight each other, and if nobody is around to fight, they’ll follow their path. The list of behaviors the UnitAI knows is a lot longer than “Fight” and “Waypoint”, and I’m sure clever combinations I haven’t thought of exist. The map exists both to demo and stress-test the UnitAI, so I’ll be working on showing off more behaviors.

Do we need 3 carriers,more or less? Or is it just the example?;

Just example. The map in the video is the product of a lot of automation. You give a list of features and locations you want on a map, such as where the spawners go and what waypoints the ships they spawn follow, and a list of what ships the map should use for what role, and it’ll go from here.

There’s a simple example map with one carrier on each side, and there’s other arrangements I intend to try. I think the map-building code may even be capable of handling three or four way wars without exploding, which would be cool to at least try. This one, the ‘traditional’ map, just broadly mimics the layout of the classic DOTA map for recognizably.

Is the purpose an attempt to provide more natural behavior for the units?;
Also, is this a way to make the game more tactical (which is a good idea)?;

Covered in my first point mainly, but broadly yes. The UnitAI code grew out of code I wrote to make enemies in a campaign mission behave more intelligently and believably than I otherwise could. It turned out to be quite a project, but one I’m rather proud of.

" keeping mixed groups of ships together": you mean keeping SQUADS together?;
The Devs, as far as I remember, are remaking FORMATIONS to get a better behavior. If I got it right, maybe they will solve your problem (of keeping dif-units together).

Not squads in the engine sense. In the past I was using the Strike Group feature. If a ‘unit’ that the UnitAI is handling consists of some scouts and a heavy cruiser, unfortuntaly when they are moving across the map they will get spread out. This makes a lot of behaviors break down, as when your group is spread out over 10km and you ask “are there any hostile ships within 2km of this group?” then one way or another your answer isn’t going to be useful. Strike groups, while an imperfect system, did succeed in keeping things together for movement across the map. Unfortunately the script function to order ships into a strike group seems to have stopped working entirely, and I know of no alternative.

1 Like