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: