Posts Tagged ‘ Bert Higgins Redux

WideScreen Joy!

It’s been pointed out to me one more than one occasion that I am a little on the slow side, So imagine my joy when I spotted that Bert was designed to be wide screen.

Stay with me here wide screen is just a non square aspect ratio view, more accurately width longer than height. The screen output for Bert was 320×200 and that gives us 320/200=1.6, so if I keep this aspect ration I can have Bert in it’s original layout and the XNA framework already has a simple scaling system built-in.

At the moment I’m working in 640×400 but with the code I just added I can restrict the screen res to wide screen only and there is no extra code to scale the output to compensate.

Delegates and Events in C# / .NET

I have been spending a little time working on the process method and filling in the methods it calls, converting the code is getting easier the more I do it the hard part was remembering what the statment syntax was doing and converting it to an equivilent C# one, like if (bob){} where bob is an int can’t be done you get a “can’t convert int to bool error it it becoomes if(bob>0){} and if(!bob){} becomes if(bob==0){} simple stuff but there’s allot if it.

Also I have figured out how I’m doing the sound stuff, I have created a new class as part of the SystemX namespace called SoundEventArgs then added an event using the standard Event Handler type :-

public event EventHandler<SoundEventArgs> RaisePlaySoundEvent;

In the SamplePlay(int p) method I create an instance of SoundEventArgs and set its cueName to the name of a sample I want to play and create a temporary copy of the event, check that there is a subscriber and finally call the event:-

EventHandler<SoundEventArgs> handler = RaisePlaySoundEvent;

if (handler != null)
handler(this, e);

Then in the main GameplayScreens constructor just after I create the new instance of the BertGame class and subscribe to the published Event:-

GameData = new BertGame();
GameData.RaisePlaySoundEvent += CueSound;

The CueSound method simply Plays the the requested wave file:-

void CueSound(object Sender, SoundEventArgs e)
{
BertSoundBank.PlayCue(e.CueName);
}

Now when a process call uses the SamplePlay method an event is fired and the main engine handles the playing of the sample, simple as.

