Archive for July, 2007
The current state of crimson
cubed2D
July 23rd, 2007.
Two months ago i last posted about my progress with my game engine, Crimson. Things have changed since then. As I’ve previously mentioned, not done much coding has been done on the engine since because of real life and hardware problems (t minus 10 days till laptop returns!). Because of that, most of the progress has been in design. Here is what my class layout looked like back at that last update (all these classes were coded up when i posted this originally)
Well, as you can see, I’ve crossed off everything that doesn’t exist in my current design. That’s not to say this old functionality is being removed, just that its being moved around and redesigned to be a lot more powerful that it ever was before. I’m also trying to decouple the game simulation from the world view, a trick that i learned from reading Game Coding Complete by Mike McShaffry. (This is a great book not only on the technical side of game development, but also things like how to manage the project, testing, folder layout…. the sheer amount of information in this book is mind-blowing! My personal favorite thing about it is the little ‘tales from the pixel mines’ inserts, where Mike shares stories for the development on games he did at origin (Ultima!) and Microsoft. You can learn so much from reading about the choices and problems in these sections! Do yourself a favor, and get this book)
 So, “how does it look now!?!” i hear you shout, well like this.
Each icon represents a different core area of the engine. Authority is the game rules, its where the simulation takes place. This will include a physics engine, the information on the current level, the data structures containing all the current entities in the world and things like that. You could almost think of it as a server (infact, this architecture is very good for extending your game to be multi-player). It also contains the command interpreter, which is very important! (shall all become clear soon)
The view is not a single piece of code like the authority, There is actually loads of em. Im implementing a base view which can be extended for more specialized purposes. They are basically filters on the game state(held in the authority). The most obvious example on one would be the player view. It has all the code in it for drawing the world to the screen, converting button presses in to commands, making music play and stuff like that. You could also make one to command a team of A.I players. It wouldn’t need any drawing code, but it would need to be able to sense whats happening in the area of world-space it can see (filtering everything it cant out)and then sending commands to the authority for the next step in simulation.
That’s where it comes exciting for me. The game I’m designing this engine to build will rely alot on A.I… good A.I that doesnt cheat. This system lets the A.I only get the same information a human player would, and use the exact same methods to interact with the game world a human is. For me, that’s big!
 So whats that last bit all about? have a closer look!
Please remember this is still far from done, its in a kind of half way state between class layout and program flow diagram! Whats important is that the class CrimsonEng is the engines entry point, create an instance and throw it a start-up script and the game shall load! Its basically a massive collection on managers which will be available for the other systems to use (via the interfaces and core libs). My current plan is to not use the default game class that xna ships with, as it wont fit very well with my engines design (maby more on this next time). Some interesting things here are things like eventMan and MessengerMan. Messages are going to be from entity to entity, good for A.I characters or triggers. Events will be for wider reaching things, like state changes or button presses. I think its important to separate and specialises these kind of messaging functionalities. Well, Thats it for this installment! Cant wait to get my laptob back to start building this thing!
Re: Rotation along a Bezier Curve
cubed2D
July 17th, 2007.
A while ago i wrote an article for ziggyware on moving a sprite over a bezier curve. Well, i recently received an email (hi John!) asking a question, and i remembered a problem i discovered in my code after the article was published!
I included a method for calculating what angle the sprite should be rendered at to produce a cool looking animation. It used a mathematical function called arc tan to calculate this angle.
To tell you the truth, i cant really remember what the actual problem was, but I’m fairly sure that if the control points were not layed out in a perfect right angled triangle shape, the red lines imposed on the image wouldn’t meet at the bottom to form a right angle…. which my method relied on to produce a correct angle (going by memory, as i say, i might be remembering this wrong). it would produce slightly odd results with some quadratic curves, like the one pictured and would definitely screw up on higher order curves.
A much nicer way of doing it would be to store a heading. Every time you update the position of the sprite over the curve, if you normalise its position (presuming your useing a vector for its position) and the calculate the dot product of that heading with the previous heading, you should get the angle between them in radians…. you should beable to use that to create a better looking movement over a curve, of any order. (please note, i havent got xna installed and working at the moment because of my previously mentioned computer problems, so i cant test out this theory!)
long time no post!
cubed2D
July 16th, 2007.
been a while since ive posted! sorry about that! With all the exams and end of term, miveing up and down the country, moving in to my new flat and finaly coming home for the summer, its been a hard month or so! So heres whats been going down recently in the world of NekoCake!
Fist off, a big thanks to Dan Fernandez for the cool visual studio tshirt he sent me! Its allso go the Lego nxt robot on it. Cool stuff
Next up i moved in to my new flat in durham, and then came back down south to spend some of the summer at home, set up my laptop and xbox up in my room, ready to code!
Then, as im about to start working on Crimson again, my laptop overheats! i check everything, make sure all the vents are free from dust, and again, it overheats. Phone up alienware, they sent me some new thermal compound. redid the seal between the cpu and the hsf… overheats! Got a returns box coming next week, then it will take 5 days for a fully repaired flabtop to work its way back to my home
 Good news is, ive been working stuff out on paper, and ive got a better idea of the layout for the engine code. not a full design yet, im going to read loads more articles and browse through some other engines to sure up any doubts i still have. The current plan is to have loads of little virtual machines in my code, and for entity’s and engine code to beable to register processes with them. This should allow me to handle threads quite well, and use some of the knowledge ive learned at uni in the operating systems lectures!
 Allso, you might just have noticed, ive changed the theme! i hated the old one, this ones alot more consistant with the main site… and lets you see more than one post a page!