Wednesday, June 14, 2006

A young mans primer on C# Game Development

I've become totally distracted by batching at the moment. Mainly because I think it will kill my tearing problem in EINFALL and this would make me happy.

I still don't understand the very very root cause of the problem so I've asked on the gpwiki forums.

I've also been writing a program that has many different methods of rendering a tile map, and seeing which ones best. I still haven't done one that actually batches yet but I've still managed to get double the frame rate by using a dirty flag and cutting out a per frame SetStreamSource call :D

I think I finally understand how to approach a nice batching algorithm, I just wish there was a little more code around. I'm not quite sure what flags to set and things to get optimal results.

Also I want a greasemonkey script called "GrammarNazi", it would search each page for such things as "could care less" and would correct them to "couldn't care less", the same for "addicting" and other bits and pieces. It would making browsing the web more pleasant.

I'm also thinking a little about a story generator, I've not written anything down but I do have few ideas in my head. I mean like a written story nothing to do with a game.

4 comments:

Jani said...

Every time I've had tearing, turning vsync back on has helped and usually people warn about turning vsync off because tearing might occur.

I don't know what flags you're talking about at all =)
I could probably post my batching stuff, although it's still a "work-in-progress" as it is probably missing things I/someone might need later.


A GrammarNazi -plugin would not be any good! What if someone meant he really COULD care less than he does? ;)

Regarding your post on the forum (don't have an account and can't be bothered to make one atm), the slowness of a Draw* call is because the driver has to switch into kernel mode and back to user mode (or something) and that's supposedly not a very fast operation


Dynamic vertexbuffers - set Usage flags when creating the buffer to Usage.Dynamic | Usage.WriteOnly

When locking, use LockFlags.Discard (which happens to work only with Usage.Dynamic)


Now this was an incredibly long comment =)

Jani said...

Oh it only looked long in the preview. Duh. :]

Dan said...

I think being able to care less than actually currently do, is something that never needs expressing in English, as it's generally taken as a given :D

I wouldn't mind seeing your batching stuff if you don't mind, just the filling of thr dynamic vertex buffer and creating it in the first place.

Tearing occurs with vsync on or off :(

Jani said...

Posted the whole thing: http://zeeohemgee.blogspot.com/2006/06/batching-code.html