Showing posts with label penuine. Show all posts
Showing posts with label penuine. Show all posts

Friday, 2 May 2008

Omni-update!

I only just noticed how old the last post here actually is; the update-rate seems to have decreased exponentially now that exams have taken over. However, for now at least, all that is going to change. After an epic silence, I have finally returned from the Pit of Procrastination bearing news!

First, Slipslide 2. In the last post you may have noticed that it had reached a brick wall of sorts, in that it was running like Windows Vista on an Apple II. Luckily,
illume was able to show me how to fix it:
"if you're on windows pygame now uses the windib (GDI) driver instead of the directx one by default.

We had to do this for compatibility with, funnily enough, vista :)

You can do the following, and it should become similar to before...

import os
os.environ['SDL_VIDEO_DRIVER'] = 'directx' "


So as a result, Slipslide is now running as it did before - well, visually at least. The sound still crackles and pops constantly, but apparently there is a fix for it:
"I think some nice people have found and fixed the sound crackling...

You can try it out with the development builds of pygame here:
http://thorbrian.com/pygame/builds.php"


I intend to try this out when I have time, hopefully it should solve the problem.

Meanwhile, a few folders away from Slipslide 2, I have been working on getting my music on the Internet. My new site, which is mostly finished now, can be found at purevolume.com/animatinator. Feel free to have a listen, although the sound quality isn't perfect due to downsampling by purevolume.com (so the files don't take up too much bandwidth).

Wednesday, 2 April 2008

Pygame upgrade (well, something-grade...)

So I recently upgraded PyGame to the new version 1.8.0 release... GARGANTUAN mistake. As it happens, 1.8.0 is to PyGame as Vista is to Windows. While Slipslide 2 previously ran like a cat wearing a rocket booster, it could now be compared with an arthritic snail wearing chainmail armour. The initial fade-in took a full 10 seconds (compared to less than 1), and the music was so crackly it was like listening to white noise. The levels were even worse; the character was seemingly incapable of moving at any more than three pixels per hour and the pause menu window lagged several frames behind the mouse's movement.

The cause for this appeared to be that the new PyGame release's blit() method (used for copying images onto the screen) is far slower than before. Thankfully, there is a solution. I only had to make it convert all the images into a pixel format that PyGame prefers, and now blits are much faster. It seems this release is much less tolerant of unconverted images, and will run incredibly slowly when given images that worked perfectly in previous versions.

I'm happy to say that it's almost completely fixed now; the music still pops occasionally but I'm gradually eliminating that. As well as converting all the images, I've also been optimising redraw methods and minimising the number of times it has to update objects. With luck, it'll soon be usable again!

Sunday, 17 February 2008

It's a double-update!

Let's start off with what I did two days ago - level intros! Finally after many weeks of faffing with nonfunctional alpha effects and funky text boxes, I have a properly working level intro display with automatic word-wrapping and everything. You can see it in the screenshot on the right. I've designed this module so that it can be displayed in-game with a mere two lines once it's been imported:

intro_screen = Intro("Level number", "Level name", "Level description") intro_screen.ShowIntro()

Once ShowIntro() is called, the levelintros module takes control until it is destroyed when the user clicks "Start" (or closes the game window), so no event handling needs to be done at all whilst the level intro is running.

The second of today's updates concerns the custom levels system - levels can now be loaded in-game! Over the past two days, I've designed and coded a super-spiffy menu for doing just that. When you click "Load custom levels", a little vertical menu pops up on the right with a list of all the custom levels existing on the user's computer. And just in case they make so many levels that they go off the bottom of the screen, I've also written a method that scrolls the menu in the opposite direction to the mouse (as is used in the horizontal menu at the bottom) so that you can easily access all the items in it without any difficulty whatsoever.

Now, back to building levels!

Thursday, 14 February 2008

Finally, the level creation process begins!

After over two months of development, we've finally got to the level-building stage! And as promised, the levels can be made incredibly quickly thanks to Penuine's design. So far this afternoon I have made two levels, one of which you can see in the screenshot. These are both from the "retro" area, which takes place inside an outdated computer. I'm not saying how he gets there though...

Tuesday, 12 February 2008

Another day, another Penuine module...

