Project Generation Automation

August 19, 2011

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:

  • CreateProject.bat – This is the main access point that gets the automation rolling.
  • make.lua – This is used by premake to setup the solution and project as needed.
  • build.bat – This is a small bat to build from command-line with VS2010.

The Adventure

April 9, 2011

For those that do not already know, I hiked from Georgia to Maine along the Appalachian Trail in 2009.   The journey took 6 months, from March 29th to October 2nd.  Since I have yet to start really adding content to the blog in terms of computer related stuff, I suppose I should bring other life interests/stories along for the ride.

There will be many stories to come, as well as some general statistics of the adventure.  I hope you enjoy the stories, of how I made it to Maine.


Scrapyard Racing! Recorded Laptimes

November 14, 2010

Over the past week I have been making random improvements to Scrapyard Racing!  First I started with some user interface / heads up display stuff, but have yet to finish.  My lack of artistic value is draining me.  I then started playing with the best lap times database, and in-game display/interface.  First I started with populating the database with a bunch of generated users with random personal best times.  Now I have used those records to test the in-game display.  Which I must say is coming along nicely, even if it isn’t yet complete.

In-game Best Laps / Records Display

In-game Best Laps / Records Display

I need to add some navigation buttons, but I assure you I’ve tested it with a few hotkeys at this time.  There are three major additions until I can say the records are complete.  First I need to actually add records from game when the player makes a new personal best.  I also would like to see the ability to search for a friend by their user name to see their time / how much bragging rights you have over them…  The final one is going to remain undisclosed, as I haven’t had a chance to make sure I can pull it off; but it would be a nice feature.

Besides the timing charts, I’ve been working on moving my website around to this new place, of awesome.   I would like to make a video of me editing a track, as well as making a few tracks since I’ve only been testing on the one.  I haven’t done much gameplay wise.  The car is still a tad sluggish, and you still don’t need to use the brakes, but it is easier to drive compared to previous versions, and I think that is a pretty important part.

I may have failed to make my October Alpha goal, but I doubt I’ll fail to release this; the better question is when?  I would love to see it released within 2010, likely near December.  But I assure you, I have a long ways to go, and that is my dream time frame.  I have extremely high doubts on hitting the target.  Enjoy.


Over Game Editor

November 12, 2010

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.


Tire Simulation v2

November 12, 2010

Originally Posted: November/December 2009

In December 2008 I started a project to mimic a tire with deformable properties. Within a week or two the project had a deformable mesh, although this mesh was unstable. The project was put on hold due to career and life events until mid October 2009 where work began again.

The tire mesh is created procedurally, then a Point-Mass System is structured in a way that holds the tire together. This allows the contact patch to move separately but also get pulled back into the correct shape. During October many improvements were made including large optimizations. Removed several unnecessary springs, and placed the springs more optimally so that the tire behaved the same with fewer springs. This also allows the tire to have different resistances for lateral and longitudinal forces.

The lateral force is sideways, created when the tire is going around a tight turn and the longitudinal forces are when the throttle/brakes are applied, how the contact patch tends to hold position before bending back in shape. Top fuel dragster tires show longitudinal deformation well, see here. Check out the You-Tube video for more information.


Website Updating!

November 12, 2010

Recently a lot of changes have started happening to my site, to make it cleaner, more professional and most importantly a place I can easily update.  Because lets face it, without something easy, I just won’t do it.

Stay tuned for updates to pop-up as I add posts relating to current, previous and new projects.


Scrapyard Racing! Alpha Come and Gone

November 3, 2010

Okay, so I did not quite get where I wanted to this October, but it would have been a challenge even if my free time would have been higher.  Work related stuff ended up taking a lot of my time, for almost 10 days in a row I was unable to make much progress at all, then work started slowing down, but I had an opportunity for a programming test; which ultimately failed as I found out last night.

These are not excuses, as much as the truth of why I didn’t get where I wanted.  I am actually quite far behind schedule now, although I am still holding high hopes that I can sell a copy by December 31st.  I see more and more people are starting to become interested, as I released a video of the game in replay mode last week, and have had a few instant messages with congratulations and stuff.

Overall I still feel positive about the project, and even after a few weeks of “here and there” development I think things are coming together nicely.  I still need to edit the physics of the car/world, and need work on the user interface of the game.  One small piece of the gameplay portion exists before I start adding all the dressing and polish that will turn it from a ‘game’ into something playable.