The next biggie I’m going to have to look at is how best to implement the in-game menu that will let the player do things with objects in the game mainly because I have a nasty suspicion that this will make me reevaluate the current menu setup :-(

And another thing I know I’ve still got alot to put into the update method of Bert but it’s running too fast if it keeps this up I’ll be adding a sleep statment.

HAPPY NEW YEAR!

Hope you got everything you wanted for Xmas, I got a load of stuff done on Bert, I’m now looking at the FX-processer and that leads to a load of data structures that haven’t been added as yet. There are one or two complications with the way that I have restructured the game loop to fit XNA better in that all the Graphic and Sound functions are no longer in the FX-processer so I’m now reading up on event handlers and the XNA component model to help fix a few problems like how I can trigger the briefing screens and sound-FX. The Map-Editor is on hold for a bit until I need another break from the FX-processer because I need to work out how to do text input in XNA, my current solution is a little flaky.

I bought a few games and a new printer on new years eve, though I haven’t played them much, Halo2 is showing it’s age and Kayne & Lynch – Dead Men is cool. Still trying to work out how to set up my Windoze Live account so it records my in game stuff.

And WHY is there noway to specify that I don’t want to use my 360 controller in “Games for Windoze”?!?

Toys, Toys, Toys…

I’ve been getting in the festive spirit and bought myself a few things for my computerJ, well you didn’t think I was going to spend money on someone else?!?

I had a small windfall recently due to a tax rebate so after I had given crispy a load of cash I spent the remaining pennies on some stuff for me thanks to play.com I now have a new Keyboard & mouse and a spanking new Xbox360 controller (for windoze) that I’ve been after for ages now I finally got one that didn’t cost £35 I like the fact that Micro$oft have started selling these to PC owners for less than they were selling them to Xbox360 ownersJ.

Any who, I see now that the Space game template has keyboard support in it, I only fond out because I was showing crispy that my controller did work. I saw that it was a two player game I poked at a few buttons and hay presto it worked but there isn’t any indication on the screens to let you know that you can press a key sort of thing.

In Bert news, I got colour bleed on the tiles when they are drawn so I don’t think I’ll be using the tiled sprite example for the render engine, if I still get this problem when I write my own render engine I’ll probably look at spacing out the tiles and see if that works.

I’ve also started reading John David Funges “AI for Games and Animation, A cognitive Modeling Approach” but I’m having a little trouble with the Maths in it, Maths has never been my strong suit. Yes I’m aware of the irony, but I wanted to read it for more a grounding in AI techniques than a how to, which is good because that’s what the book is intended to be.

The subtle art of code conversion.

Well last night I spent a little time working on the MAP file loader for the Asset Manager program, and I have this to say about Paul’s code, YOU’RE A GIT!! Who in their right mind writes their own “getword” method that swaps the bytes around?

Most normal people would use something like:-
Return = (short)(getc(file) << 8) + getc(file)
NOT:-
Value1 = getc(file);
Value2 = getc(file);
Return (short)(Value1 + (Value2 << 8)
WHAT WERE YOU THINKING!!!

Added to that is the fact that the LRE compression for the file is just a little odd rather than keeping the whole logic in the one method it’s spread over three methods with a global short for the value you just got, but I think I’ve got most of it sorted.

No really, I have done some work….

OK so I’m a little late with my report for this week and I don’t have the screen shot I promised, but I can tell you I’m cheating…

Well I don’t see it as cheating really because I had to read and fully understand the code before I thought “bugger it. That’ll save me some time”.

“What are you blithering on about Mr Henry?” – I hear you cry, well, I’ve always had a problem with writing games in that I spend most of my time trying to put the menu and game state system together that I never get round to writing the actual fun stuff of the game and the times that I’ve just jumped straight in and done the game I don’t get round to doing the intro or settings system. This time I’m just going to use the Game State Demo for XNA, not only because I like the simplicity, but also because I’m a lazy S.O.B. Having said that I’m part way through the tiled map sample and I think I might be able to “Tweak” it to meet my needs, I’ve got it showing a random collection of map blocks and I think that with a little more work on the map converter I should be able to use this code for the 2D render system.

Then there’s also the work I’ve done on the sprite sheet compiler it takes the old PCX graphic files and reorders the sprites into my new layout rather than the weirdo way that Paul had them, but I think he had them laid out this way to make life easier in the map editor, and then saves them off in to one big PNG file. I now have two massive PNG files that will be compiled in through the content pipeline.

The sound samples are really straight forward, using XACT so I’m thinking that will be a quick half a day job to integrate.

Still to do is to figure out how I’m going to store and then reference the player keyboard layout but until then I’ll probably just go for the standard WSAD layout used in every FPS.

As soon as I have something to Show I’ll up load it.

So Glad

I’m so glad no one reads this blog, it’s been over a week since I posted that I’d be working on the Redux project and I’ve got as for as writing the loader for two out of the eight ini files we used to run Bert, I’ve done nothing towards the Game engine , FX processor or Map Editor. There has been a fair bit of thinking but very little doing, I’m going to have to do more stuff.

On the other hand I’ve got Five working days until I finish at work and then I’ll be starting at the new place the following Wednesday, so, much joy there.

Crispy and I have almost finished clearing out the boxes I brought when I moved in last Xmas there’s just the ones that we got out of storage in June to do now :-) . most of it is getting thrown out, it’s starting to look like a life laundry…

Anyway I’m mostly writing this post as a break in writing the ini loaders, so back to work I go :-) .

This years Project…

I’m going to build a game in XNA with the asset management app as windows forms.

I know that people will say there’s no point using XNA when all the main game developers are using CPP with DirectX or OpenGL, well I’m trying to prove game development theory and get this done as quickly as possible. With that the the working title of the game will be “Bert Higgins : Redux” you guessed it I’m going to reuse all the assets from the original, sprites, sound, maps, scripts and just focus on the game engine.

My aim is to build this so that at the end of it all I have a game for Xbox360 as well as the PC. If I’m lucky and design it right I’ll be able to rip out the main render engine and replace it With a 3D version;) but that’s a long way off and only a thought. there were so many things we wanted to do with the original but the crew broke up before we could even finish the second game.

So with 365 days to go I’d better get a move on, I’ve already started reading over the original programme code so that I can write the file loaders but this is proving to be problematic, but no pain no gain.