dynamic music system (pieterNotSilly's Worklog)

working on my graduation project which will be a dynamic music system RSS Feed
Worklogs > pieterNotSilly's Worklogs > dynamic music system

System working

I had so many distractions last couple of years that i keep procrastinating graduation and everything. I've been working on a graduation project about music that is altered compared to the action that happened on the screen, AKA dynamic music. It's still in an early phase. I've been working on making an engine first. All objects and the music is scripted with lua scripts. In fact the scripts are very easy to work with and test things. I can even change a script on the run. The level editor i worked on has just a few lines of scripting code, most of them initializing code.

Example for a tilemap scroll window
Code:
map = tilemap:new( 500, 500, 1 )
map:load("mytilemap.map")
g_Scroll[ 0 ].map = map
g_Scroll[ 0 ].active = true
g_Scroll[ 0 ].x1 = 0
g_Scroll[ 0 ].x2 = 640
g_Scroll[ 0 ].y1 = 0
g_Scroll[ 0 ].y2 = 400
g_Scroll[ 0 ].file = loadFile( "tiles.pic" )
g_Scroll[ 0 ].graph = 1   --graph 1 contains all tiles
g_Scroll[ 0 ].tileWidth = 32
g_Scroll[ 0 ].tileHeight = 32
g_Scroll[ 0 ].camera = process:new("player.lua", this )


Graphics are done with opengl. All you have to do is place all your graphics numbered in a directory, e.g. tiles\1.png, tiles\2.png and then run "graphicmaker.exe tiles" to make a tiles.pic file that you can use.
Then all a script has to do is for example
Code:
this.m_File = loadFile ( "tiles.pic" )
this.m_Graph = 1
function frame()
   if ( Mouse.left ) then
      this.m_Graph = this.m_Graph + 1
   end
   if ( Mouse.right ) then
      this.m_Graph = this.m_Graph - 1
   end
   this.m_X = Mouse.x;
   this.m_Y = Mouse.y;
end

The same goes for music scripting where i'll make my dynamic music code(and the actual graduating for me)
Code:
this:playMidiTrack( "test.mid", 1 )
this:ChangeInstrument( MUS_ACOUSTICGUITAR )
while( true ) do
   this:noteOn( 80 );
   this:wait( 1 );
   this:noteOff( 80 );
end



I based the programming a bit on div games studio even though some things are bit more complicated because of the way lua works. There are still some extra advantages like placing processes in subgroups where each subgroup has a different function( game paused, main menu, game, level editor ), so it's very easy to program these things compared to div games studio.

A feature i want is that the picture files also contain static 3d models and have them a graphic number assigned to them. The testing game will be a 2D platform game(my favorite game genre).
I'll probably continue working on it even after graduating with a full working engine.
(Posted on August, 16th 2008, 13:58)
4 comments

Worklogs > pieterNotSilly's Worklogs > dynamic music system
Copyright © 2005 Booleansoup.com
Questions? Comments? Bug reports? Contact us!