Ravenfield

Ravenfield

Huge Complex Town Battle (V1.1)
Tips for Fixing AI, lag, and other misc stuff
Aright, so: the very first thing i wanna point out is the existence of grid snap in the editor. Holding shift will snap align objects to a grid as you move them, and you can set the grid to whatever spacing you want it to be (I usually use 0.5m for big structures like these). No real point in aligning every single prop in your map now, since that may break the rough alignment you already have going, but this is just something that should prove helpful in the future.

Now, for the first real point: AI behaviour fixes.

First, vehicles.
Currently the bots will ignore many vehicles in the Suburbs area. This is because many of the flags they wish to navigate to are inaccessible to vehicles. Unfortunatley, the AI have no contingency plan for when they cant drive aaaaaall the way to the center of a flag pole. So even if the capture range extends to a road or accessible area, they will immediately abandon a brand new vehicle if they realize that they cant park it basically on top of the flag. This applies to your flags that you have placed in courtyards, AND to all those sandbags and barricades dotting the roads. Even if the gaps between those barricades are wide enough for a human to drive through, the AI usually need extra space to navigate, though this can be mitigated somewhat with the use of Pathfinding boxes (more on this in a bit). To get bots to use vehicles properly, you gotta leave the roads relatively unobstructed, and ensure that flags can all be driven to.

Second: protect ranges.
I noticed that most of your protect ranges are huuuge, and often overlap. Generally, you dont want a protect range to extend far past the little base that houses the flag. Bots will chose the best vantage cover point when defending their flag, and if the best vantage point happens to be 90m away from the flag they're supposed to be guarding, this can make for some silly behavour on their part. Plus: vehicles are assigned to their flags via the protect range, so overlapping ranges may also result in one flag "stealing" a vehicle intended for another. Keep those ranges relatively manageable, and you'll see less airheaded bot behaviour.

Third: house navigation.
Ok so this part is a pain in the butt for everyone; bots usually wont navigate through house doorways properly. This is where pathfinding boxes and links become invaluable. The short version of it is: Pathfinding boxes create navigable zones, the precision and properties of which you can tweak freely. Pathfinding links are used to link a box's Navmesh to the map's automatic navmeash surrounding it, or for linking two boxes together, or for simply linking two unconnected bits of navmesh in general. They do this by creating a super specific tiny path from their start to their end points, that tell bots "you can walk this line if you need to". Without them, bots cannot enter or exit a pathbox legally.

Where houses are concerned, the doors are too narrow for the automatic Navmesh to "fit" though them. There are two solutions to this: 1 is to place a path link through every single door of every single house. This is tedious, and lame, and you might miss a few spots anyways. The faster, more elegant solution is to place one giant infantry pathbox over the entire island, and set it's Cell Size to 0.1, and character radius to 0.4. This will give a super precise grid for the bots to walk over, whilst also allowing them to sidle up close to walls, thereby fixing the one thing that prevented them from using doors. It may take a half hour for your map to generate pathfinding afterwards, but the results will be clean and functional. If you use this method, you should also link the external seafloor to the seafloor in the box in a few locations, and maybe place some one-way pathlinks off the skyscraper roofs to the ground below. This is to ensure that any stranded bots will swim/parachute back into the pathfinding box.

Using a large Car-type pathbox may also allow tanks and jeeps to squeeze through many barricades. The same principle applies: give them a low, precise Cell size and and a lower character radius. But, be warned, vehicles may get themselves tuck more easily against walls as a result, since they're no longe being super obstacle-shy as they drive around. A simple path link through a barricade opening may prove sufficient in many problem areas.

Now for the next major point: Performance
My laptop isnt very strong at all, so any perfromance hiccups will be felt by it. That, and the map editor is actually currently somewhat bad at optimizing objects out of your line of sight. This map actually doesn't handle too bad at all, ive played way laggier editor maps. But it gets way worse when i get into the downtown area. The first reason for this is the big mountain an the tall buildings, since anything that blocks large sight lines will seriously mess with the game's framerate. This is something that i believe is on the "to fix" list of the Developer though, and i dont expect you to just raze your cool buildings or mountains for something that is technically the game's shortcoming.

No, the thing i thing you may want to fix... is *dat object count*...
More objects means less frames, obviously. On a nice flat map, my computer can do over 3000 objects no problem. Hills make it worse, yeah, but so do more objects. I counted the number of objects on your map using the editor's hirearchy tab on the right. You had *over 16,000 props* on your map, i was floored that i could even play the dang thing! And of those 16,000, about 12,000 were just the tower beams you used for the skyscraper windows.

So here's a quick'n'dirty way to absolutely murder that object count on skyscrapers:
Take a Concrete Dock. Note the little indents on the sides of it; these will be what you use to decimate the number of Tower Beams/Struts that you use. Scale that dock up to skyscraper size. Then take a beam/strut, and scale it *almost as thick as the Dock. Make sure both objects occupy the same X and Z co-ordinates, using grid snap. You will see that the beam will start to poke out of the indents in the dock's sides, giving the illusion of multiple pieces being used.

After that, the rest is up to you. You could make 12-ish stories of windows using just 12 large, wide,flat beams intersecting two large Docks, rotated 90 degrees from one-another. Persoanlly, i would indulge in my obsession for efficiency and just use one single giant beam on the inside of two docks, leaving a vertical striated window effect. Either way, what you'll end up with is a skyscraper that, barring the little roof details, will cost you anywhere from 3 to 20 objects to make, which is *astronomically* more efficient than the 350+ props per building you have right now. Do this, and many a low/middle-range CPU will thank you as a result.


Right-o, that's all the big issues, i think. Make sure to also give names to your flags, it's bad to gave a 14-flag map where nothing is named. The ambition of this map is really something, especially since it actually works pretty well, instead of being yet another oversized, underpopulated mass of land that the creator abandoned an hour in. Like, seriously, this is one of those where i go "dang, i can see all the parts that they placed down, but how'd they plan it out??". Job well done.

I looked at the page's stats, and it looks like this is going to be another map that gets somewhat ignored, mostly because of the thumbnail. It's certainly adequate, but editor maps have to fight extra hard to be noticed with their generic props. If you feel up to it, after updating this version, you may want to upload a copy of this map with a new custom thumbnail. Making one is pretty simple, you can get something decent with MS paint, it's just that locating the save folder to place them in is a little wonky. I can't give them to you offhand, but the Instructions for this have been bookmarked in the Ravenfield Discord server, and people will also be able to help you out further there.

So yeah, congratulations on making a truly complex town map that also has a nice cozy feel to it, and that also has some good spacing and logic to it. Hope all this helps.
< >
Showing 1-3 of 3 comments
thohgc 14 Jun, 2020 @ 4:40am 
respect
sovietsteve94  [developer] 15 Jun, 2020 @ 8:57am 
Thank you for so much information! I am still learning to use the editor and all the tips you gave me are extremely valuable. I will try to incorporate as much of this as I can into the map and upload an updated version. Thank you!
no prob!
< >
Showing 1-3 of 3 comments
Per page: 1530 50