UIMPI - Performance Limiter for BeamMP [RELEASE]

A lightweight and optimized performance rating system for BeamMP servers. Automatically calculates vehicle performance ratings and enforces server limits in real-time.

UI Screenshot 1
UI Screenshot 2

Features

  • Real-time Performance Rating - Calculates PI (Performance Index) based on power, weight, drivetrain, grip, and braking
  • Automatic Enforcement - Freezes vehicles exceeding the server limit
  • Visual UI App - In-game display showing vehicle stats and rating class (D/C/B/A)
  • Server Control - Set custom performance limits for balanced gameplay.

I know my formula isn’t completely accurate, and I’d really appreciate feedback on how to make it more precise.
I’ve put a lot of effort into creating this mod, and there’s plenty of room to improve its user interface. I’m not sure how useful it actually is, so please give it a like only if you actually use it, not just because you enjoyed seeing it, that way I’ll know whether it’s worth putting more time and effort into improving it. :thinking:

4 Likes

Hey you should totally also factor downforce into the math, i know its hard, but it plays such a huge role that misratings are easily possible (:

1 Like

I had a version of the mod that displayed real-time aerodynamic data, but I removed it because it couldn’t be practically reflected in the final performance score
The downforce data you get at launch is basically ±0 because it’s completely dynamic and can’t really be predicted on a static basis
I’ve tried to find proven formulas that can estimate aerodynamic behavior based on other static parameters of the car, but I haven’t found any yet
Honestly, I was pretty disappointed by this and I completely agree with you

1 Like

I feel you, i had ran into the same issue. What i ended up with was to generate a abitrary downforce value given the triangles at spawn. So imagine you shoot a beam at the center of a triangle and then look by how much it deflects up. Multiply that by the m2 of the triangle and add in the lift coef somehow.

Imma give you the code, altough you have to replicate it as im using my own vec3 library to make my code free of garbage for the gc.

Also added comments for you

VARBUF.evalTriangle = {Vec3(), Vec3(), Vec3(), Vec3(), Vec3(), Vec3(), Vec3()}
local function evalTriangle(n1, n2, n3)
	local m_pos, v_dir, e_pos, e1, e2, normal, reflect = unpack(VARBUF.evalTriangle)
	v_dir:set(obj:getDirectionVectorXYZ()):unm() -- unm is (x * -1)
	
	-- middle of the triangle
	m_pos:set(
		n1.x + n2.x + n3.x,
		n1.y + n2.y + n3.y,
		n1.z + n2.z + n3.z
	):div(3) -- (n1 + n2 + n3) / 3
	
	e_pos:setV(m_pos):sub(v_dir) -- m_pos - v_dir
	
	-- edges
	e1:set(
		n2.x - n1.x,
		n2.y - n1.y,
		n2.z - n1.z
	) -- n2 - n1
	e2:set(
		n3.x - n1.x,
		n3.y - n1.y,
		n3.z - n1.z
	) -- n3 - n1
	
	-- create normalized normal of the edges
	normal:setV(e1):cross(e2) -- e1 cross e2
	local area = normal:length() * 0.5 -- grab area before normalizing
	normal:normalize()
	
	-- create exit dir
	local dot = v_dir:dot(normal)
	reflect:set(
		v_dir.x - 2 * dot * normal.x,
		v_dir.y - 2 * dot * normal.y,
		v_dir.z - 2 * dot * normal.z
	)
	
	if reflect.z < 0 then return 0 end
	local angle = v_dir:acosAngle(reflect)
	
	return angle, area
end

VARBUF.evalDownforce = {Vec3(), Vec3(), Vec3(), Vec3()}
local function evalDownforce()
	local c_pos, n1, n2, n3 = unpack(VARBUF.evalDownforce)
	local total = 0
	
	c_pos:set(obj:getPositionXYZ()) -- global veh pos
	for _, triangle in pairs(v.data.triangles) do
		if triangle.liftCoef then
			n1:setV(obj:getNodePosition(triangle.id1)):add(c_pos) -- local node pos + global veh pos = global node pos
			n2:setV(obj:getNodePosition(triangle.id2)):add(c_pos) -- ..
			n3:setV(obj:getNodePosition(triangle.id3)):add(c_pos) -- ..
			
			local angle, area = evalTriangle(n1, n2, n3)
			-- ...
		end
	end
	
	return total
end

I’ve been waiting for someone like you – thank you so much for the feedback! :tada:

In the mod, I worked with relatively objective data: power-to-weight ratio and estimated acceleration. Then I added a system of bonuses or penalties of up to 20% for braking force, along with an additional bonus of up to 20% for vehicles with particularly good grip.

I ran quite a few tests, and the best way to explain it is through this example:

Grip values generally range from 1 to 3.

  • In the range of 1 to 1.5 grip has almost no impact on performance, so no bonus is given.
  • From around 1.5 onwards, you start seeing real improvement, so I added a gradually increasing bonus of up to 20%.
  • Above 2.5 the grip is already excellent, so there’s no need for further bonuses.

It’s not an exact science, but it’s been tested on dozens of cars and holds true in most cases.

Regarding your formula – I’m not great with physics, but it’s clear you understand well how it should affect the results. In order to integrate it correctly into the mod, we need to know:

  • At what speed does aerodynamics start to have a noticeable effect?
  • From what level of downforce does it begin to significantly impact performance?

Once we have that data, we can greatly improve the mod’s accuracy.
If you can investigate those values and come up with some clear conclusions, that would be amazing.

You are definitely asking the right questions, since these factors very well play a big role. Tho you will have to answer them yourself as im currently tied to other projects

Now updated to version 1.2

Improvements:

  • Details panel now opens/closes with a single click on the UI

  • Name tags now show performance ratings

updated to version 1.3

:rocket: Fixed an issue where all vehicles were incorrectly detected as AWD.

1 Like