Rich's picture

OpenTK instead of Tao

Hello there!

I'm currently using Tao & Mono for my Project to rebuild a 10 year old 2D game.
I came to your side once in a while and I think that OpenTK is much more serious than Tao.

My question is now:

Is OpenTK a good choice for that? Are there more advantages than less cryptic code (which is a present from heaven for me)?

thx rich


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
objarni's picture

* OpenTK has linear algebra types which integrate nicely with the OpenGL API (vector, matrix, quaternion)
* OpenTK allows usage of .NET Color (a minor thing but sweet anyway)
* OpenTK feels a lot more .NETish than Tao
* OpenTK has some enum-separation allowing easier-to-write code (via IntelliSense), compared to Tao's "one enum to rule them all". (last time I checked at least - which was two years ago but anyway ...)

Rich's picture

Fair enough! So you would say OpenTK + Mono/.Net is fast enough for a 10 year old 2D Game?

thx rich

the Fiddler's picture

Absolutely.

Since you are aiming for 2d, take a look at AgateLib. It uses OpenTK and is easier/simpler than raw OpenGL.

Rich's picture

thx for the fast replies and hopefully i can announce my new project soon :)

BlueMonkMN's picture

I'm using OpenTK for Scrolling Game Development Kit 2, converted from Managed DirectX, and it runs significantly faster. It can also handle more sprites faster than the original Scrolling Game development Kit based on DirectX 5, which I assume is partly due to the fact sprite behavior is based on compiled rather than interpreted code now, thanks to .NET's ability to compile code at runtime. I haven't tested under mono as much, but I have run games compiled by both Visual Studio in Windows and Mono in Linux, and the performance of the projects compiled by Mono seems about the same; I just don't know how hard I could push the Mono/Linux version before I start seeing performance degradation. With Visual Studio, I believe I got at least a hundred sprites before I noticed anything (it's been a while since I ran the test). And I've done multiple layers of parallax scrolling tiles without any problem, of course (tiles are easier on the CPU than sprites).

the Fiddler's picture

The only place where I've seen Mono perform significantly worse than .Net is GC performance, but even this is being worked on (a new, generational GC is planned for Mono 2.8 IIRC). There are other differences, but few of these actually impact games (e.g. string/xml processing or things like that).

Interestingly, my current project runs significantly faster on Mono/Linux compared to .Net/Vista. I get ~72 fps on Linux vs ~60 fps on Vista, which is a tremendous difference for the amount of processing involved (relief mapping with multisampled self-shadows, SSAO, bloom filter on floating point buffers and quad-buffered stereo). I haven't tried to trace the cause yet - I doubt it's the runtime - but the difference is there and it's significant.

Even more curious is the fact that this is on Ati hardware, which is notorious for its Linux drivers.

In any case, performance is pretty good on both runtimes. Absolutely no problems on that front.

Kamujin's picture

I have to disagree slightly. The mono run time consistently under performs the .NET run time in many areas. They have made improvements in mono 2.2 targeted at improving performance, but quite frankly, Microsoft has out spent them by orders of magnitude in optimizing the .NET run time.

Having said this, I feel that the mono run time's performance is without question good enough for many projects. I think the performance variation you will experience in the underlying hardware will have far more impact than the difference between the run times.

objarni's picture

Is there a difference between "numerical program" (not using so much of the .NET standard libraries) and API-heavy programs (eg. WinForms/db/other standard lib stuff..)?

What I'm trying to get at, is if there is a difference between the byte-code/jit-compiler in .NET and mono, and if there are differences in the implementations of library routines.

the Fiddler's picture

The .Net C# and jit tend to create better code than the ones used in Mono. From benchmarks posted to the Mono mailing lists, the Mono BCL is slower more often than not, which is understandable if you take the platform abstraction layers into account.

However, there are two things that make Mono equally (or more) suitable to .Net for games: faster pinvokes and Mono.Simd. Most games make heavy use of unmanaged APIs and numeric computations and (bugs aside) Mono shines on these.

docflabby's picture

Hey rich,

As someone who is also remaking a 2D game (except in my case im making it 3d) i would highly recommend OpenTK

Why use OpenTK instead of Tao?
- OpenTK has ALL the functionality of Tao with alot less typing. the time you save in typing is amazing.
- You can use Tao and OpenTK side by side. Thus if there is something you need in Tao you can still use it
I still use Tao.devil to load textures and images.
- OpenTK has an amazing text writing utility which makes writing text to the screen easy. In Tao you have to do this all manually.

I started with Tao but as soon as i found OpenTK i switched. Its just so much easier to develop with.

This is why i use OpenTK :)