AASv4 Game Mode

Information and tutorials related to modding BF2.
AFsoccer
Retired PR Developer
Posts: 4289
Joined: 2007-09-04 07:32

AASv4 Game Mode

Post by AFsoccer »

This tutorial will explain how to set up control points on your map using AASv4 (Advance and Secure version 4).

Tools Needed:

BF2 Editor

Prerequisites:

A map that has at least one gameplay layer created (i.e. AAS 64 etc.)

Creating combat zones, object spawners, and spawn points won't change from previous AAS versions so that won't be covered in this tutorial. For basic layer information, refer to: [Map Tutorial] Layers (16, 32 And 64 Size Maps etc) and Creating a Basic Level - BFEditor

Setting up your Teams

The CP capture order always starts with Team 1. So the closest control point to Team 1's main will be CP#1 and working it's way out from there. So the first thing you'll want to do it establish which team will be Team 1. You do this by editing the init.con, which is found in your map's main folder. Open it up and you'll see something like this:

Code: Select all

rem *** Generated by BF2Editor ***
if v_arg1 == BF2Editor

run Heightdata.con
LevelSettings.InitWorld
run Terrain.con BF2Editor
run StaticObjects.con BF2Editor
run Sounds.con
run Sky.con BF2Editor
run Editor/GamePlayObjects.con host
UndergrowthEditable.create
Undergrowth.load Levels\yourmapname\
run Overgrowth/Overgrowth.con
Overgrowth.editorEnable 1
run AmbientObjects.con BF2Editor
run Water.con
run TriggerableTemplates.con BF2Editor

else

run Heightdata.con
run Terrain.con v_arg2
run Sky.con v_arg2
run CompiledRoads.con
run Sounds.con
run tmp.con v_arg1
Undergrowth.load Levels\yourmapname\
run Overgrowth/Overgrowth.con
run Overgrowth/OvergrowthCollision.con
run AmbientObjects.con
run Water.con
run TriggerableTemplates.con
run Fields.con

endIf

rem ------------------------------- LevelSettings -------------------------------
rem -----------------------------------------------------------------------------

run ../../Factions/faction_init.con 1 "gb"
run ../../Factions/faction_init.con 2 "ch"

rem -----------------------------------------------------------------------------

gameLogic.setBeforeSpawnCamera -728/24/-1075 -124.292/-2.23791/0

if v_arg1 == BF2Editor
LevelSettings.CustomTextureSuffix "Woodland"
else
texturemanager.customTextureSuffix "Woodland"
endIf
rem -----------------------------------------------------------------------------

GameLogic.MaximumLevelViewDistance 800

rem -----------------------------------------------------------------------------

gameLogic.setDefaultNumberOfTicketsEx 16 1 50
gameLogic.setDefaultNumberOfTicketsEx 16 2 50
gameLogic.setDefaultNumberOfTicketsEx 32 1 250
gameLogic.setDefaultNumberOfTicketsEx 32 2 250
gameLogic.setDefaultNumberOfTicketsEx 64 1 300
gameLogic.setDefaultNumberOfTicketsEx 64 2 300
gameLogic.setDefaultNumberOfTicketsEx 128 1 50
gameLogic.setDefaultNumberOfTicketsEx 128 2 50
gameLogic.setDefaultTimeToNextAIWave 8
gameLogic.setTicketLossAtEndPerMin 1000
gameLogic.setTicketLossPerMin 1 20
gameLogic.setTicketLossPerMin 2 20
Scroll to the section that starts with "rem ------------------------------- LevelSettings -------------------------------". That's where your teams are defined. The easiest thing to do is to check other maps' init.con for the team abbreviations that you want to use. Place Team 1 on the first line and Team 2 on the second, then re-save.

Placing Control Points (CPs):

As a quick refresher to the layer tutorial, here's how to create control points (CPs):

1. Open BF2 Editor in it's "Level" function.
2. In the right column of the Editor screen, select the layer you'd like to add a control point to.
3. Move the camera around in the map and locate where you want to put your control point.
4. Right-click on the spot where you want to place the control point and choose "Create ControlPoint" from the menu that pops up.
5. A window will pop up prompting you for a name.

