|
Written by Markus Ewald
|
|
Thursday, March 17 2011 09:54 |
|
A few hours ago, I uploaded a new release of the Nuclex Framework
to CodePlex. There has been an intermediate release, R1323, which I didn't
announce here because it was more or less just a stop-gap measure to
stop reports for issues in the old (old, old) R1242 release where my
Nuclex.Input library was still subclassing XNA's Window.
This is what changed from R1242 to R1404:
-
Thanks to a generous contribution by Adrian Tsai, the TrueType importer now accepts
standard Windows font names - this is a big step towards being a drop-in replacement for
XNA's own sprite font importer.
-
The TrueType importer now lets users choose different hinting algorithms. No hinting
will result in MacOSish blurred text that stays true to the font's metrics. The
auto hinter from FreeType is a nice compromise between forcing strokes into a pixel
raster for sharpness and retaining the font's look (and imho the best option).
Native will produce a perfect match with Windows' font rendering, producing sharp
letters that may deviate from the font's actual metrics a bit.
-
You can now decide whether SpriteFonts imported by the TrueType importer are centered
on their baseline or on their upper end (like XNA). This, together with the improved
font name lookup turns the Nuclex TrueType importer into a 100% drop-in replacement
for XNA's font processor.
-
Nuclex.Input's game pads now provide a method
.GetExtendedState() with
which you can access all of DirectInput's 128 possible buttons, 24 axes and 8 sliders.
I designed this so that there's zero overhead if you don't use the
.GetExtendedState() method. The ExtendedGamePadState
already normalizes axes for you (from -1.0 to +1.0 for axes and 0.0 to 1.0 for sliders)
and in general is much nicer to work with than using DirectInput directly!
-
Nuclex.Input now supports TouchPanel input. That includes mocking TouchPanel input:
You can easily simulate the TouchPanel in your unit tests:
var m = new MockInputManager();
m.GetTouchPanel().Press(42, 10.0f, 10.0f);
m.GetTouchPanel().Move(42, 20.0f, 10.0f);
m.GetTouchPanel().Release(42);
-
The GUI is now based on the Nuclex.Input library. That will allow me to soon
implement TouchPanel input and make the GUI usable on Windows Phone 7. Note that
you can easily hack Windows Phone 7 support into a project by converting
touch input into mouse input. Due to the modular design of Nuclex.Input, you don't
have to touch a single line of code, simple create your own
IInputCapturer!
-
The game state manager has undergone a redesign. Existing projects shouldn't be in
trouble, the redesign gets rid of the GameStateManager reference (you can remember
the Reference yourself if you want your states to initiate a transition themselves).
Pop-up game states similar to XNA's game state management example are now supported.
-
Upgraded to NMock 3.0. This is mostly an internal change but it really helps being
refactoring-friendly as my unit tests no longer contain method names hardcoded in
strings anymore.
-
All assemblies in the Nuclex Framework are now signed with a strong name, this no longer
preventing you from signing your own assemblies.
-
And of course, all issues that were reporting through various channels have been
fixed -- excluding two possible problems I can't yet reproduce, but will mention here
for honesty: the AffineThreadPool might sometimes be skipping a task under heavy load
and there might be a problem in the PrimitiveBatch when it is handed large amounts of
vertices. I couldn't reproduce these issues and they're not occurring in my own game,
but if anyone notices such an issue, please contact me!
|
|
Written by Markus Ewald
|
|
Saturday, October 02 2010 13:19 |
|
There's a new release of the Nuclex Framework
available on CodePlex!
The new release adds a new library, Nuclex.Input, which is a very lightweight
library that adds seamless support for DirectInput game pads and joysticks,
well-behaving keyboard text input, event-based input and the ability to mock
any kind of input in your unit tests. Instead of firing up your XBox 360
each time, you can now write simple tests that simulate controllers being
attached and detached.
Also new is full support for XNA 4.0 on x86 and XBox 360. Windows Phone 7
is also supported by most of the libraries. The PC builds all target
the .NET Client Profile, allowing you to reduce the footprint of your
installer. Special .NET 4.0 client profile builds of the third-party
libraries (LZMA, NUnit, NMock, log4net and SlimDX).
Of course, all bugs reported since the last release have been fixed!
|
|
Written by Markus Ewald
|
|
Monday, August 23 2010 15:12 |
|
Developers following my twitter feed may already know that in
the past few days, I've been working on a new component for
the Nuclex Framework: Nuclex.Input. This component aims to
solve all problems I ever had with input devices in XNA :)
It's a very simple library that provides input device classes
similar to the ones in XNA (Keyboard,
Mouse,
GamePad),
but instead of 4 game pads, there are 8 (with indexes 5-8 for
DirectInput-based controllers). All input devices
provide events (like KeyPressed and
CharacterEntered on the keyboard or
MouseWheelRotated on the mouse, for example).
Here's a quick run down of the features:
-
Well-behaving keyboard text input
- Honors keyboard layout and system locale
- Supports XBox 360 chat pads
- Very easy to use: just subscribe to an event
-
Support for standard PC game controllers
- Works with any DirectInput-compatible controller
-
Mouse movement with sub-pixel accuracy (postponed)
-
Allows event-based input handling
- Fully type-safe: events instead of message objects
- Only compares states if events have subscribers
- Mouse and keyboard don't have to compare states at all
-
Zero garbage: doesn't feed the garbage collector
Curious? Click on "Read More" to view some code samples!
This component will be in the next release of the Nuclex Framework!
If you want it now: Nightly builds,
Source code (svn)
|
|
Written by Markus Ewald
|
|
Sunday, December 20 2009 19:31 |
|
Series
I'm planning to start a short article series:
There are a lot of XNA tutorials out there that explain the basics -
how to display a sprite, how to do collision detection and how to
render a bunch of colorful particles with additive blending. But there
aren't many articles that explain to you how you're supposed to put it
all together - how to structure a game so that it is easy to extend and
remains manageable when the amount of code begins to grow.
The discipline that deals with this issue is called software architecture.
Like programming, or any other creative process, it relies a lot on
tacit knowledge -
finding a good solution without first running down an alley of dead ends
(that you can identify using the Principles
of Object-Oriented Design) requires a lot of experience.
What I will do in this series is let you look over my shoulder as I design
a small game and try to explain my motivations for choosing one design
over another while I do so. This will give you a solid starting point and
an understanding of the design process that you can apply to your own
game projects.
|
|
Written by Markus Ewald
|
|
Thursday, December 03 2009 18:16 |
|
I just uploaded a new release of the Nuclex Framework on CodePlex!
It has been a lot of work getting the GUI library finalized. For once, I really wanted
to have 100% unit test coverage on the whole library, which meant a lot of work
ensuring the design allowed for this and thinking of all the test cases. But hey,
what other GUI library can provide that level of unit tests! :)
Another feature I didn't want to let go of was control navigation with the game pad
and cursor keys. The idea is that you, the developer, just throw some controls on
the screen and the GUI will automatically figure out which control to change focus
to when the player uses the thumb stick on his game pad. This means you can just add
four buttons labeled "New Game", "Options", "Credits" and "Quit" to your screen
and voilà, you've got a main menu the user can interact with using his mouse,
keyboard or game pad.
|
|
Written by Markus Ewald
|
|
Sunday, November 29 2009 20:35 |
|
Noticed anything different about this website recently?
I just finished a complete overhaul of my website. Because my website design skills are
utterly hopeless, this time I just gave in and bought a finished template that I
had fancied for some time already.
|
|
Written by Markus Ewald
|
|
Wednesday, October 21 2009 18:00 |
|
I just uploaded a new release of my WiX XNA Installer template that has been updated
to XNA 3.1!
If you happen to have a customized installer built on the XNA 3.0 template, fear not,
for the required changes are very small! Use your favorite
Diff/Merge tool and copy over any changes referring to Xna_3_1 into
your existing installer.
I have declared this release a beta because I haven't gotten around to testing it on
all possible operating systems.
|
|
Written by Markus Ewald
|
|
Monday, September 21 2009 20:30 |
|
The Nuclex Framework has been released to CodePlex today!
Instead of only writing about all the cool stuff and then pointing people at my Subversion
repository whenever someone asks for the source code, I finally sat down and published
the entire Nuclex Framework on CodePlex, together with lots of examples, documentation
and screen shots.
The Nuclex Framework consists of small isolated building blocks that you can pick from,
so you can easily use just the things you require and ignore the rest (or even create your
own trimmed-down edition of the framework if you're not worried about doing it all again
when a new version is out).
All the highlights I wrote about in this blog (and quite a lot that I didn't write about)
are neatly organized in there. And the code's quality should hopefully speak for itself :)
Just to list some of the more interesting things, there's a
Deque
collection (faster than List<> and LinkedList<> and much
less garbage), 3D
vector font rendering code, 7-Zip
content compression, a 3D
SpriteBatch equivalent, rectangle
packing algorithms for texture atlas creation, a
flexible
multi-threaded particle system, a
work-in-progress
GUI library with skin support, a cleaner
game
state management system, a debug
overlay renderer and some helpers that allow you to automatically
create VertexDeclarations from a structure without listing the
VertexElements by hand.
So what are you waiting for, check it out! :D
|
|
Written by Markus Ewald
|
|
Sunday, April 19 2009 18:42 |
|
This past week I've been working on my WiX XNA installer template again
because I really wanted to integrate installer generation into my
continuous integration builds. That way, I can hand test versions to
friends without explaining in detail how to get it to run and it's one
less worry I have when I release the game.
After some FAQ reading and some questions on the XNA Forums, I had the
certainty that XNA 3.0 can be deployed with .NET 2.0 only (if you change
your project configurations to target .NET 2.0). This is good news because
the .NET 3.5 installer is huge and, on a fresh system, I've had about a
1 in 10 success quote of the installer finishing without an error, so
my trust in the .NET 3.5 installer is completely shattered.
|
|