Game Development on a New Frontier RSS 2.0
 Wednesday, April 02, 2008
(I need to get in the habit of posting when I don't have code to share.)

Something I've wanted to do for a while is develop a really flexible and highly configurable particle system for XNA.  I've seen some solutions (samples, really) that are rather hacked or not very extensible.  Microsoft XNA Unleashed had a solution that I thought was decently constructed and easy to use with small projects, but was still fairly constrictive for what I'd like to see.  Maybe I've just been pampered....

Several years ago, I ran across the Particle Flow system in 3ds MAX.  It is an incredibly powerful system.  Using a state machine driven system, it provides a drag-and-drop view for designing systems.  Modifiers such as rotation and scale can be added at different states, if/else conditionals can be added for branching, new spawning/death events can be added at will, and even collision checks against objects in the 3ds scene.

So, I'm going to start designing a particle system similar to Particle Flow that can be used with XNA and I'll be detailing my progress right here in my blog.  I think to start with, I'll break the system down into these parts:
  • The system:
    • States
    • Rules
    • Particles
The state machine system will be broken into states (duh).  Each state will hold a list of rules, which will consist of different attributes (rotation, scale, position), actions (spawn, die), and hooks (attachments to [update: point] sprites) to begin with.  Tentatively, conditionals will be added eventually, as will such things as AI behaviors, attaching 3D objects, and bounding volume collision checks.  The particles will be the physical objects in the system.  Each time a particle is created, it will start at the top of the state machine specified during its creation.  Some particles may spawned by other particles and may traverse the same state machine or a different one.

That's what I'll start with and we'll see where this takes me!  Leave me a comment if you have a suggestion or questions.

[Update:] I think I'll have a top-level particle system that will hold all of the particles, as well as handle their updating and rendering through the use of dynamic vertex buffers, as done in the Creators Club sample.

Cheers!

Devan

Wednesday, April 02, 2008 6:20:30 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0] -
XNA
 Sunday, March 09, 2008
I’ve made an extension to the Console component sample posted on Ziggyware. It provides access to a Lua virtual machine through the console. I believe many of you budding (or experienced) XNA developers out there may find of use.
Sunday, March 09, 2008 4:52:01 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0] -
.NET | XNA
 Saturday, March 08, 2008

A few years ago, I came across this excellent article, written by Martin Echenique and hosted on GameDev.net.  It discusses integrating Lua scripting into .NET projects by assigning custom attributes.  Using reflection, these custom attributes can be examined at run-time, allowing Lua functions to be loaded into the virtual machine dynamically.

I have taken Matin's project and modified it somewhat.  First, I added the capability to sub-class Lua packages, allowing packages to contain other packages.

Second, I have made the Lua virtual machine (VM) non-static.  This was done for two reasons.

First, I was having issues with exceptions being thrown due to reloading objects multiple times into the VM.  This is caused by trying to register any functions/packages with a name that has already been registered.  This is still an outstanding issue to be corrected in a future version, but is avoidable if you only load the functions/packages when you create the VM, then destroy the VM when you are finished with it, so it gets re-built the next time you run it.  Not the most elegant solution, but it has served my needs so far and I haven't gotten around to fixing this yet.

The second reason is that by creating separate virtual machines, you can restrict different security access in your Lua functions.  For instance, you can have a public Lua VM that is available to end users of your game/application to modify interfaces or generate batch scripts.  In addition, you could have a separate administrator VM that allows an admin to make network-wide changes to everyone's application, or to provide game masters with the ability to change change events, spawn new creatures, and fix bugged characters at run-time in your MMORPG.

These libraries are required to build the revised LuaNetInterface (LNI) project and must be locally available to any projects that use LNI.  They do not need to be referenced by any libraries other than LNI itself, but they do need to be copied into your executable's local directory.

LuaLibraries_1.0.0.zip (652.09 KB)

These libraries come from the official Lua and LuaNet releases at http://luabinaries.luaforge.net/ and http://luaforge.net/projects/luainterface, respectively.

Here is the code for the revised LuaNetInterface project.  Reference luaXX.dll and LuaInterface.dll from the previous .zip into your build.

LuaNetInterface_0.1.0.zip (11.64 KB)


Cheers!

Devan Stormont

--

[UPDATE]  The files for this project have been added to Codeplex.  They can be accessed here:  http://www.codeplex.com/luanetinterface/.  Future revisions to the project can be found there.
Saturday, March 08, 2008 6:37:17 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0] -
.NET | General
Well, here we go again.

I suppose I ought to introduce myself.  My name is Devan Stormont and I am a firmware engineer and a game developer/hobbyist.  This blog is intended to be primarily a source for me to discuss new developments in Microsoft's XNA game development framework for Windows and the XBOX 360, as well as to post tutorials as time permits.

Hopefully, I won't forget my pasword again!

Cheers!

Devan Stormont

Saturday, March 08, 2008 2:20:44 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0] -
General | XNA
Categories
 
 
 
 
 
 
Archive
<April 2008>
SunMonTueWedThuFriSat
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Devan Stormont
Sign In
Statistics
Total Posts: 10
This Year: 10
This Month: 0
This Week: 0
Comments: 0
Themes
Pick a theme:
All Content © 2008, Devan Stormont
DasBlog theme 'Business' created by Christoph De Baene (delarou)