PR uses a specific naming convention. Ignore the suggestion that the editor recommends and use this naming template:

Code: Select all

cpname_nameofthemap_gamemode_nameofcpalloneword

Example: "cpname_kashan_desert_aas64_northvillage"

"cpname" = literally always just the text "cpname"

"nameofthemap" = the name of the map, if spaces are needed use _

"gamemode" = the game mode and number. Valid values are:
aas
skirmish
insurgency
training
followed by either 16, 32, 64 without a space

"nameofcpalloneword" = literally all one word of the cpname. 
No other characters except alpha characters should be used.

ALL of this needs to be lower case.  Do this each time you want a control point.
SupplyGroupId

Using AASv4, you have a lot more options at your disposal on how you want your control points to show up in game. The order and choice of CPs will depend on the SupplyGroupId in the control point's tweaker bar (highlighted in yellow below).

Image

In AASv4, we'll be changing the default SGID of -1 to a specific number, depending on what you want to do.

AASv4 gives you a LOT more options than ever before, so I'll explain each option and how to set up the SGIDs using an imaginary PR map.

Main Bases

As you probably know, in PR the main bases are not usually in play. They are a safe haven for spawning, vehicle repairs, etc. In order to set up AAS, it's important to decide how you want your main bases to be set up. The most common is to make them uncappable and assigned to the team that has a main base there. So looking at the tweaker bar above, you would set:

Team = 1 (or 2)
Check the box for "unabletochangeteam"

SGIDs for main bases are as follows:

Team 1 = 1
Team 2 = -1

The only change to this is if you want a main base to be cappable. Then you would assign it a unique SGID based on the tutorial that follows.

You can also delete the SGID for Team 2's main if you like by opening the text file and deleting the line "ObjectTemplate.supplyGroupId -1".

Basic Randomization

This is best for smaller (1km and 2km) maps with few control points.

CPs are assigned a 2-digit SGID (AB) where:

