Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Jake Armitage
Dec 11, 2004

+69 Pimp

IcePotato posted:

doesn't work, because that's the elapsed time between steps.

Why doesn't that work, isn't that what you want? I'm assuming you want to update the timer whenever Update is called, and subtract off the elapsed time since the last time update was called. You'll get that from gameTime.elapsedGameTime.

[edit] Ah I see. Yes, you want elapsedGameTime, not elapsedRealTime.

Adbot
ADBOT LOVES YOU

Jake Armitage
Dec 11, 2004

+69 Pimp
For those of you working with XNA, I got a bunch of requests to do a series of tutorials on building animated models with Blender for XNA and finally did it. This has always been a major stopping point for me -- either I hire someone to do it, or the project dies. I always just wanted to know how to whip up something temporary in Blender and get it to work, and then hand it off to a modeler.

Links:

Part 1: Non-UV Texturing
Part 2: UV Texturing
Part 3: Rigging
Part 4: Animating and Exporting

The topic comes up every 5 seconds on the XNA forums, so these were geared towards coders.

Jake Armitage
Dec 11, 2004

+69 Pimp

Girl With Huge Tits posted:

One of my problems is I can't find any examples of doing something like I want to do, so maybe you could answer this. If I wan't to have normal mapping and toon shading in one shader, should they be different passes in the same technique, or different techniques?

You can call functions from other functions.

So if you add functions to do the two effects, then do something like:

code:
float4 PS_BothEffects(VS_IN in) : COLOR
{
    return Effect2(Effect1(screenTex, in.UV));
}
That should work. You don't want to put them in separate passes, because the results of the passes get blended in the end. Unless that's what you're going for.

Jake Armitage
Dec 11, 2004

+69 Pimp

Cedra posted:

Does anyone have any good tutorial links to a tile engine in C#? I've been following XNAResources.com but their tutorials are outdated and ever since updating to XNA 2.0 things like EnsureDevice(), BeginScene() and EndScene() are broken and I've little idea of how to fix them.

I've only glanced briefly at it, but this looks good: http://www.kersson.com/articles/article.aspx?ar=41

Jake Armitage
Dec 11, 2004

+69 Pimp

IcePotato posted:

code:
location = new Vector2(orgin.X, orgin.Y);
slope = new Vector2((destination.X - orgin.X),(destination.Y - orgin.Y));

public Vector2 path(GameTime gameTime)
        {
            location += slope / (spd * (float)gameTime.ElapsedGameTime.TotalSeconds);
            return new Vector2((int)location.X, (int)location.Y);
        }

Location is the location of the bullet, and path returns the current location of the bullet? I'm assuming you call path like

code:
location = path(gameTime);
It looks like you might be accumulating a big number in location by using += there instead of =.

VVVV That too. You should normalize your "slope" vector, and multiply by speed * time.

Jake Armitage fucked around with this message at 23:04 on Mar 24, 2008

Jake Armitage
Dec 11, 2004

+69 Pimp

Ferg posted:

Does anybody know of a reasonable way to get music into an XNA game? I just found out yesterday that XACT only supports WAV files and making an entire song in uncompressed WAV is just not going to cut it.

XACT allows you to compress your audio files (see this)

Unless the XNA implementation of the audio engine specifically doesn't support compressed audio, which I haven't heard, and which would surprise me.

[edit] Indeed it does. Because msdn can be a bit dry, have a look at this

Jake Armitage fucked around with this message at 21:54 on Mar 25, 2008

Jake Armitage
Dec 11, 2004

+69 Pimp

Ferg posted:

On another note with XNA, can somebody dumb down a good program design for dealing with multiple game states? I downloaded the GameStateManagement example from the Creators Club and while it nails exactly what I'm trying to learn, the thing is an absolute behemoth and it'd be a huge help if anybody could explain just whats going on in there so I can start making sense of it all.

I wrote something really brief about it here, and Microsoft's Nazeeh wrote more on it here

Honestly though, the best way to figure it out is just to dig into it and start messing with it. It's not nearly as complicated as it looks. Whatever you want to add or modify is probably in there. For example, if you wanted to add a game over screen, you'd probably scale down the GameplayScreen or scale up the BackgroundScreen. If you open up the GameplayScreen.cs file and start trying to add your game logic to it, you'll pretty quickly figure out what needs adjusting to make it work.

Jake Armitage
Dec 11, 2004

+69 Pimp

Femtosecond posted:

With XNA I feel like I could get something running now, but with something like SDL, there are more options

I'm agreeing with IcePotato and Ferg that you should definitely go the XNA route, even if just to drastically improve your chances of actually finishing a game. But if it helps you, a lot of people are using XNA to prototype games that they'll eventually do on some other platform. So either way, you don't lose anything by starting with XNA.

Jake Armitage
Dec 11, 2004

+69 Pimp

Ferg posted:

So I remove the MS branding, and I don't have to worry about distribution. Now can I apply my own license to the code then?

What do you mean by "apply my own license?" Do you mean open source it under a different license? Because you can't do that.

Ms-PL posted:

(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.

You can distribute it, compiled, and charge for it, though. I wouldn't be surprised if 50% of the games submitted to the XNA community games will be extensions of the GSM sample.

Jake Armitage
Dec 11, 2004

+69 Pimp
Most people working with XNA are already probably aware, but just in case, XNA 3.0 Beta is out. This isn't the community preview thing anymore, and MS is recommending everyone convert their projects since the community games thing is going to require 3.0.

Good news: works with VS2008
Bad news: can't connect to X360 yet

Other than that, I have no idea what they changed.

Adbot
ADBOT LOVES YOU

Jake Armitage
Dec 11, 2004

+69 Pimp
I've been playing with Farseer for a couple days now and I dig it, but drat someone needs to document the thing.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply