Archive for December, 2006|Monthly archive page

Run away

As a possible solution to honkykong’s question about averaging angles from mobs.

If the faded mobs in the picture are assigned a badness value and are a specific angle from you (as they always are) then you can obtain a vector for each of them, where badness is the magnitude.

For all baddies, add the vectors, and that’s the way to go if you want a hope of escaping. My diagram is back to front :P

I don’t know know what happens as this system becomes dynamic, how often you need to check this graph to get worthwhile results, or if the whole thing will work at all. Maybe honkeykong will let me know.

I’m No Artist

 Seriously… Don’t believe me?

What dya say to that spaceship?! I especially like the clothes-iron handle. See i modelled it in a 3d app (Wings3D) and got to see it from all angles. I did not focus on the angle most common in my game tho.

See looks slightly better there right? No? Oh well…

If you have a groovy spaceship you wanna lend me to test in my scroller i’d freaking love it!

My most common problem

I get this problem a lot. Previously i’ve fixed it by makign sure all my sprite batches Save state, eg:

_spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate & SpriteSortMode.Texture, SaveStateMode.SaveState);

 This time I cannot source the problem. I’ve removed every spritebatch to be certain it’s just the model and my scenegraph, and yet the problem persists. I am using the SpaceWar Scaling system, but I turned that off as part of this test.

Yuck

If you dont immediately see the problem, you normally only see the top half of that light-blue cockpit dome, and certainly not into the “intake” on the nose cone. This is the same model from Spacewar.

WHAT WAS IT!?

RenderState.DepthBufferWriteEnable = false.

Yep. That’s from something I copied over from Spacewar.

I still don’t properly understand save states yet mind you. That call was occuring after a Batch.Begin with savestate so I didnt expect to see that state later on.

Anyway, if you have trouble with things like this go take a look at Sean Hargraeves post on SpriteBatch and RenderStates and then dig around in your app for any RenderStates you’ve explicitly set and forgot to revert.

Thanks to Pon in #xna for the links and the patience.

SpriteBatch.Draw issues

I wrote a little component to scroll tiles for my little side-scroller. It seemed to be working quite nicely. After that, I started on a scene graph, and the design of my scene graph did not accomodate the scroller being a “component” – more on that at some point. Upshot is, small amount of refactoring of my scroller code. Got it running in my new scene graph and what do I end up with? Take a look:

Pixel Boundary Issue

I upped the contrast on the right to make it clear that not only do my tiles have fading edges, but are tinged red? I dont know where the issue is. I tried using Rectangles for my source and destination to ensure that i was using integers. That did not help. Next step i gues is to make my target just a bit larger than desired.

I just wonder why it suddenly appeared and if it isn’t a device render setting?

This is the texture im using

Thanks to Kukyona who pointed out the two obvious issues.

  • That bit of red came from a red line in the texture that i had forgotten i drew.
  • At some point my texture got exported from Flash (which i use for pixel editing), at 600px high. He suggested 640 and everything is fine now.

The lesson: Texture file dimensions at multiples of 32.

Welcome

Hi There!

I’m a complete XNA n00b. Won’t stop me though. I love the idea of porting some of the classics from my heydey to the 360. Especially scrollers like Delta, R-Type, Wonderboy. You know, 64 classics. I may be a freak, but i still play 64 games using CCS64. If I could play those games on the XBox. Well that would rock. Of course im not talking direct ports, just similarily ‘old school’ games with a nice next gen console look and feel :)