Tonight I added a config file, so the player can change settings and they will remain stored for the next time they play.  As soon as I finish writing this I will start working on resources for the car, so that tires can be depleted, fuel runs out over time and brakes heat up, performing worse under heavy use, although quickly cooling back off.  Once I get that working I will need to add some more things to the track editor, and start making some tracks and content…  We will see.

In other news I added music, for now it is just temporary although I am going to be getting in contact with a musician sometime (I hope).

Have a good time, and congratulations to all those in the community that finished their games in October!!!


Scrapyard Racing! Locked Brakes

October 13, 2010

Progress has been a lot slower these past few days.  Sunday I has to do a bunch of stuff in the morning, had many interruptions  and distractions while I could have been working, and had other stuff to do that took a few hours in the evening.  Basically no progress.  Monday after work was pretty much the same, although a little bit of progress was made.  I now have the game connecting to a database, and sending information to it.  This will be used for best times, world records and that sort of tracking.  Tuesday not much progress was made by myself, but the website can now access the database and display a table of the laptimes, sorted to boot!

Today has been a slightly different story.  Progress isn’t blazing, but I have at least added a Message Box state, which will be used to tell the player that they are not connected to the database, and therefore any laptimes performed will not be shared, or rated.  Among many, many other uses.  The other day I didn’t put up screen shots of the main menu, but I will now – despite the same fugly look.

A simple main menu. (*Multiplayer may be cut!)

This is likely what it will remain like for the Alpha build, although perhaps I am wrong.  I know that over the course of development when I come to polish this screen, I plan on it looking something like the next screenshot.  Forgive my concept art skills.  Well actually, forgive the complete lack of any art skills!

My hopes are to have this screen animated, so it looks like the car is moving along.  The plan would likely be just moving the trees and clouds from right to left, while adding a subtle vibration to the car, perhaps tire rotation…  Something simple but active.  Anyways, I’m still trying to refactor and put together some simple UI classes so I can create other screens quickly.  Also, before I go too far I will need to stop and consider localization support for any text that gets built into the game.  It is best to do that sort of thing early, although I am going to attempt finding “universal” symbols/icons, and use those instead of text whenever possible.

I do wish I didn’t have a day job.  It is really holding back my potential progress, and really hurting me as far as my schedule is concerned.  I’m hoping to release something by the end of October, but I am not overly confident it will happen.  But here’s to hoping!


Scrapyard Racing! Week 1 Wrapup

October 9, 2010

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…

A current screenshot of the editor with a textured track, checkpoints and starting grid.

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…


Scrapyard Racing! Menu Progress

October 7, 2010

Well, I don’t have any screenshots to share tonight.  I could make one of the MainMenu, but really – not worth it.  Just take my word.  I do have drop-shadows on some text, which is pretty neat.  But besides that, it is extremely bland, rotten colors and just needs to be touched up during the next phase of the project.

Alpha is all about getting all the features finished and working, and the main menu is working.  Both keyboard (up,down,enter) and mouse (movement, left-click) selection support.  I wasn’t planning on starting the MainMenu and linking up a few other game-states (with no actual implementation yet), until later, but I made a mistake yesterday that I need to be aware of in the future; especially on this project with such limited time.

BlackBird’s Lesson:

I hope you can learn from my simple mistake; Don’t get caught up in things that don’t matter. Yesterday I was working on the editor, I got the track textured – looking a bit better now, and a handful of other little things.  But most of my time 3hrs or so, was spent on a specific tool.  It does have a use, but it also was a waste of time to spend more than 15 to 20 minutes on such a tool.  Yet I added all sorts of little features/behaviors to this tool and I must brag, it came out awesome.  But afterwards I realized that it didn’t do anything to the actual track.  It helps edit the track, but it doesn’t edit the track.

So I didn’t actually make much progress since the tool I added is just a nicety, and not a requirement.  I decided to take a step back from the editor tonight and start working on the gamestates for a change of pace.  I know a lot of you LD’ers are shooting for Oct 31st to release by, but I won’t be releasing until early to mid December at the absolute earliest.  Although, I will be completing Alpha by October 31st.  Any features not completed by that date, will effectively be cut from the project.

I expect it to take the full month of November to polish up the features, and reduce the bug count as much as possible before releasing.  This process will likely go into December, however after October 31st I can not, and will not, add any new features.  I promise I won’t.  (Hmm, will I?)