Jump to content

The One About Proxies


ChopBam

Recommended Posts

What is a proxy and how would it help in designing levels or assembling buildings?Proxies, at their core, are references to Mammoth presets that are placed on terrain pieces. I will repeat this later. First, let's establish the groundwork of how levels are put together.

The main level terrain is built in 3DS Max and exported to a file with the extension "w3d." This terrain file typically includes all the ground, cliffs, caves, and a few other things (including proxies).

Here are images of what is exported as the main terrain on Seamist, first shown without proxies, and then with. You can see we use them a lot!

1.png2.png

Once the file is built and exported, we use a program called Mammoth to make a preset that references this level terrain w3d file and places an instance of that giant map terrain piece on the level, so it starts as the main ground upon which everything else is built. After this point, we add everything else to the level that we want on it, which would include separate terrain pieces or tiles and various controllers that make everything work.

Below is an example of some waypaths in front of a war factory that were added in Mammoth (and the little blue building icon near the top right was also placed in Mammoth). The building, lights, spawners, and orange construction zone were all "proxied in" as part of the terrain file, so we wouldn't need to add them manually to each level. How cumbersome that would be!

3.png

In very old versions of APB, the main terrain file also included the actual buildings and trees, and some props would be placed using LevelEdit (the older program which Mammoth has now replaced). This led to problems and confusion in several ways.

  1. If actual buildings and trees are in the main terrain file, problems occur when those buildings and trees need to be edited or updated for any reason (the edit would need to be made, and then propagated manually to all of the buildings and trees in question on all of the maps that use them).
  2. In addition to this, if these are "baked terrain" as I'll call it, then there are also way fewer options regarding said objects.
  3. If objects such as trees, barrels, and rocks are placed on the ground in Mammoth, anything that's edited or placed on the terrain in 3ds max later on doesn't account for things that had been placed in Mammoth prior, so an interface disconnect takes place because those two very-related things would need to be edited across two different programs. For example if you place trees in mammoth, and edit the ground later in Max, then there are floating trees, sunken trees, or the trees could be merged with other objects that were placed there in Max. It would be an easy set of mistakes to make, and would simply be a frustrating way of doing it.
  4. LevelEdit/Mammoth simply isn't a very good program at the moment for placing and rotating objects, and painting objects isn't an option. It's a process that 3DS Max's UI handles much better.

Inside the spoiler below is one example of painting tree presets (aka proxies) in 3DS Max. Nifty!

Spoiler

4.gif

As a result of the issues listed above, we use something called proxies. Proxies, at their core, are references to Mammoth presets that are placed on terrain. If I place a proxy on a map, it's just an object (no mesh or polygons) that tells the game to place this Mammoth preset at this location, and rotate/scale it in such a way. Currently we proxy our buildings, infantry spawns, purchase terminal pokes, trees, and anything else that we want to operate as references rather than "baked terrain" or placed manually using Mammoth. Again, with proxies/references we have a lot more options, it's a huge time saver, lends to consistency, and it gives us the freedom to edit that preset once, having it propagated automatically to all the places where the proxies have been placed.

In Max, a proxy can look like a box, a triangle, a teapot, or literally anything you want it to be. In APB, we try our best to mimic the object that the proxy is referencing, while still making it obvious that the object is a proxy. It can be tempting to try to edit bits of the proxy object, thinking that it will edit the object's look ingame, but I want to make it clear that editing the proxy object won't do anything to affect the object's look ingame. All the game cares about is the location/rotation of the proxy object, not what it looks like. The preset will take care of what it looks like.

5.png
Because all these giant blue teapots are named appropriately as the Soviet base buildings on Seamist that they are meant to represent, exporting this would yield a map that looks correct, with Soviet base buildings and not teapots.

In APB's released SDK, you may find a file called that we named the "Proxy Masters" file. This contains a large set of proxies that we place around maps, and we use this file regularly to import those objects when designing levels, so we can easily place buildings, trees, and props. Here is what the file looks like at a glance.

6.png
Currently some of the buildings have two copies because the extra copy is the tunnel version of the building.

If you have ever used one of the w3d importers, you may find that it automatically turns all proxies into little yellow boxes, or some other form of Max primitive. This is consistent with the idea that the proxy objects/meshes don't matter, but the pivot point. However, it's best to try to represent the object that the proxy is referencing, so when it's placed on a level, it's easy to see at a glance what the object is and how much space it takes. For buildings, this is crucial if you need to cut holes in the ground around them.
What is the best way to create a proxy object?It may be best to have a source file for the preset that you'd like to proxy, but if you don't, it is easy enough to use the w3d importer (and the w3d importer also guarantees that the origin/pivot is in the right spot from the get-go). Whichever way you do this, open up the file in Max.

Today I'll make a proxy object out of this Refinery roof door.

7.png

Your object is likely to have multiple meshes. Decide which meshes you want to be a part of your proxy object. You won't want to use bones, bounding boxes, or other things that don't show ingame. Select these multiple meshes that you've decided will be part of the proxy object.

8.png
For me in this case, that would be sov-door and sov-glass.

Use Ctrl + V to copy and paste (use copy, not instance) the meshes you want to be in your proxy object, then use "collapse" in utilities to merge the copied pieces all to one object.

9.png10.png11.png

Now remove or hide the original meshes so only your new collapsed object is showing. Name this new object with the preset name that mammoth uses, and then put ~ as the suffix. E.g. if the preset in Mammoth is named t_pine, then the proxy object should be named t_pine~. Any characters after the ~ won't factor in to the preset's name, but will work to export multiple copies or instances or the proxies. If you had a pine tree preset in mammoth named f_pine, the placed proxies could be named f_pine~00, f_pine~01, etc. Or if you wanted to make the pine trees different scales, you would put a $ at the start, e.g. $f_pine~00.

12.png

Unlink the object if it is parented to anything.

13.png

Only if the object is animated: remove any animations that might be tied to the object. First make sure your animation slider is at frame 0, then drag a box over all keyframes and press delete key to remove them.

14.png
15.png
 

Remove all materials from the object. With it selected, press the buttons in the image below.

16.png

Reset xform, and right click on the object -> convert to editable poly.

17.png18.png

The pivot now needs to be at location 0 0 0 on XYZ (a.k.a. the origin or middle of the grid). We can see below that it's not already at the origin, so we'll need to move it there.

19.png20.png
21.png
22.png
23.png

Uncheck pivot only so you go back to normal editing mode.

Assign any object color and layer for organizational purposes.

24.png
25.png
Typically we try to choose colors that make the most sense, e.g. blue for Allies, red for Soviets, green for trees, etc.
Note * 2, I realize I used the Soviet doors to make the Allied proxy, but the fun part is that it doesn't matter!

Oftentimes we'll also assign a special layer for our proxies. Buildings are on the buildings layer, Trees are on a Foliage layer, and props that are proxies we typically just put in the Props or Proxies layer. However you want to do it that best suits your workflow, is how you should do it.

You can remove all collision settings, but make sure export transform (bone) and geometry are both checked.

26.png

Now with this door, I can place it exactly where in the building I want that door to be!

27.png28.png
Left: Door proxy placed in 3DS Max, Right: How it appears ingame.

What is the best way to place proxies on my level terrain?

There are different kinds of proxies to place on levels. Let's start with base buildings. Open the proxy masters file. Assume we're placing an Allied Barracks. Select the barracks, then open the object list with H and select everything underneath it in the hierarchy that you would like to copy over to your level.

29.png

Hit select, then File -> Save As -> Save Selected. I typically just save Untitled to desktop.

30.png

Now open your level file in Max, go to File -> Import -> Merge (I set this as a shortcut key Shift + M since I use it so often).

31.png

Select the Untitled file from the Desktop, then select all objects and hit OK. The Barracks will appear.

32.png33.png

If you did nothing else at this point and exported your map, you would have a Barracks there, but do note you wouldn't be able to travel between the floors because no hole was cut in the ground. This placement method can be done with any of the buildings, trees, or other proxies that you wish to use from the proxy masters file.

BONUS ROUNDI know this isn't about proxies, but so that we put a nice pretty bow on things, let's cut a hole in the ground for the Barracks.

If your terrain isn't already editable poly, convert it to that.

34.png

Now press 4 or click on the little polygon icon to activate polygon editing mode.

35.png

Select the polygons that fill the Barracks area and press Del to delete them.

36.png37.png

Now, get out of polygon mode (press 4 again) and attach the temp ground (which notably isn't a proxy) to your ground plane.

38.png


39.png

Now, go to Vertex mode (press 1) and start welding/collapsing these separate pieces together for each vertex. I set up a keyboard shortcut to help do this quickly. Customize -> Customize UI -> Collapse (Poly) set to button of your choice.

40.png

41.gif

Once it's welded all the way around you should have your hole cut for your proxied Barracks, and the basement should be accessible.

That's about it for now, folks!

Notes:
- The game doesn't care about what your proxy mesh is, it only cares about the pivot and its location and rotation (and sometimes scale).
- For objects to export from Max, there is a character limit of 15 characters, which means you want relatively short preset names if you want to proxy those presets. 10 characters would be a safe upper limit for preset names, so the limit would account for a $ prefix, the ~ suffix, and would support hundreds of that proxy object.
- Proxies only work if you place them in terrain objects, not if you place them on hierarchical tiles or other simple objects/vehicles that you make.
- APB's buildings are proxied terrain objects which proxy yet more objects. This means proxying can be nested as long as all the proxy objects exist in terrain presets.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...