A = Its order in the sequence (starting nearest to Team 1's main)
B = If more than one CP has the same A number, B tells the computer how many to pick to be in play.

If you don't want a control point to be randomized, assign it a unique "A" digit and then make "B" a zero.

Example:
Image

In the photo, Team 1 is located on the carrier and Team 2's main is the hashed area. The CP layout is as such:

CP#1: Village
CP#2: Bridge and Farm both have an SGID number starting with 3, so the computer will look at the second (B) digit to determine that the mapper only wants 1 of them to be picked. This will happen randomly, so sometimes Bridge will show up and sometimes Farm will.
CP#3: Junction

As you can see, this is a basic layout. Team 1 will have to capture Village first, then either Farm or Bridge, then lastly Junction. Team 2 has to attack Junction first. Their second flag will be either Farm or Bridge, then their last flag will be Village.

Now let's say you want both Farm and Bridge to be picked. By changing the "B" digit from 1 to 2, the computer will now pick both CPs as CP#2. This means that both CPs must be held by a team before it can capture the next flag in the sequence. Be careful using this option as it's difficult to defend two CPs while attacking a third.

Image

AASv4 Attack Routes

Attack routes are the heart and soul of AASv4. Basically what you'll be doing is adding a third digit to the SupplyGroupId, so now you'll have "ABC", where:

A = Its order in the sequence (starting nearest to Team 1's main)
B = If more than one CP has the same A number, B tells the computer how many to pick to be in play.
C= The route it belongs to

The third digit (or route number) tells the computer that before it does anything else, it should pick a route to use. Since I think showing is better than telling, let me show you some examples:

Image

Here you'll see two routes, Blue and Green. The first thing you should notice is that the SGIDs have a third digit, where the Green route is designated as route #1 and the Blue route is designated as route #2. When the map loads, the computer will see that your SGIDs have a third digit and will randomly pick a route. It may be Blue for one game and Green the next.

You can have up to 9 routes on your map, which should be plenty.

Ok, so that's the basic route set-up. Using this information, you can now incorporate more complexity into your routes. For example, you can add random flags (just like you did in the first part of this tutorial):

Image

In the above example, I've added another CP to the Blue route called Village. This new CP has the same SGID as Port, so let's break it down by its ABCs:

A = 2, designating it second in the sequence. No change here.
B = 1. Since Village and Port both start with an A = 2, the computer needs to know how many of the flags should show up. In this case, setting B = 1 tells the map to pick just one.
C = 2, the route designation.

So, if the computer picks route #2, it will then pick either Port or Village (and not both) since you assigned B = 1.

If you are feeling comfortable with how all that works, let's move on.

Same Area, Different CPs

One of the features of AASv4 that has never been available before is having multiple CPs for the same area. This is possible by assigning the CPs to different routes.

So why would we want to do this, you ask?

Building on the Blue and Green route examples above, let's start with a simple example. Say you really like the "Village" CP area. It's fun, is in a great location, and will make for great battles... so you want it to be in more than one route. Solution: create another CP.

Image

Yes, that's right. Just create another CP and name it something slightly different. To avoid confusion, you can place the route number in the CPs name, such as:

The Green route "Village" would be: cpname_mapname_aas64_1village"
The Blue route "Village" would be: cpname_mapname_aas64_2village"

Simple! Now you can move/edit the CPs within Editor so they have the exact same radius or make them slightly different. Now regardless if route #1 or route #2 gets picked, Village will be a possible CP.

Another reason you may want more than one CP for an area is to offer variety. This is a little more difficult to explain, but I'll try.

Image

Firstly, I've made the "village" into a "city" (forgive my photoshopping abilities). By using the multiple CP option, I can now make it so that if route #3 (Orange) is picked, the players may see a 150m North City, 150m South City, or a 300m Entire City flag. The computer will pick just one because B=1 and it won't interfere with the CPs in other routes because C=3 (designating it as route 3).

Now putting it all together, you get:

Image

You can see why it will be important to properly name your CPs so it includes the route number... but you can also see the amazing possibilities AASv4 gives you.

Using One CP on All Routes

Depending on your map layout, you may want to include one CP on all of your routes. For example, here is an old Fools Road AASv4 set-up:

Image

You can see that CP#1 and CP#5 are on all of the routes. This often makes sense when the map has a final location that the armies have a "mission" to capture or defend... such as a missile silo, airfield, etc. When this is the case, you don't have to create separate CPs for each route but can instead assign it a single digit. If the CP is at the beginning of the route, it would have an SGID = 1. You would then set both main bases to SGID = -1 since neither is in a route. Basically, here's the way to look at it: The computer needs to see an SGID = 1, so if your main base fulfills that role then great. If it doesn't, then the first flag needs to be SGID = 1.

Ok, so what if your shared CP is at the end of the route? Now it gets slightly more complicated. You can either change your team assignments in the init.con so that it becomes the first flag, but that may not be possible based on the map layout. The second option is to assign it a single digit SGID that ends all of the routes. The drawback to option 2 is that all of your routes must end at the same number. For example, when you look at Fools Road, all of the routes end at flag #5.

It's important to note here that you can't have a gap in the sequence. So if Fools Road had a route that only had SGIDs of 1, 205, 305, and 5 then there would be a gap between 305 and 5 and it wouldn't work. The map would load just fine, but neither team could cap the other out.

A Few More Things about Main Bases
  • I know we've talked about main bases several times in this tutorial already, but there are still a few things to cover. If you make one (or both) of your main bases part of a route, then they must be single digit SGIDs with Team 1 = 1 and Team 2 = the last number in the routes. The reason behind this is that all of your spawn points and objectspawners are linked to this CP and having the spawners assigned to one route causes a lot of issues if that route isn't picked. So the best thing to do is ensure your spawners are tied to a CP that isn't cappable and is not assigned to a route. The simplest way to do this is to assign Team 1 = 1 and Team 2 = -1. If you want your spawners to be associated with a CP that is cappable, so that the team loses it's ability to spawn, then you must give it a single digit SGID so that it is part of all routes.
  • With the exception of CnC mode, 99% of main bases should be marked with a CP. This let's players know where the main bases are and thus where the domes of deaths are. So if your main is not cappable and not part of your routes, you'll still need to make sure the CP is marked on the map.
Looking back at the Fools Road example, you could do it either way. You could set all of your spawners to the closest flag, which means it's cappable by the enemy and when it's lost, no one can spawn or repair, etc. Or you can create a uncappable CP for your spawns that is always active.

Flag Names on Minimap

When your map is nearly final (or ready for play testing), there are two more steps that you'll need to take:

Adding flag names to the localization file: Since you don't want players to see the confusing flag name that you used above (ie. cpname_map_aas64_flagname), you'll want to follow this tutorial.

Ensuring flag name doesn't go off the minimap: Once you've updated your localization file, jump in game and check to make sure the flag names don't go off the minimap. This is especially common with main bases and flags near the map edge with long names. To correct this, go back into editor and edit the "MinimapNameOffset" values:

Image

If you click on the + sign, it will expand so you can change the X value (left/right) and Y value (up/down). This is typically trial and error getting the value just right so you will likely have to go in-game several times to see how it looks.

Verifying your routes

We got a tool to verify these routes and other things on nice little overview images.

Like this:
Image

It has a nice set of options to tweak it to your settings.
Image

I'm sure you'll be able to figure it out how to get it to work. If not feel free to ask further here.

Download link: https://files.realitymod.com/prbf2/PRMa ... Helper.zip

In Closing

Have fun and experiment. These new capabilities should allow you to create more focused fighting, more strategic points of interest, more logical avenues of attack, more variety, and so much more!

If you have any questions, please post them here.

Thanks :)
Last edited by UTurista on 2022-09-21 13:29, edited 25 times in total.
Reason: Updating AAS name for consistency
Shovel
Posts: 860
Joined: 2010-08-26 14:23

Re: [Map Tutorial] AASv4

Post by Shovel »

ITS UP!!!!

THANK YOU!

MAPPERS REJOICE!!
Shovel009
VapoMan
Retired PR Developer
Posts: 1139
Joined: 2009-05-29 07:11

Re: [Map Tutorial] AASv4

Post by VapoMan »

1. If I put AASv4 Attack Routes in my map will it work in this current version of PR?

2. In my map I want to have a starting flag for each team that will be the start and finish of every attack route. Will I have to make several flags at those points for every attack route or can they be seperate like the main bases?

EDIT: im asking 2 because I have spawn points and objects spawners connected to them, but I guess I can just use the same control point ID for all of them?
Last edited by VapoMan on 2011-01-27 15:11, edited 1 time in total.

Image"Eight glorious sides and eight stunning angles!"Image
sylent/shooter
Posts: 1963
Joined: 2009-04-10 18:48

Re: [Map Tutorial] AASv4

Post by sylent/shooter »

Yes i believe all servers have had a hotfix with the new python code

Killing the enemy sylently
AFsoccer
Retired PR Developer
Posts: 4289
Joined: 2007-09-04 07:32

Re: [Map Tutorial] AASv4

Post by AFsoccer »

VapoMan wrote:1. If I put AASv4 Attack Routes in my map will it work in this current version of PR?
I've been told that the servers have the new python code, but I'm not 100% sure. If you're asking because you want to set up a dedicated server using Hamachi or something, then it won't work unless you install the python code to mods/pr/python using the .zip file. AASv4 is completely backwards compatible with AASv3 so you'll still be able to play maps on PR servers, but make a backup of your PR folder just in case.
2. In my map I want to have a starting flag for each team that will be the start and finish of every attack route. Will I have to make several flags at those points for every attack route or can they be seperate like the main bases?

EDIT: im asking 2 because I have spawn points and objects spawners connected to them, but I guess I can just use the same control point ID for all of them?
It's funny you asked this because it's the one snag we've run up against. Luckily there's an easy work-around.

So here's the problem:
If you have a control point that shares routes because you gave it an SGID of 1, then it shouldn't be a problem because it's at the start of the routes. However, if you have a control point at the end of the routes, then all of the routes leading up to that control point must be of equal length. So if your last control point has an SGID of 6, then all of the routes that use it must have controls points 1, 2XX, 3XX, 4XX, and 5XX.

But here's the solution:
You can still have a beginning control point that's shared, but if your routes aren't all the same length, then you'll have to create new control points at the end for each of your routes. They would look like this:

601
602
603
604

They can all be stacked on top of each other but they'll have different SGIDs. Once again, this is only necessary if your routes aren't the same length.

As for objectspanwers, I would recommend creating a new control point, such as at main and assigning it an SGID of -1. Make it uncappable and then assign all of your object spawners to it. You can even hide it on the minimap if you want by selecting that option in the tweaker bar. Remember that when you create an objectspawner, the Editor will automatically assign it to the nearest CP but you can change that really easily through the tweaker bar and move the object where ever you want on the map. :)

