• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Cornstalks

Rapid prototyping when making games

5 posts in this topic

I had fun in this weekend's 72 hour game making competition. I started from scratch (on a clean Windows partition, even), and the whole time I wish I could rapidly prototype. However, some issues that make prototyping not rapid are:[list]
[*][b]Compile times[/b]
[*][b]Restarting the game[/b] (i.e. you're not in the middle of that battle anymore)
[/list]

I want to try and mitigate these slow downs so I can make my prototyping more rapid, and that's what my question is all about. I've come up with the following list of things (some inspired by [url="http://www.gamedev.net/topic/622754-are-pack-files-pak-zip-wad-etc-worth-it/page__p__4927109#entry4927109"]Hodgman's awesome post[/url]) that can help with rapid prototyping:[list]
[*][b]Dynamic configuration variable values[/b]
[list]
[*]XML file has various values (i.e. update rate, gravity vector, etc.). This XML file can be watched for changes, and reloaded if necessary.
[/list][*][b]Using more content files[/b]
[list]
[*]In my hasty programming, I hardcoded things I normally wouldn't hardcode, like the Kraken's tentacle length or base tentacle size. These content files are kind of like the one file talked about above, but more specific and less global. They can also be things like a map file, or a texture image. Just things that aren't hardcoded. I can watch for changes in these files and reload if necessary.
[/list]
[/list]

Now my two big questions are:[list]
[*][b]How can I reduce compile times?[/b]
[list]
[*]I know there isn't a silver bullet for this, but there are some things that need to be tweaked (like behavior or steering algorithms, where a small change in the algorithm (not just a change in a variable) can have a noticeable effect) until they're just right. It sucks recompiling (mostly because or relinking) for tiny algorithmic changes. I've thought of using scripting languages, but that leads into my next question:
[/list][*][b]How can I save state after making changes?[/b]
[list]
[*]Nobody likes replaying the first 10 seconds (or more) of the game every time the recompile. Whether I'm using scripting languages or reloading a map or character file, how can I save state the best? The only thing I've really come up with is making every object serializable, and then saving the game as a whole in a file (kind of like saving a game like you normally would, but more verbose so things like menus and stuff can be reloaded if you're working on the menus, for example). Is that overkill?
[*]I'm not sure how to preserve the state of things that change. Oxymoron, I know; let me explain. Basically, I might make a change to some object that affects a portion of it, but not all of it. Is it worthwhile trying to preserve the part that didn't change (assuming that doing so wouldn't put the object in an invalid/corrupt state), or is that just too much of a pain the butt?
[/list]
[/list]
I know, I basically just described Lisp, Lua, Python, Ruby, etc with some of the things above. And I'm seriously going to start looking at integrating a dynamic scripting language in my future C++ games (one reason I haven't gotten around to doing so yet is because I love my Visual Studio C++ debugger, and mixing C++ with a scripting language just doesn't sound fun to debug; but I'm going to get over that, don't worry).

But in addition to that, are there any advices you have for rapid prototyping when developing a game (particularly when the primary language is C, C++, or any other non-dynamic language)? Any advices on clean/beautiful ways to integrate scripting languages (it's one thing to integrate a scripting language; it's another thing to do it [i]well[/i]). Because I'd love to hear them.
1

Share this post


Link to post
Share on other sites
For the restarting issue I just hack the code.
Another thing I do is use globals like a nut, and printing the states' values (I may misunderstood the question), then hard code the states for example.

Anyway, I think I did well with fast prototyping in this contest. My experience is that for rapid prototyping, forget about clean code. Totally forget it. I mean really. My code is so horrible that probably anyone who would see the code would commit suicide.

I tend to hack, but I became a master at it now. Don't try to be smart at all. My code has tons of code repetition. Even trivially functionizable parts are repeated, because there's no time to think in advance what you might need to reuse, if you realize it, then there's no time to functionize it then rewrite the calling stuff etc. Making the interface of the function, thinking about a good name and calling the function is extra time compared to in situ coding.

I prefer doing stuff with functions instead of smart data structures too for prototyping. Lots of things could have been solved with semi-smart data structures in the game (for arms' path finding for example), but inventing this data structure takes more time than explicitly coding what to do in a monster if-else-series or switch case.

Don't implement everything the program needs. Just implement what is needed visually. Hard to explain. For example, in my game, I only implemented the sliding the rows/columns, but not the arms' path finding and not the winning conditions for a long time. But this was just enough to try if it would be good gameplay wise, even if reaching a ship did absolutely nothing.

I repeated stuff to the extent of totally meaningless repeats, like highlighting the cell that the mouse hovers is totally separate from the actual cell selection. It has its separate "x,y" global variables, and it's only there for rendering. Of course, it could have been integrated to the actual selection mechanism, but it would have required to modify the program flow a bit, which may have caused bugs and would have needed testing.
There are also some other repeats of this kind, where instead of modifying the program flow to add a visual feature I just introduced dummy variables and functions.


Not technical, but making detailed TODO lists, FIXME lists, desired features' list and forcing yourself to check their items helps a lot too, but that's obvious I guess. Edited by szecs
2

Share this post


Link to post
Share on other sites
[quote name='Cornstalks' timestamp='1338162864' post='4943836']
But in addition to that, are there any advices you have for rapid prototyping when developing a game (particularly when the primary language is C, C++, or any other non-dynamic language)? Any advices on clean/beautiful ways to integrate scripting languages (it's one thing to integrate a scripting language; it's another thing to do it [i]well[/i]). Because I'd love to hear them.
[/quote]

The games I've seen that don't have a dynamic scripting language usually end up with some kind of Quake-style console or 'tweaks menu'. Something that can be easily accessed in-game and gives you the ability to play around with whatever tweakable things you expose to it. If these tweakables are content then saving the changes that you make's a lot simpler too.

You may be interested in checking out [url="http://bitsquid.blogspot.com.au/2012/03/cutting-pipe-achieving-sub-second.html"]this GDC presentation[/url]; the Bitsquid guys provide some excellent techniques and ideas for reducing content iteration times. I also like the way that they have integrated Lua into their engine. All of their stuff is worth a read.
2

Share this post


Link to post
Share on other sites
[quote][b]How can I save state after making changes?[/b][/quote]
Depends on what your game state is. As an example, if you were using Lua [to script] you could follow in Fable 3's footsteps and leverage Pluto ([url="http://lua-users.org/wiki/PlutoLibrary"]http://lua-users.org/wiki/PlutoLibrary[/url]) to, essentially, save your entire Lua "universe" to a flat file and be able to reload it on boot. There was an entire article written [by Fable's devs] on the subject but I cannot seem to find it amongst my bookmarks currently; I apologize.

[quote]The only thing I've really come up with is making every object serializable, and then saving the game as a whole in a file (kind of like saving a game like you normally would, but more verbose so things like menus and stuff can be reloaded if you're working on the menus, for example). Is that overkill?[/quote]
No, that's the basic gist of what most "high level" language serialization libraries support; it's basic, works reasonably well for minimal effort, and is generally performant for small/medium loads. Just be careful and plan how you want to handle versioning.

Secondly, divide-and-conquer is an excellent strategy in situations like this. Per your example, why not save the "menu" (e.g. GUI) state in a separate file and ram the objects in another? This will be the case anyway if you use a dedicated GUI library (that likely comes with it's own designer + custom formats).

[quote]one reason I haven't gotten around to doing so yet is because I love my Visual Studio C++ debugger, and mixing C++ with a scripting language just doesn't sound fun to debug; but I'm going to get over that, don't worry)[/quote]
Most of the popular languages have their own debuggers (and their own debug/error callbacks and symbols) you can use. It's true that debugging both can be somewhat aggravating, but the time (and convenience) you save from using a scripting language tends to be worth it. I was under the impression that Lua had a VS debugger plugin, but I don't know if that's still the case.

[quote]But in addition to that, are there any advices you have for rapid prototyping when developing a game (particularly when the primary language is C, C++, or any other non-dynamic language)? Any advices on clean/beautiful ways to integrate scripting languages (it's one thing to integrate a scripting language; it's another thing to do it [i]well[/i]). Because I'd love to hear them.[/quote]
As is mentioned in the link Teutonicus posted but I'd like to reiterate: network consoles are a beautiful, [i]beautiful[/i] thing [when done right]. Since (obviously) the relationship between your game and your console is of the server/client persuasion, your console never needs to be "shut down" and can function as a mini-IDE if you need it to (save snippets, inject scripts, etc).

However, the biggest boon by far - and what I would say is one of the keys to prototyping (and is even mentioned by Hodge in his post, albeit indirectly) - is that you don't have to write [the console] in C++. C++ is nice a language for some things, but for a lot of others (e.g. GUIs) it's just a tremendous pain. With the advent of .Net and the JVM, scripting languages are now first-class citizens in their ability to seamlessly integrate with their "hosts" (C# and Java, respectively) and their associated libraries - use them.

As for "beautiful integration" between C++ and scripting languages ... most people's idea of that consists of using C++ as little as strictly necessary. If you're looking to boost your productivity for prototyping, porting (or "binding") your personal libraries to your language of choice can be immensely helpful (typically as a DLL extension). Just be aware that a lot of the binding libraries (such as Luabind and Boost::Python) work very well but you'll never get the kind of first-class experience you'll find elsewhere (there's no drop-in and "oh hey my language magically understands C++"). I don't say that to deter you, but it's just a fact that you need more time (than, say, in C# or Java) to see returns on your scripting investment. If you're looking for a "quick fix" to your scripting needs odds are you'll be very disappointed.

That said, if you're willing to put in the effort scripting can be very rewarding.

[b]TLDR[/b]: Moar scripting, less C++. Also, no handwritten XML - your time is valuable, don't waste it closing tags.
2

Share this post


Link to post
Share on other sites
Thank you guys for your awesome feedback. I really appreciate it! I'm going to be trying lots of things like these, as now I'm working on an Android/iOS game and this'll help a lot with that.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0