This time a class that displays a "Level complete!" message which stays until you press a key. It's called by the levelcontrol class upon completion of a level, and looks very spiffy as you'll see from the screenshot. Pygame's per-pixel alpha capabilities are proving incredibly useful, they make some very nifty effects possible.

But that's not all that's been done! As well as this, I've got a new idea for the level intros screen which involves a cool text scrolling effect similar to the one on the main menu, but this time it's vertical and the text at the top and bottom is slightly smaller than the text where the mouse is. It'll naturally be incredibly difficult to code, but I've already made some progress - I've made a simple text wrapping system that takes a string and splits it into lines which are then made into an array containing text colours and positions as well. I'm hoping that this method will make it possible to animate the completely arbitrary number of lines necessary to display the story. The length of the algorithm for this is going to be ridiculous though...

Monday, 11 February 2008

Version 0.67!

Yes, we now have a version numbering system!
Well, a lot has been done recently. First off, there's a proper character sprite now! You can see it in the screenshot at the top.

Also, after A LOT of battling with Python, character animation is fully implemented! The character now slips, slides and even turns whilst you navigate your way around the levels.This was done by making a module which loads a filmstrip-style image containing all the frames of the character's animation, then splitting them up and returning them as an array. The character then sets its own image to the next in this array every few frames, going back to the first one when it reaches the end, so a cycle begins. When it stops, it stays on frame 1, and when it turns left, right or down the image displayed is rotated as necessary.

And last but not least, Slipinator (the level editor) is almost complete. The levels made with it are now playable in-game as well! So, now we just need a level intros system and then we're looking at the final stretch.

Tuesday, 29 January 2008

#%£@!!!

We've run into a bit of a problem here...
Unfortunately, the idea I had for the level intro sections is impossible without use of an extra module and a shizelload of manual pixel-by-pixel fiddling to make it fade in. See, in SDL (the C++ module PyGame uses), there are three types of alpha: colourkey, surface and per-pixel. Colourkey is the 1970's-reminiscent idea of having one colour in an image that is converted to transparency, so you'd put your non-rectangular image on a purple background for example and that background would be removed by the program. It's not particularly useful when you want smooth edges. Surface transparency makes an entire image (rectangular of course) have a certain alpha value - so, for example, every pixel in the image would be half-visible. This is what I use for fading in scenes. And finally, per-pixel is where every pixel has its own alpha value - this is necessary for the spiffy transparency effects on the level intros text box.

And here's the thing - you can't use surface alpha and per-pixel alpha on the same image. So to have it fade in, the text box needs to be completely opaque and rectangular. And to have the cool alpha effects and rounded corners, I leave myself unable to utilise the benefits of surface alpha for fading in. Without the fading, the text box's entrance looks particularly rubbish; and it's just disgusting as a rectangle. So, it's back to the drawing board.

I've decided after some deliberation, collaboration and thinkingination that actually the level intro sequence might look better without a text box. If I implement a text box, I know I'll end up making it draggable simply because draggability is so cool and it's always enjoyable to code, and then the continue button will be attached to the text box, and suddenly we have Microsoft Windows in game form. It'll almost certainly be better for Slipslide (and the player) if I actually design a unique interface for it, as I've done with the main menu.

But meanwhile, on the brighter side of things, Slipinator (the level editor) is now underway again. I'm working on a drag-'n'-drop method where you drag objects onto the level, and it's actually been very successful so far. Not only does it not crash now that I've done away with the 500 buttons approach, it also means that holes and other things can now be added as well as just blocks. And it's only taken me 200 lines so far!

Sunday, 27 January 2008

Level intro text box demo

I've now finished a working demo of the text box system that will be used in the level intros module. Using a bit of nifty programming, I've created a system that builds a text box from four images; the two top corners, a 1*24 pixel image to tile between them and a 1*2 pixel image to tile across the rest of the area. I also coded a spiffy effect that makes it fade in whilst expanding when the intro scene first starts - and although this is impossible to properly show through screenshots, I'll have a go...

When the scene starts:



When it's finished fading and expanding:


To see the box properly you really need to view it full-size by clicking it; the scaled-down versions above lose all the detail and look almost plain blue, whereas full-size there are lots of nifty details. There's also a transparency effect that'll be visible when I put the animated clouds in the background (coming soon!).

Saturday, 26 January 2008

Many, many bugs fixed

The original fade-in method turned out to be very buggy; firstly, when fading levels in the character appeared on top of the fading level. Also, the fade was incredibly jerky at times, as the algorithm was particularly inaccurate. And on top of this, the scene was completely frozen whilst fading was taking place, which to be honest looked rubbish - for example, this meant that if you moved the mouse whilst the title screen was fading in, the text would remain still and then jump to the right place once the fade was finished.

So I completely re-coded the fade-in method so that instead of capturing the screen, altering the alpha value and then blitting it each time, it now uses the parent object's update method so that the scene you're fading into runs normally. Meanwhile, it blits in a plain black square with an alpha value on top of the scene, so that it's really just a black square that fades out with the scene behind it. This is now working perfectly, with no glitches at all so far!

As well as bugfixing, I've also been redesigning the filesystem some more. At the beginning of development, it was decided that music would be put in the level folders so it could be easily loaded with the level by supplying only the folder name. But this means that there needs to be a music file inside every single level folder, and with the average file being around 2 megabytes, 25 levels will take up a massive amount of space. So instead of that, I'm now storing all music in the engine's Data folder, and and the level controller has been modified so it takes the path to the music as an argument. I'm going to have a total of ten tunes, one for each main area in the game, so the final game's file size will be a lot smaller this way.

Now I'm moving on to designing and coding the level intro sequence module. Screenshots to come!

Friday, 25 January 2008

The joys of fading

Today I've started writing a new class for Penuine that can be used for fading scenes in and out at an arbitrary speed (and the fadeout end colour is also variable). So far the fade in method is working, and I've implemented it in the main menu scene and the level controller. The difficulty with this new class will be not overusing it to the point of it becoming annoying; it's very hard to resist making almost every scene fade in and out simply because it looks cool!

Monday, 21 January 2008

The superawesome menu of awesomeness!

Finally, the main menu is complete. And I have to say, I'm incredibly proud of how it turned out! Take a look for yourself:

Unfortunately, a screenshot can't do it proper justice - that's not just a cloudy background image you see there, it's actually four layers of fully animated clouds moving in real-time with the text in between them. And the options at the bottom aren't static either; move your mouse to the right-hand side of the screen and they'll all slide over to the left to reveal the options on the right.

All this has resulted in a 250-line file, making the main menu module the largest module in the entire engine - larger even than the level controller! It's been incredibly complicated to program all the effects and get them running at a reasonable speed, but I can honestly say it was worth the effort.

Anyway, I'm off to spend the next few days patting myself on the back.

Saturday, 19 January 2008

The finished pause menu

And now it's complete!
It now renders text, and has clickable options for continuing and quitting. Also, it's draggable so you can place it in any part of the screen. This could be useful when you want to look around the level while the game is paused. It also looks incredibly cool, which is the main reason I developed it that way - now Slipslide has a Windows Vista-esque interface! Yaay!
But my words probably mean nothing to you without a screenie, so here you go:
Unfortunately the scaled-down image above doesn't do proper justice to the menu; click it to view full-size with all the subtle yet nifty effects visible.

With this done, we just need a proper character and animation to be implemented before we can finally release gameplay screenshots outside of this development blog. And at that point, it'll be less than a month before the final game is complete!

The countdown begins...

Pause menu now working - with perfect alpha!

After many an epic duel, I've finally got the pause menu to display. Well, the background anyway. The rest will come in time. For now, behold the screenshot!

As you can see, the character and level are partially visible through it! That's the incredible power of per-pixel alpha in action there. Thanks go to Pash for the making the amazing image of course.

The per-pixel alpha didn't come easily unfortunately; it's taken a lot of faffing to get it to work. For a long time it was drawing it with absolutely no alpha whatsoever, and there were nasty pixellated sections everywhere. However, it turned out to be caused by simply forgetting to update the background behind it each frame - so the pause menu was being drawn on top of itself again and again, which naturally would eliminate all transparency after a few frames. I fixed it by adding one single line to the pausemenu module. That's programming for you.

Tuesday, 15 January 2008

Level Layout Design

Hey, well I have been doing some level layouts for the game and I have quite a few different difficulties ranging from hard to.. well, erm hard. I am finding it awkward to design a level easier than what I have already. in my second post I will maybe show you a couple of layouts that I have designed to see whether you can crack them. if you can then I will continue to make more and if you cant... I will continue to make more.