AGS Guitar Hero (updated March 16th)

Started by suicidal pencil, Thu 11/03/2010 06:17:07

Previous topic - Next topic

suicidal pencil

I've been dreaming about making a Guitar Hero clone on AGS, but I've never really known where to start. After searching around and finding no evidence of anyone succeeding at it yet, I still have no idea where to start, but I'm going to give it a try  :D

So presenting...


Details:

Name: AGS-Guitar Hero
Version: 0 (only just started :P)
Release: soon! I promise!

Basically, I'm making this game as a coding challenge for myself, and to try and twist the arm of AGS as hard as I can and see what happens. It will do everything that you can do in Guitar Hero right now, with three notable exceptions: There will be a 7th note (the 'open string' note), You will be able to make a Guitar Hero version of your favorite songs (basically, a song editor), and most importantly: the source will be available! I love looking at the source code of modules and games because I like to see how people solve certain problems, so I'm letting everyone who wants to take a gander at it ;)

To Do List

Game Engine
  • Song file parsing (100%)
  • Create Song editor (50%)
  • Create graphics (40%)
  • Player Input (50%)
  • GUIs (50%)
    Gameplay
  • Hammer-ons / pull-offs (0%)
  • Whammy Bar (0%)
  • Star Power (0%)
  • Note hit checking (0%)
The graphics are just rough versions, just so I can get a working version. Here's what it looks like so far:

The main screen


The notes




Dev. Journal

March 10, 2010

  • I've figured out two possible ways to format the song data. The first is the easiest to read and understand, the second...not so much. The former is a slight variation on guitar tabs, and the latter is a format looking like (24)------(1)xxx(46)-(13)-(24) etc... with the numbers representing the notes (1 for first fret, 2 for second, etc), dashes representing open space, and x representing holds. I started out doing the first design, but I'm going to use the second design, since it will take 6 times longer to parse the first design (unless I can parse 6 lines at once...), and 6 times smaller. As well, after the file is parsed, the note locations are held in temporary storage (aka, arrays) so that it's easy to recall the information on the fly. However, these arrays are going to be big. If it takes 0.5 seconds for a note to travel from the top to the bottom (twenty frames), and there is an array element for each frame of the song, a 5 minute long song will need 12000 elements (each note position is one frame)  :o Even better, is that there are 7 arrays that would be that long (164.0625 Kb of space required JUST for that :P) Even then, I think I'll make the song time limit 10 minutes (24000 elements, 328.125 Kb). I have another little obstacle to overcome: I need to make the song editor first, so I can create songs and then test the file parsing, and play the game  :P

March 12, 2010
  • This is turning into a monster to code. It's not terribly complicated (at least, from my point of view (working excessively in Perl has lent me some skill in file parsing :P)), but there sure is a lot of it. It's just too bad that AGS doesn't support Regular Expressions. Take this example: The beginning of every song first starts out with a bunch of information about the song (what number it is, the name, and the length). Here's how I'm parsing it in AGS (ripped straight out) (:
Code: ags

.
.
.
    Offset = 0;
    String Line = SongList.ReadRawLineBack(); //get the entire line into the game memory
    String LineChar = Line.Substring(Offset, 1); //This variable points to a single character in the line
    
    if(LineChar == "I") //the line with the song information (song name/number) is started with an 'I'
    {
      
      SongFound = true;
      Offset += 3;
      LineChar = Line.Substring(Offset, 1);
      
      while(LineChar != "}") //I'm assuming that the user wont mess around with the song file
      {
        
        StringNumber.Append(LineChar);
        Offset++;
        LineChar = Line.Substring(Offset, 1);
        
      }
      
      //I have to deal with the 'a' at the beginning of the string.
      String TrimStringNumber = StringNumber.Substring(1, StringNumber.Length-1);
      songnumber = TrimStringNumber.AsInt;
      Offset += 3;
      LineChar = Line.Substring(Offset, 1);
      
      while(LineChar != ")")
      {
        
        SongSelect_SongName.Append(LineChar);
        Offset++;
        LineChar = Line.Substring(Offset, 1);
        
      }
      
      SongSelect_SongName = SongSelect_SongName.Substring(1, SongSelect_SongName.Length-1);
      Offset += 3;
      LineChar = Line.Substring(Offset, 1);
      
      while(LineChar != ")")
      {
        
        SongSelect_Length.Append(LineChar);
        Offset++;
        LineChar = Line.Substring(Offset, 1);
        
      }
      
      SongSelect_Length = SongSelect_Length.Substring(1, SongSelect_Length.Length-1);



now, here's the same stuff done in Perl with Regular Expressions

Code: ags

if($_ =~ /^I (\d) {(\w)} (\d)/)
{

  $SongNumber = $1;
  $SongName = $2;
  $SongLength = $3;

}


MUCH simpler, and more compact :P (edit: I actually found a semantic error in my code after posting...)
more to come!


March 16, 2010
  • I'm about halfway done the song creator for the game. It's only now, though, that I realized something: In order to let people create their own songs, they'll need the source. When the game compiles, all the music is stored in the music.vox file...and I'm pretty sure that there is no way to add to it after it's compiled. This isn't that much of a problem though, seeing as I was going to release the source anyways  ;D .  That aside, it seems that the bulk of my worries is in getting the songs to line up with the notes. Even in the song editor, this promises to be a pain.

Dualnames

Someone would say it, but have you seen what Abstauber has done with ShattenReyze?

http://ags-ssh.blogspot.com/2009/11/while-my-guitar-gently-bleeps.html
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

suicidal pencil

damn! beaten to the punch. Oh well, so I may not be the first to create it, but maybe the first to release it (didn't see a dl link in the link...but that's pretty cool)  :P

If I have a flaw, it's graphic design. I can't create graphics to save my life. Anyone interested, feel free to PM me.

deadsuperhero

I have to say, this is an interesting concept. Reminds me vaguely of the guy that made a GH clone for his Commadore 64.
The fediverse needs great indie game developers! Find me there!

suicidal pencil

Even with the limitations, it is possible to create almost anything with AGS. However, the trick is making it playable and usable  :P

Scarab

Quote from: Alliance on Thu 11/03/2010 17:18:53
I have to say, this is an interesting concept. Reminds me vaguely of the guy that made a GH clone for his Commadore 64.

There was even a guy who made a similar game for the  NES, which is quite impressive, if unwieldy control-wise.

CaptainD

Is there any way of using Tracker music and making a program to grab the notes information straight from the file?  It seems to me (with my minniscule programming ability!  ::)) that the toughest part will be making the sequence of notes to play.

suicidal pencil

#7
Quote from: CaptainD on Fri 12/03/2010 15:49:30
Is there any way of using Tracker music and making a program to grab the notes information straight from the file?

Only if MIDI is used (Although, a fun game called Audiosurf that will read any song you give it, and it will build a course for you to run with notes synced with the music...but I'm pretty sure that it only detects spikes in the audio frequency).

However, I accidentally solved this problem when I was considering the implementation of the song editor. As the song is built, it's already synced with the music file.

*updated* (new dev. journal post, and finished file parsing function)

suicidal pencil

*updated* (new dev. journal post, made lots of progress on the song editor and engine :P )

SMF spam blocked by CleanTalk