Well I've been thinking a good while and it looks to be that my time would best be invested in writing an engine to speed up the development of future titles. The engine will be primarily built using C++ and SDL, most likely using Lua for scripting. The engine will be an event based engine utilizing a single virtual machine to handle the events. The event structure is based on triggers which is inspired by actionscript.
Technology Used
----
SDL for event handling, and drawing
SDL_image for image loading
SDL_mixer for sound
SDL_ttf for font handling and printing
SDL_net for networking(TCP/IP)
lua for scripting
all these technologies are cross platform to at least windows and linux(my primary platforms) so the games created with this engine should be crossplatform between them. More platforms could possibly be added if I'm able to come into contact with the hardware required to test the application out.
Triggers
----
Triggers must be registered before they can be used, with the exception of these 3:
OnInit() --Called as soon as the engine has finished initializing
OnEnterFrame() --Called once every frame
OnPaint() --Called before rendering anything to the screen
Keyboard Triggers, called when register_keyboard is true:
OnKeyDown(key) --Called when a key is pressed, key identifies which key was pressed
OnKeyUp(key) --Called when a key is released, key identifies which key was pressed
Mouse Triggers, called when register_mouse is true:
OnMouseDown(button,x,y) --Called when mouse button is pressed down, button is which button was pressed, x/y are the coordinates which it was pressed
OnMouseUp(button,x,y) --Called when mouse button is released, button is which button was pressed, x/y are the coordinates which it was pressed
OnMouseMove(x,y) --Called when the mouse is moved, x and y are the new coordinates the mouse was moved to
Joystick Triggers, called when register_joystick is true:
OnJoyAxisMove(joystick,axis,amount) --Called when an axis on a joystick is moved, joystick identifies which joystick it was, axis is which axis moved and amount is the new position of the joystick axis
OnJoyButton(joystick,button) --Called when a joystick button is pressed, joystick identifies which joystick it was and button identifies which button was pressed
Networking triggers, called when register_networking is true:
OnConnect(ip,connection_id) --Called when ishost is true and an incoming connection has been made, ip identifies the ip address of the person connecting, and connection_id is a unique identifier for the connection
OnData(connection_id,data) --Called when data is sent to application, connection_id identifies who sent the data and data is what was sent
Built in functions:
LoadImage(filename):image_id --Loads the image identified by filename, returns image_id for later use
Draw(image_id,x,y) -- Draws an image identified by image_id at the location x,y
DrawString(string,x,y,r,g,b,size) --Draws a string identified by string, at location x,y with color r,g,b of font size size
print(string,timeout) --Prints a string to the screen for timeout milliseconds
Connect(address,port):connection_id --Connects to address/port specified, may get simplified to a single arg of "adress:port" in the future
SendData(connection_id,data) --Sends data to the target identified by connection_id
DropConnection(connection_id) --Disconnects the connection identified by connection_id
SendToAll(data) --Sends data to all open connections
Listen(port) --Set up event handler to listen for connections on port
LoadSound(filename):sound_id --Loads a sound for playing
PlaySound(sound_id) --Plays the sound identified by sound_id
LoadMusic(filename):music_id --Loads music for playing
PlayMusic(music_id,looptimes) --Plays the music looptimes amount of times
StopMusic() --Stops the currently playing music
PauseMusic() --Pauses the currently playing music
ResumeMusic() --Resumes playing music after it has been stopped
Each game will be preceeded by a load script which will be passed these values:
system.default.resolution --Current resolution
system.default.resolution.w --the width of the resolution
system.default.resolution.h --the height of the resolution
system.default.bpp --Current bits per pixel
system.joysticks --how many joysticks are attached to the system
The load script will be allowed to modify these system variables:
system.fullscreen --Whether or not to make the game fullscreen
system.resolution --What resolution to use
system.resolution.w -- the width of the resolution
system.resolution.h -- the height of the resolution
system.caption -- The name of the program
system.icon -- The icon for the program
system.capture_input -- whether or not to capture input
system.register_keyboard --register keyboard events
system.register_mouse --register mouse events
system.register_joystick --register joystick events
system.register_networking --register networking events
system.listen --port number to listen on if hosting
system.dedicated_server --if set only networking will be initialized
This is still in the design phase so the above could change at anytime, plus I've never before worked with scripting languages or socket programming so this will be an interesting project in that regard. The two big goals for this project are first off so I can learn both socket programming and scripting and quickly apply them to game development, and to provide a reusable system to quickly prototype game ideas, allowing incoming connections unlike what actionscript allowed. It will primarily be created for myself but there wouldn't be any reason other people couldn't use it(other than the fact I may not document it as good as I could), I have not decided whether or not to make it open source.
Wish me luck
-Cody