Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't you develop XNA games in VB.Net?

Tags:

.net

xna

I know there's no VB.Net project type for the XNA games but as a simple test, I threw together a VB Solution which references Microsoft.XNA.*. It has a class which implements Microsoft.XNA.Framework.Game. Then in the C# Game1.cs, I simply removed all the boilerplate code and modified it to inherit from my VB class...

namespace MyGame {
    public class Game1 : GameEngine.Engine {
    }
}

Which is inheriting...

Public Class Engine
    Inherits Microsoft.Xna.Framework.Game

    Protected Overrides Sub Update(GameTime As Microsoft.Xna.Framework.GameTime)
        If GamePad.GetState(PlayerIndex.One).Buttons.Back = ButtonState.Pressed Then
            Me.Exit()
        End If

        For Each Element In Elements
            Element.Update(GameTime)
        Next

        MyBase.Update(GameTime)
    End Sub

   ...

This seems to work and I've been able to load content, render a model, take gamepad input, etc...

So what I'm asking is... Is there really a restriction due to some advanced features not supported in VB.Net or is it merely that no project templates/support are available?

Is there some performance optimisation when compiling to MSIL that the VB compiler misses?

like image 493
Basic Avatar asked Feb 07 '12 09:02

Basic


People also ask

Can you make a game with VB net?

Yes vb.net can make a game, arcade,FPS,RPG,MMO or what ever you what within your ability to code.

What is the purpose of XNA Framework?

The XNA Framework provides support for both 2D and 3D game creation and allows use of the Xbox 360 controllers and vibrations. XNA framework games that target the Xbox 360 platform could only be distributed by members of the Microsoft XNA Creator's Club/App Hub, which carried a $99/year subscription fee.

Does MonoGame use XNA?

MonoGame is an open source, C# framework that implements the application programming interface (API) of XNA, Microsoft's late game development toolset that was retired in 2013. It also supports all .


1 Answers

VB.NET and C# both compile to the same MSIL at a semantic level, so it's not a technical limitation. As you've seen, it's not too difficult to hack together a VB.NET app that accesses XNA.

The restriction is simply because examples have to be written in a particular language by a person, and most professional game developers will be coming from a C++ background. It's a human resource limitation - they can only write so much sample code.

There are also some performance differences between C# and VB.NET, which may have contributed to Microsoft's decision.

Update: It also turns out that VB.NET doesn't support unsafe code. You'll often find cases where unsafe code is necessary in games programming, for performance reasons. I have a feeling that Microsoft's decision was made based on a compound list of reasons.

like image 182
Polynomial Avatar answered Oct 04 '22 03:10

Polynomial