I’ve been building up to this for years, and still have some cogs to put into place, but I’ve finally got a major part working; the master script. The master script is something I started about 6 months ago now, wow, and ran into some issues. First I needed it to recursively search directories and run a set of scripts that would be part of the auto build process. These scripts have been Read the rest of this entry »
After a random discussion on in the #LudumDare irc channel about directory watching and the desire to get a normal mapping shader implemented one Saturday morning I decided to develop and integrate “hot loading” shaders scripts. Never heard of hot-loading assets, well the best description I can give is: Flipping Magical. No really, I can open Game Project and change an asset file, like the script, hit save, and watch the effects be applied immediately. It is not that difficult to setup. Read the rest of this entry »
Racetracks have a lot of fencing, and placing each section of fencing section by section would be a daunting task, so I spent the last few hobby development sessions creating a way to edit a spline that could be attached to an object to place the fence. Last year I had my first experience with bezier curves when I Read the rest of this entry »
The weekend after Ludum Dare some of my plans fell through so I decided to work on a simple animation project, a major feature I had to cut from my project. The project was simply joints and bones with simple interpolation between keyframes. The editor, or lack of, consisted of 10 key frames and a stick man with 11 joints and 10 bones.
After getting the mouse to drag a joint it was clear I needed to make the editor smart enough to keep the joint dragged within the length of the bone as the bones would be growing/shrinking during the animation and messing stuff up. After adding the limits, it was starting to act how I wanted; although I had to press digits 0 through 9 quickly to see the animation.
While writing the interpolation from frame X to frame Y I came across a bug where I was accounting for an offset I didn’t need to and it resulted in something surprising but cool; stickman into spaceship.
During the last several months or more I’ve started several projects, only to abandon them at, or soon after, blank screen. Mike “PoV” Kasprzak made a blog post about using premake to create a project. My process had been copy a template directory, with some basic code to get to blank screen, to where I want my new project, rename as needed – create the Visual Studio project and setup everything; include and library directories, debug working directory, post-build events, etc etc… Two to three hours later I had a blank screen, and rarely had motivation to continue much further.
Enough with that.
I started playing with my “make.lua” premake script first, and my immediate impression was, ‘meh’. But after an hour I realized the potential it had. I copied my template directory and used premake to make the project. During the process I realized it was powerful enough to set include/lib directories, and all the other tedious settings I previously had to do manually. It also occurred to me that I could use a windows batch file “CreateProject.bat” to automate the process even more.
Quickly CreateProject.bat would copy the template directory to a new location, rename it to the project and call premake to create the project on the spot. This wasn’t quite enough, I wanted it to build the project in both Debug and Release, and do some find/replace in files as needed for personal preference. While talking about this automation project with Pekka “pekuja” Kujansuu “sed” was mentioned. Sed is a stream editor on the unix platform which has find and replace capabilities. With great help from Pekka and Mike, I was able to get it to do what I needed with renaming.
This all took several, eight to twelve, hours but the next, or any future, time I need to make a project, is is a matter of typing “CreateProject MyNewProject” inside command-line and all the magic happens. My final step will be to setup a script to add the project to a subversion repository, but that will be a few weeks or whenever I get around to it. I am amazed at how rewarding this feels.
The files that do the magic are here, although probably needs quite a bit of work to generate a project that would be useful to your needs:
Originally Posted around mid-July 2010:
During development programmers often have to make a choice between spending time making an editor or just programming away. Often they choose a middle ground, where objects can be manipulated in a horrible fashion which can in the worst cases be counter-productive. After finding many of my projects go down this road I’ve decided to make a framework to quickly create an editing environment for designers of the game. This gives the benefits of an intuitive Win32 interface, while giving full power to the programmer.
Currently three areas can be controlled by the developer using this framework. The Menu Bar is setup quickly by the developer calling MenuBar_AddItem(). The developer can also enable, disable, check or uncheck the menu options as well as change the name if they decide to later. A callback passes the ID of the item when it is clicked, and thus should be handled. The Status Bar is a nice touch allowing the developer to set the status of the application. If something is loading, or time consuming this can be updated to show the end-user what is going on. Finally the Edit Area allows for edit controls to be added. Currently controls can be added for: bool, float, int, uint and string although I have plans to add custom controls. The developer calls EditArea_AddItem() for each item they want. If the selected object/type changes they just clear it and add again. All tracking/updating is automatically handled by the editor framework, although I want to add callbacks to this area.
Now it has officially been a week since I started the project. I must say I am pleased with the progress made so far, although things need to start moving along a little quicker. I am still knee deep in the editor, although wow, has it come a long ways in a single week. If I must say so, this is likely the best editor I’ve ever made. It has almost complete undo/redo support. I can’t say I am pleased with the code behind the editor. Maintaining this will end up being a nightmare, I can feel it already. A lot of copy/paste code segments for things like add/delete checkpoints / track nodes and other bits of information.
Since I last wrote a progress update, I have added the checkpoint system, which will be used to verify the car went around the track properly, and for timing the lap. I’ve also added camera control to the editor, which involved making the engine support the mouse wheel for zooming in/out. Also the track nodes now contain a width modifier, that can change the width of the track in a particular area.
Finally I’ve added a start grid tool, which can create evenly spaced grids for the starting position of the car. Only 9 tasks remain on the editor and track environment and then I will be onto a new task. I still don’t have a good name for the project so “TBR: The Best Racer” is sticking for now. Or it could be Tim Beaudet’s Racer…
My current plan of attack is to add objects / sprites to liven up the environment. Trees, haybales, cones, crowds and other common trackside objects would really liven the place up. After that I need to implement saving/loading of the track, and a car/world editor to assist when I start making the actual gameplay. More to come in the following days. If I have a miracle session tonight, perhaps the editor will be completed? Ahahaha…
Well progress has been coming since I last posted the Splash screen. I have been working on some tools, in particular the track editor. I remain vague about my game idea for the current time, but it will be a racing game; for all intent and purposes. I am focusing efforts on being unique, and a thorough google search only brought up 2 other “personal” projects/attempts at what I am doing. I am hoping that serves to my advantage, but I am happy to know I have an idea that is more original than just making an Pac-Man clone with different theme.
So about this track editor; I spent my day Sunday working on starting it, and Monday night after work I lost about 3 hours of productivity. I was beat, muscles aching, etc… and couldn’t concentrate. However I did manage to get a few productive hours and managed more than I expected for the night. Undo/Redo capabilities for all current actions: Add/Delete TrackNodes as well as the ability to Move/Edit the node. This editor is within the game*, however it will likely be stripped from the release build.
I have been wondering quite a bit whether or not I should implement undo/redo. I estimate it will take 3x or so longer to maintain the actions, but I also believe it will save time when designing/developing more tracks. I plan on a minimum of 5 tracks, but hope for more than that.
Tonight I’ve started by writing this post, soon I will begin working on building the actual track from the nodes above. I am hoping that doesn’t take me all night. I want to do more than just that, but at this time I have nothing else planned, as I can’t think what comes next.
*Although it is within game, I have an EditorFramework that acts as an external editor; giving me advantages of a professional looking interface, menus and more.
A few hours later. . .
Well, I did manage to get somewhere tonight. Even further than just getting the track surface built from the nodes. Although, I didn’t get the track textured, yet, I did manage to build it quickly. Also I sent it off to a partner of mine, and fixed several small editor ‘issues’. Added saving/loading of editor settings for convenience , undo/redo still fully working. (Redo for the move action was previously broke!) Here is a small image of the track being built from the nodes: