Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411518 Posts in 69380 Topics- by 58436 Members - Latest Member: GlitchyPSI

May 01, 2024, 01:49:33 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsSpectrum Spelunker: Shoot Blocks to Win the Game, Also Jump and Run Starring Hue
Pages: [1]
Print
Author Topic: Spectrum Spelunker: Shoot Blocks to Win the Game, Also Jump and Run Starring Hue  (Read 7917 times)
Michael Buckley
Level 0
***



View Profile
« on: May 10, 2009, 02:52:21 PM »

Late last year I was lucky enough to join up with the guys who created Spectrum Spelunker, the runner up in Eegra's First Annual Game Makin' Shindig, to create a multi-platform version of the game. The original game was created using Multimedia Fusion 2, a game creation program for Windows. We originally set out to create a direct port of the game to C++, but have since decided to add new features and new gameplay modes to the game.

I have spent almost all of my free time developing the game, to the point of losing contact with the Internet communities that I frequent. However, lately, I have been feeling some minor burn out on the game, so I decided to start a public devlog here in the hope that it will inspire me to finish the game. My plan is to post an entry every few days detailing the progress I've made in the game, with screenshots showing the progress if I can. I also will write about the current problems I am having, in the hope that describing them may provide me with greater insight on how to fix them.

I am primarily developing the game on an OS X box, and testing on Linux and Windows. An inordinate amount of time has been finding solutions to problems that work on all three of these systems. Working with Windows in particular has been a challenge in this regard. The Win32 API has not really made it out of Windows, and Windows does not support a lot of the APIs that are common on *nix systems. To get around this, I have either had to write some classes in platform-specific code, or look at using *nix-based solutions that have been ported to Windows. Thankfully, I have been able keep the platform-specific code to a minimum.

I'm using OpenGL to handle the graphics. Thankfully, this has not yet given me any problems on Windows, and it has not left me wanting for performance on other systems. Originally, I was using SDL, but struggled to get decent performance out of it on OS X. I am, however, continuing to use SDL to set up the OpenGL context and handle input.

Similarly, I was also using SDL Mixer for the sound. However, this caused a slight delay in playing the Sound effects of Hue's footsteps, which have a very rhythmic pattern. I was able to decrease SDL Mixer's buffer size to get the timing right, however, this caused the sound quality to suffer on Windows.  I therefore switched to OpenAL. It took longer to write in OpenAL, especially since OpenAL requires you to decode sound files yourself, and there were a few differences between the version of OpenAL shipped by Apple and the Windows version available from Creative. It also required me to do sound processing in another thread, since the sound would stop playing if the window was moved or minimized in Windows XP and Vista.

To accomplish threading, I am using pthreads. I originally thought I would have to rewrite the threading code on Windows, but I have been able to use the pthreads-win32 library with absolutely no difficulty on Windows.

I will do my best to update this thread every few days, and make a post later today detailing my progress over this weekend.
Logged
Inanimate
Level 10
*****

☆HERO OF JUSTICE!☆


View Profile
« Reply #1 on: May 10, 2009, 03:13:47 PM »

This game looks really awesome from the youtube video! Downloading now!

Edit: Played it! It's a lot harder than it looks.  Embarrassed
« Last Edit: May 10, 2009, 08:47:27 PM by Inanimate » Logged
Michael Buckley
Level 0
***



View Profile
« Reply #2 on: May 10, 2009, 09:13:04 PM »

I am finished programming for the day. Here's what I got accomplished:
  • Solved my outstanding sound problems on Windows. By placing OpenAL calls in a separate thread, the window can be moved or minimized. without disrupting the sound.
  • Fixed combo reporting for large combos. We previously made it so that large combos explode immediately with extra visual and sound effects to demonstrate how large they were, however, that broke the combo score reporting.
  • Fixed backflipping behavior to require that the user be pressing against a wall to backflip off of it
  • Fixed a crash that occurred when a block would try to remove itself from the game twice. Blocks no longer try to do this!
  • Tweaked the random block generator to generate blocks further ahead so that it doesn't look like chains of exploding blocks stop exploding prematurely when a block is added to the game after the chain started and would otherwise be part of the chain
  • Added center alignment for text
  • Added a high score screen which is displayed after Hue dies. At the moment, you cannot submit your score, so the high scores are empty.

Logged
Inanimate
Level 10
*****

☆HERO OF JUSTICE!☆


View Profile
« Reply #3 on: May 12, 2009, 04:49:28 PM »

Hi! Been playing it a lot more; just wondering:

You have the theme up for download? It's too addictive.

(Also: if you stay on the title screen, Hue starts hovering back to the left.)
Logged
Michael Buckley
Level 0
***



View Profile
« Reply #4 on: May 14, 2009, 06:57:16 PM »

The game currently up for download is the MMF version of the game. It's more of a prototype/tech demo than the full game.

I actually had no involvement with that version of the game, and we probably won't develop it any further. All the development is going into the multi-platform C++ version.

As for the theme, I'll see what I can do.
Logged
Inanimate
Level 10
*****

☆HERO OF JUSTICE!☆


View Profile
« Reply #5 on: May 14, 2009, 07:08:02 PM »

Thanks! And that's just a prototype? Wow, it's really fun already.

Will it basically be the same game? Or will it have enemies and such-like?

Also, why is this not getting more comments?
Logged
Michael Buckley
Level 0
***



View Profile
« Reply #6 on: May 14, 2009, 07:19:10 PM »

Yeah, I'll talk more about the things we're adding in the upcoming log posts We mostly have our ideas solidified, but I don't want to really promise anything until I'm implementing it. I haven't posted in the last few days due to lost sleep/time, so I haven't been able to work on it this week until today.

As for why this is not getting comments, well, it's a dev log, and mostly from the technical side so far. It's a wall of text that probably isn't interesting to non-programmers. That will change more in the future.

Honestly, I'm glad to take comments/questions, but I'm primarily doing a dev log in the hopes that it will keep me working on the game and that posting about the problems I'm having might help someone in the future if they're having the same problems.
Logged
Michael Buckley
Level 0
***



View Profile
« Reply #7 on: May 20, 2009, 08:57:35 PM »

Over the weekend, I tackled the problem of recording tutorials and creating an attract mode. I started by defining a binary format for recording actions and spend most of the weekend implementing it.

The implementation is pretty hairy. There is a base recorder class which implements the skeleton of the recording file. Individual recorders subclass both this recorder and the class which they record. I dislike using multiple inheritance, but C++ isn't dynamic enough to allow anything else.

To make matters worse, to fit it in to the current class hierarchy, I had to use templates, and in a rather nasty way. The class declaration for my InputManagerRecorder looks like this:

Code:
template <class SuperClass>
class InputManagerRecorder : public SuperClass, public Recorder

SuperClass is InputManager or some subclass of InputManager. I could have just made it a subclass of InputManager, but that would have meant making one for each subclass of InputManager. (I understand that code generation does this, but this way, the code lives in one place.) Spectrum Spelunker has its own subclass of InputManager. Any future games I build with this code will each have their own subclasses as well.

After the weekend, and tweaking with the code on Monday and Tuesday night, it works. the C++ linker didn't like this very much. but as long as I declare my pointers as InputManagers, and don't do something like InputManager* foo = new InputManagerRecorder<InputManager>(); Even if I cast this pointer to a InputManagerRecorder<InputManager>* later on, the wrong methods will get called.
Logged
Michael Buckley
Level 0
***



View Profile
« Reply #8 on: May 23, 2009, 05:55:02 PM »

This last week I noticed that if I start a flash video and Suectrum Spelunker at the same time, Spectrum Spelunker would not have sound. OpenAL's alcOpenDevice function would return NULL. I figured that two the two programs were trying to get some kind of exclusive lock on the sound hardware. I put in a loop to try to get the device 100 times and tried again. Both Flash and Spectrum Spelunker hung for a few minutes, and in the end, the same thing was happening. It seems that Flash was repeatedly trying as well.

