Search website

Monthly Archives | January 2010

1-31

I hacked an ‘affected by gravity’ flag into Box2d.XNA so that my bullets could fire slow and not fall to the ground. They are supposed to be energy weapons, or something. I also hacked in a way to pass a parameter to an entity’s OnSpawned event, and then I removed it, because I found a better way. I can attach a function to the entity’s OnSpawned event that does what I want, instead of passing […]

1-30

There were some nasty bugs lurking in my code base. But they are gone now. My entity component model is becoming very complex. But, my scripting works great. I don’t think I can explain one without the other. Unfortunately for you, this means I won’t be explaining any of it.

1-29

Continuous refinement. Next up – firing projectiles. Then the player will be able to jump around AND shoot things. But, this is no easy task. It requires a dozen or so little things that must all work, such as spawning entities, moving them with fast velocity with no tunneling, detecting when they hit something, and destroying the bullet itself when it hits. I will concentrate on each of those things one at a time, and […]

1-28

Four solid hours of effort, and I restructured the entire project. It’s much better now, and my scripts are written in C#, using coroutines. More on that later, maybe. There is a problem with platforms – the player does not stick to them! That is, if they are standing on them, and the platform moves, the player does not. I have an idea of how to hack around the physics library to make that work. […]

1-27

The editor now makes some attempt not to draw labels on top of each other. Xisp is looking nice. But, I realize I want something more. And the best language for scripting in C# is… C#. While pondering, I realized that a script is just another component. With some changes to simplify the existing component system, I can write scripts in C#, give them access to the full functionality of the engine, and still declare […]

1-26

Minor improvements to a host of things. The world is no longer special. It is just another entity. And this works great. Poking at the editor now. It needs to draw labels such that they don’t overlap. This is an NP-Hard problem. Also it needs to position labels quickly. Did I mention this is an NP-Hard problem? Yeah. I might get ‘good enough’ results just by drawing entity labels in a different spot than joint […]

1-25

So it decomposes concave polygons again. This is very beneficial to the editor, as I don’t have to worry about polygons being convex. There are issues, however. The algorithm fails in several corner cases, and the code is a mess. That guy who wrote farseer really does not understand simple things like abstraction. I’m still working toward being able to set up gears and such in the editor. First step toward this is removing the […]

1-24

I am amazed by how easy it was to switch to box2d.xna. Farseer was supposed to be a higher level library than box2d, but. It’s not. Box2d.xna is the far superior choice. It’s easier to use, more powerful, faster, and the code is actually readable, and the debug view works out of the box, without dragging in a bunch of crap. I’m not quite back to where I was. I need to clean up a […]

1-23

I will not be writing custom joints for Farseer. Not because I can’t do the math, but because the effort involved isn’t worth the result. At this point, it would be quicker to write my own physics engine from scratch – and I could probably get better performance out of it, too. But I won’t do that either, because Farseer 3.0 has both of the joints I want, and is much faster on the 360 […]

1-22

So it turns out writing new joints for farseer is much harder than it should be. While the library has great external documentation, there’s none at all inside. There are variable named like _r1, operations are written out long form – Vector2.Add instead of V1 + V2. I’m no C# expert, but is the cost of copying a couple 8-byte structs really greater than passing them by reference? If this was C++, and someone did […]

« Older posts

Switch to our mobile site