Programming

warning: Creating default object from empty value in /home/hplus/enchantedage.com/modules/taxonomy/taxonomy.pages.inc on line 33.
Telling computers to do things.
jwatte's picture

Online Browsable Source-code

These pages contain the source code for Etwork version 0.4, in online browsable form.

jwatte's picture

Microsoft Connect issues

Microsoft has the Connect site, which works as a public feature request and bug report database for most of Microsofts products. At times, I do file bug reports on that site. The bugs have a "vote" feature, where the Microsoft groups apparently may pay more attention to a bug with higher votes.

jwatte's picture

Static reflection in C++ using minimal repetition

Don't Repeat Yourself.

That's a great rule for writing code. If you find that you repeat yourself in code, then you're probably doing something wrong. Writing code should be about expressing what's unique about something, not filling out standard forms of data. (Copy-and-Paste coding is the worst version of this)

Unfortunately, when it comes to providing serialization and editing information about classes in C++, the language falls down. In C#, and other .NET languages, and even in Java, reflection is rich and allows you to build nice, automated editors and serializers using minimal mark-up. Also, if you need mark-up, that mark-up can be done in-place where members are defined, typically using custom attributes.

jwatte's picture

The onward march of complexity (LRBni)

It used to be, a microprocessor was simple. It had instructions like "Load the accumulator from the address stored in the X register (LDA(X))." Or "Add register B to register A (ADD B, A)." And that was pretty much it. Time marched on, and we got more esoteric instructions, like "load effective address of scaled register indirect with offset" (LEA eax, [ebx*8+ecx]).

jwatte's picture

The Direct3D/XNA vertex transform pipeline -- how to go between model coordinates and screen coordinates, and back again!

1) WORLD matrix. This takes vertices from object-local space (0,0,0 in the middle of the object) to world space (position and orientation applied based on 0,0,0 at your "world origin" position). This is a convenient space to do normal mapped lighting and environmental reflection in.

jwatte's picture

Ultimate Sleight of Hand (MMO FPS where everybody wins)

Thinking about how a MMO FPS like Planetside was most fun when you were in a good group, and you were winning, I started thinking about how you could set up a situation where each side can have the impression that it's winning. Playing FPS against NPCs is not as much fun as playing against other people, so it seems like a preposterous idea at the outset.

jwatte's picture

Triggers in XNA games using C#

"So," you may ask yourself, "what if I figure out a way to detect that the player has hit a button, or stepped on a landmine, or entered a goal zone?

jwatte's picture

Making a sprite follow a path

A while back, I posted a simple program on the XNA forums that showed how to define a path, and then have objects follow that path. I figured I'd copy the code from there onto this site, for easy reference. The program below is a command-line C# program; you can compile it from the command line with "csc flypath.cs" and run it to test it out. Or you can copy the "follower" class from the middle, and use it in your XNA project. (The additional code, including the declaration of Vector2, is just there to make the test program work stand-alone)

jwatte's picture

Ah, yes, GCC and MSVC... Or, two compiler bugs in two hours.

Why is it that seemingly every week-end project ends up in tears and teeth gnashing over broken tools, instead of sweet progress? Why do computer companies keep cramming useless features into bloatware, instead of just making what they have, actually work?

jwatte's picture

Profiling an XNA game on Xbox

This code file implements a simple profiler for XNA games that run on the Xbox.
It allows you to measure the amount of time spent in different parts of your code,
and bins the different durations into statistics bins (so you can see if it's
"spiky" or even).

Syndicate content