Sunday, August 28, 2011

SFPC - August 2011 Update

So, it's been a while since I've done any updates on SFPC.  I'll admit, things definitely slowed down for a while, what can I say, I needed a break (or two)!  Despite the lack of posts, I have gotten a lot of work done over the past few months, though the bulk of it was not really video or blog post worthy.  This release represents the sum of the year's changes so far, which includes lots of bug fixes, a major revamp of the movement code for performance reasons, and some new editor features and engine enhancements. 

There's no new gameplay map to try, hence the lack of a video.  The main draw of this release is the enhanced editor, which includes several features which should be a big deal to anyone interested in making maps.  Press the Home key to toggle between Play and Edit modes.

- The engine now supports variably sized maps, anywhere from a minimum of 28x20 tiles (two screens wide by two screens tall) to a max of 255x255.

- The editor now supports a sort of command console, think of the ~ menu from shooters like Quake.  From within the editor, press F12 to open the console script.  It opens a regular script window in Notepad.  Enter whatever script commands you like, save the file, then press F9 to run the script.  It is meant for one-and-done commands, and the file is wiped each time it gets loaded.  Two new script commands have been added specifically for use with the console:
  • TileFill tilenum layer x1 y1 x2 y2  -  Does a fill on the active map from x1, y1 to x2, y2 of the specified tile on the chosen layer.  Must be a valid, in bounds rectangle, or nothing will happen.  The editor UI now shows the corresponding integer version of the active tile for use with this command.  Layers are background = 0, overlay = 1, foreground = 2.  Great to make a large space, or even the entire map, get set to a specific tile, for instance an indoor map might use a pure black tile on the edges instead of a grass tile.
  • CreateNewMap "mapname" width height  - Creates a new folder structure in the /maps/ folder for the specified map name, as well as blank default map and event scripts.  The editor does not load the new map immediately, the choice to save unfinished work (press F5 to save) and switching to the new map with either F1 to load maps or the Warp command in the console script is left up to the user.

- The editor itself now has a more robust tile editing system:
  • The editing cursor now supports brush sizes.  Increase or decrease the size of the brush with the Page Up and Page Down keys, from 1x1 up to 5x5.  Changing the brush size fills the brush with the active tile.
  • The editing cursor now also shows the contents of the current brush at half transparency over top of where it is pointing.
  • The C key is still used to copy tiles, and will now copy the contents of the selected area to the entire brush.
  • Any time the user changes layers or modes within the editor, the contents of the brush is erased and the size is set back to 1x1. 
For those curious enough to give the new editor a try, you can download it here.  The maps from the previous demos are included, you can open them up and tinker with them if you like.  There is also a scripting cheat sheet in the readme, along with the list of controls.  You may want to associate .sfs files with Notepad for ease of use, just double click one, tell it to open with Notepad, and leave use this by default checked.  You may also want to refer back to some of my older posts and videos for a refresher on how to use the editor.

Please feel free to email me if you have any questions on making maps or scripting or to let me know about bugs, or you can post in the comments below.  If anyone makes a map and would like to share, let me know, I'd love to see them!


  1. Good stuff. Having trouble figuring out how to open maps. Anyone know how this is done? Also there any plans to allow for editing things other then the map?

  2. Press F1 while in Edit mode to bring up the open map dialog box. Everything you need to know should be in the readme.txt file. Eventually everything will be editable, the project is currently on hiatus while I attend grad school, I may try to finish it over the summer.