Hope that helps.
Shovel
Posts: 860
Joined: 2010-08-26 14:23

Re: [Map Tutorial] AASv4

Post by Shovel »

Just a quick question, how many attack routs to the developers recommend for maps? Three? Five? Nine?
Shovel009
Amok@ndy
Retired PR Developer
Posts: 5144
Joined: 2008-11-27 22:13

Re: [Map Tutorial] AASv4

Post by Amok@ndy »

its up to the mapper but having less then 3 routes doesnt really worth it
Image
AFsoccer
Retired PR Developer
Posts: 4289
Joined: 2007-09-04 07:32

Re: [Map Tutorial] AASv4

Post by AFsoccer »

Updated to reflect new discoveries.
billoute
Retired PR Developer
Posts: 355
Joined: 2009-04-17 07:27

Re: [Map Tutorial] AASv4

Post by billoute »

very nice tuto ,I have learned more ;)

Also ,I have a question related to the PC and the tickets. AFsoccer can you explain to us the real operation about the AeravalueTeam1 an AeravalueTeam2 . How are these values done to manage the ticket bleed ? how to choose the level of these values ?I think that is complementary to the creation of PC .

thanks
Last edited by Hauteclocque on 2011-06-08 13:48, edited 1 time in total.
Image

La faim justifie les moyens ......
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Map Tutorial] AASv4

Post by Rhino »

As per my Audit tut: https://www.realitymod.com/forum/f189-m ... audit.html
Image
These values control your ticket bleed. Once a team captures enough flags to reach a total area value of 100 or more, ticket bleed will happen for the other team. So if you set 1 flag with a area flag of 50, and 2 others with 25, and if team 2 controls all 3 of those flags 50+25+25=100, means ticket bleed will start for the other team and continue until team 2 looses one of those flags. If say the area value reaches 200, ticket bleed should happen at double the rate it is set to in the init.con file. Also take note that there are 2 sets of area values, one for each team. so you can make a flag have a high or lower value for one team than it dose for another.
For the last flag (main base) in the capture order, you should give the attack teams side as much area value as you can so ticket bleed would soon end the game if they took the flag. IE, final flag should have an area value of 99999 for the attacking team.
Image
billoute
Retired PR Developer
Posts: 355
Joined: 2009-04-17 07:27

Re: [Map Tutorial] AASv4

Post by billoute »

Thanks Rhino ,now I see more clear !

If I have understood, the step of this account is 100 and the tickets number decrease by X tickets per minute (specified in the init.con --> gameLogic.setTicketLossPerMin 1 10 and gameLogic.setTicketLossPerMin 2 10 , I suppose )
In fact ,no need to used the item "EnemyTicketLossWhenCaptured" in the editor for the aas game mod.

This leaves many opportunities in the construction of the game 8-)
Image

La faim justifie les moyens ......
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Map Tutorial] AASv4

Post by Rhino »

[R-CON]billoute wrote:Thanks Rhino ,now I see more clear !

If I have understood, the step of this account is 100 and the tickets number decrease by X tickets per minute (specified in the init.con --> gameLogic.setTicketLossPerMin 1 10 and gameLogic.setTicketLossPerMin 2 10 , I suppose )
That's correct.

[R-CON]billoute wrote:In fact ,no need to used the item "EnemyTicketLossWhenCaptured" in the editor for the aas game mod.
That option shouldn't be used as I'm pretty sure it says in my audit tut, its buggy and if a defending side lets the enemy neutralize there flag, kill them off and recap it, the attacking team loose points again for not being able to follow though with there attack which sucks :p
Image
AFsoccer
Retired PR Developer
Posts: 4289
Joined: 2007-09-04 07:32

Re: [Map Tutorial] AASv4

Post by AFsoccer »

Thanks for pasting that info Rhino. The only thing I would add is that the final flag doesn't have to be 99999. It could be 100, 200, or in some rare cases nothing at all. It depends on the set-up and which team(s) need the bleed in order for the map to play successfully.
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Map Tutorial] AASv4

Post by Rhino »

if you have a slow bleed on the final flag (which you get without setting it to 999999) you get situations where 99% of the team that's been capped out are all dead and can't spawn since they don't have any flags to spawn on and there is one sniper hiding in a bush somewhere which the other team can't find and everyone just gets really pissed off for ages. Use to happen a lot in PR before we added the final flag with 999999 area values.

With the area value at 999999, ye the opposite team doesn't have much of a chance to recap there main (even thou tbh that's very unlikley to happen) but it means that the game is over in under a minute and even if the other team did manage to recap there flag, they wouldn't have enough tickets to win even if they could pull off an amazing counter attack, which if they can they should have done it sooner :p
Image
AFsoccer
Retired PR Developer
Posts: 4289
Joined: 2007-09-04 07:32

Re: [Map Tutorial] AASv4

Post by AFsoccer »

That's why I said it depends on the set-up. With some maps, the mapper didn't assign the spawns to the last flag... so the team can still spawn in and fight to get it back. So yeah, most maps may need a 99999, but not all... that's what I wanted him to know.
therazer
Posts: 284
Joined: 2010-12-11 16:43

Re: [Map Tutorial] AASv4

Post by therazer »

Hello. We are planning small event. But i need help with flags. (of course server will be passworded)
Image
Who can remove on this map all AAS routes except
BLUE ( RU FO => City => Pumping Station => Hilltop Fort => Farm => PLA FO )
GREEN ( Ru FO => City => Oil Storage => Hilltop => Farm => PLA FO )
RED (RU FO => City => Pumping Station => Oil Storage => Hilltop => PLA FO )
User avatar
Mineral
Retired PR Developer
Posts: 8533
Joined: 2012-01-02 12:37
Location: Belgium

Re: [Map Tutorial] AASv4

Post by Mineral »

hey razer, did you ask vapoman if this was ok to edit his map? :)
Image
therazer
Posts: 284
Joined: 2010-12-11 16:43

Re: [Map Tutorial] AASv4

Post by therazer »

Can i get link to profile? :)
AFsoccer
Retired PR Developer
Posts: 4289
Joined: 2007-09-04 07:32

Re: [Map Tutorial] AASv4

Post by AFsoccer »

therazer wrote:Can i get link to profile? :)
Project Reality Forums - View Profile: [R-DEV]VapoMan

Make sure it's okay. Maybe he'll even make the changes for you, if he's not too busy.
User avatar
Ason
PR:BF2 Developer
Posts: 1749
Joined: 2012-10-22 10:29

Re: [Map Tutorial] AASv4

Post by Ason »

what if i want, lets say 1 mainbase for each team and then 3 neutral flags? this means 1 attack routes for each team, but I can only put one SGID/CP so that means only one team will be able to attack ??

And btw, is it possible to work with the editor at the same time i am working in my maps con/text files? Or do i need to close the editor everytime i want to make changes in textfiles of the map ?
Post Reply

Return to “Modding Tutorials”