Game development in .NET (VB specifically) around 2012/2013 and performance vs C ++

So, with the new version of Visual Studio from Microsoft, it was released quite recently, and they seem to have added some performance improvements. Also, hardware is growing, and I was curious:

Will the game developed in VB.NET work fast enough so that users do not notice the difference between the developed C ++ game?

+4
source share
2 answers

Depending on the type of game; in a simple 2D board game, for example, rendering and calculations are not complicated, and it is unlikely that the user will see any difference. If the game requires real-time visual rendering of 3D graphics, there will always be a difference. Or with complex AI (for example, in chess, for example) - large amounts of data will certainly slow down the VB program, due to the collection of memory collected by garbage. However, you will never know until you have a good look.

I recently read an article about the effectiveness of managed languages ​​and how JIT can sometimes be even better than optimizing the compiler in the future, but I forgot where it was. I think it is googleable; you can look at it and JIT optimization in general (remember that both VB and C # are compiled into IL, which are then interpreted).

+1
source

I am working on a first-person shooter in C # using OpenTK for OpenGL / OpenAL bindings and everything is going well, so far. There are a few potential pitfalls, and there will always be some measurable speed difference between JITted IL and C ++, but if you are careful, you can minimize this difference to a point where this will not mean the end user.

Unload as much work as possible on the GPU. Processing Vertex processors will kill your frame rate if you are not careful, especially with animations and particle effects. Working with the GPU is the same in speed for playing in C ++ (although method calls can make it a bit more expensive, so try using VBOs / VAOs / etc.)

Check your game regularly. Check how many objects are allocated per frame, and try to reduce the number of distributions and, ideally, compensate for the entire selection for initialization. Also, don't be afraid to use the unsafe block in narrow math loops that are the bottleneck of your game. Use object pools to help you reduce selection when you start the game.

If you need 3D physics, I found that the Jitter Physics Engine is very good at not creating a lot of garbage at runtime and using object pools when needed.

0
source

Source: https://habr.com/ru/post/1435809/


All Articles