In the end, I decided that a one-second delay was acceptable, and now sleep the program for a second if it can't get the lock. It's not perfect, but it will do for now.
Logged
Michael Buckley
Level 0
***



View Profile
« Reply #9 on: May 27, 2009, 06:26:38 AM »

Spent a good hunk of time this weekend flushing out and cleaning up the interface. About halfway done on that. I also implemented Simple mode, which only took about 20 lines of code.
Logged
Michael Buckley
Level 0
***



View Profile
« Reply #10 on: June 06, 2009, 12:28:41 PM »

DIdn't get much done last weekend, as most of the weekend was taken up by going to see Cinematic Titanic. Over the week I started to add some special effects and fixed a few bugs. I also implemented the level speed increases so that the game doesn't stay the same speed all the time.

Of all the bugs I fixed this week, there is one I regret fixing. Right now for testing purposes you can respawn Hue after he dies, and under certain conditions, you can end up spawning multiple hues which you control simultaneously. If there wasn't the possibility that it would affect the final game, I would have left it in.


Logged
Michael Buckley
Level 0
***



View Profile
« Reply #11 on: July 03, 2009, 07:52:42 PM »

It's been a crazy couple of weeks for me. I haven't got much done due to other things happening in my real life. I finally implemented music cross-fading. There is a weird bug with it. If you gain 3+ levels twice in less than 2 seconds (something impossible to do unless you have access to the game's debug mode.) One the one hand, since it doesn't affect the final game, I don't want to put a lot of time into fixing it, but on the other, the code isn't doing what I think it should be, which is bugging me.

I will work this weekend either on the level editor or the menu system. I'm waiting for some sprites to implement hazard mode (which is mostly done already). Once I have the menus done, I can start working on the base for online multiplayer. Everything else is waiting on design documents and artwork.
Logged
Michael Buckley
Level 0
***



View Profile
« Reply #12 on: July 04, 2009, 08:26:04 PM »

Well, I lost a day to it, but it's a good thing that I decided to fix the music issue.

I figured out pretty quickly that when I call stopMusic(), the music doesn't immediately stop. It stops once update() is called on the AudioManager singleton. Since this happens in another thread, what happens is I end up trying to play 3 or more music files at once.

The reason I did this was because of a thread synchronization issue. However, stopMusic is supposed to stop the music immediately, and I had to spend the better part of the day refactoring the AudioManager. It is now fixed.
Logged
Michael Buckley
Level 0
***



View Profile
« Reply #13 on: July 11, 2009, 02:11:47 PM »

Decided to go with the menus first. Refactored the object hierarchy to contain a Drawable class with virtual methods. Got to the point where I wanted to play attract mode behind the menu and realized that the fact that I have a singleton input manager is going to cause problems for trick mode playback behind the menu. I've always wanted to get rid of my singletons, but that's going to require figuring out how to design the code without singletons.

So I'm going back to the level editor this weekend.
Logged
Joseph
Level 2
**


View Profile WWW
« Reply #14 on: July 12, 2009, 10:05:29 AM »

My game also has the word 'Spectrum' in the title. Just wanted to point that out. I'm not challenging you to a duel or anything. Nice game btw.
Logged
Michael Buckley
Level 0
***



View Profile
« Reply #15 on: July 12, 2009, 02:55:39 PM »

Yeah, this is obviously not the first game to have the word "spectrum" in the title, or "spelunker" for that matter. In fact, there was a game on the ZX Spectrum named Spelunker, although that was not why Spectrum Spelunker is named so. Our games seem to be suitably different form each other anyway.

The level editor isn't much code (though admittedly the level filename is hardcoded at the moment). The problem is that now I'm refactoring the level hierarchy. I glossed over a lot of the details previously, since we only had one kind of level (endless, randomly generated), and now I'm paying for it.
Logged
Michael Buckley
Level 0
***



View Profile
« Reply #16 on: July 15, 2009, 06:30:14 PM »

OK, I think I have this all specced out. No more singletons. Dependency injection ftw.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic