Breaking the seat limit

Insights into the development of Project Reality.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7624
Joined: 2010-08-06 18:06

Breaking the seat limit

Post by Mats391 »

The seat limit of 8 players per vehicle was assumed to be hardcoded for a long time. However, it turns out that it just never got really tested properly. After looking at the code and giving it a test, we found out that the real hardcoded limit is 10 players per vehicle. Those who already read the v1.6.3 update highlight will know that we broke that too and this DEV Blog will talk about some of the challenges that we had.

The first big issue and main reason why the seat limit was assumed to be hardcoded, was the control binding. Normal BF2 only has controls for switching to seats 1 to 8, but if those 8 seats were filled, you would enter the normally unreachable seats. While that would work for normal gameplay, it would make testing seats nearly impossible. With v1.6 we added new server side capabilities to hook and interact with the engine through Python code. [R-DEV]AlonTavor used these to change the F8 key binding to cycle you to the next open seat instead of switching to seat 8. This will only work on dedicated servers.

Next up was COOP. The AI module does not like any vehicle with more than 8 seats and crashes instantly on map load. This could have been avoided by creating copies of every vehicle for coop mode. Luckily the crash was fixable through some binary editing, so coop players can enjoy the same amount of seats as everyone else.

With these two issues out of the way, BF2 would support up to 10 seats per vehicle without any further changes. The limit of 10 comes from the client side HUD showing the seat positions and names of players in the vehicle. The code for that has no out of bounds check and would start accessing part of the memory it should not touch which results in a crash. Even if the seats would not show up on the HUD, it would still result in a crash. We fixed this by injecting an overflow protection through the Launcher. However this also means the normal HUD will not work for any seat above 10.

That brings us to the next step: Making a nicer HUD for used seats. While non-essential for this to work, it ties everything together. As the BF2 HUD only supports 10 seats, we started making our own HUD that gets controlled by the Launcher. For that we count the amount of currently occupied seats that do not have a seat dot in the HUD and show this number as the passenger counter in the bottom left. We decided to use this counter even for vehicles that do not go past 10 seats to ensure consistency and easy recognition across all vehicles. As such only the vehicle crew gets position dots for their seats. The crew is roughly defined as pilot/driver, co-pilot/co-driver and any gunner.
Image
At last the only thing left to to do was to go through all our vehicles, figure out how many seats it should have and then add them. Since some vehicle got created with the assumption that there would never be more than 8 seats, we even had to change some vehicle models to add more.

Passenger numbers in v1.6.3(in game values may have changed since list got updated):

Land vehicles:
Image

Air vehicles:
Image

Sea vehicles:
Image
Image

Mineral: TIL that Wire-guided missiles actually use wire
CmndrFello
Posts: 9
Joined: 2020-01-11 00:24

Post by CmndrFello »

Amazing work! very nice to hear this kind of achievement!
Can't wait to see how it plays out in gameplay
Filamu
Posts: 318
Joined: 2006-12-15 14:20

Post by Filamu »

That is just fantastic! It is gonna change quite a few things, and no leaving people behind.
If it wouldn't be too weird I would for gameplay sake up the +7 man apcs to 8 just to avoid the old chopper issue.
Aleon
PR:BF2 Contributor
Posts: 98
Joined: 2009-11-14 18:25

Post by Aleon »

Would this mean that squads could have 9 people now, given that transporting 8+ is no longer a problem?
Image
PatrickLA_CA
Posts: 2243
Joined: 2009-07-14 09:31

Post by PatrickLA_CA »

Can't wait for those 29 Chinook kills
In-game: Cobra-PR
sweedensniiperr
Posts: 2784
Joined: 2009-09-18 10:27

Post by sweedensniiperr »

I gotta be honest. I wasn't that surprised by this. When you broke the 64+ player limit i knew in my mind that you could do anything really(given enough time).
Image
VTRaptor
Posts: 330
Joined: 2015-06-25 14:49

Post by VTRaptor »

I'm pretty sure CV90 holds 8 dismounts, not 7.
manh21
Posts: 9
Joined: 2018-11-06 15:03

Post by manh21 »

Nice work
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7624
Joined: 2010-08-06 18:06

Post by Mats391 »

Filamu;bt11160 wrote:If it wouldn't be too weird I would for gameplay sake up the +7 man apcs to 8 just to avoid the old chopper issue.
That is something we thought about, but decided against it as we decided to go as close as possible to real life capacities. Also there are still some APCs that only fit 6, those would have to updated or where should we draw the line? Some APCs even only fit 4. Last but not least, some of them hardly even fit the 7 inside so there simply would be no room for the 8th ;)
Image

Mineral: TIL that Wire-guided missiles actually use wire
schakal811
Posts: 86
Joined: 2011-05-22 12:35

Post by schakal811 »

Wow this is really awesome, good work!
Sapper28
Posts: 44
Joined: 2010-03-20 08:56

Post by Sapper28 »

The devs prove themselves to be amazing yet again.

GG, well done.
Since 0.85 i think... too long ago

Image
vonLidl
Posts: 12
Joined: 2009-07-27 12:11

Post by vonLidl »

This is so cool. All these years and news like this come!
:wink:
Michael Z Freeman
Posts: 240
Joined: 2009-03-27 18:45

Post by Michael Z Freeman »

Truly amazing. Is any of the original BF2.exe left in there after all the patching ? Thanks for keeping Coop in the loop as well. Now to fix whatever DICE did to break the Coop commander artillery. Still pisses me off that they did that, and then never patched it themselves.
Image
jeezyd
Posts: 1
Joined: 2022-12-23 17:17

Post by jeezyd »

Can't wait to explore the whole forum.
lindamartn15
Posts: 2
Joined: 2023-05-17 19:19

Post by lindamartn15 »

Thanks a lot very much to all the devs for the high quality and results-oriented help.
credit repair durham
adamusa
Posts: 3
Joined: 2023-05-20 08:03

Post by adamusa »

Thank you for sharing this information. Just wanted to let you know that I visited your website and really enjoyed and learned a lot from it. I can't wait to read many of your posts. slither io
emmstormintl
Posts: 1
Joined: 2023-06-06 05:03

Post by emmstormintl »

Such a dope game! I'm looking forward to play that during my days off. Do you want your commercial space to look dope? Click this link here now!
Pulithey
Posts: 1
Joined: 2023-06-12 09:45

Post by Pulithey »

Does this forum still papa's burgeria work?
Post Reply

Return to “Development Blogs”