Home | Rules and Guide | Sign In/Create Account | Write a Post | Reddit | #ludumdare on irc.afternet.org (Info)

Thanks for making Ludum Dare 26 AWESOME! See you in August!

Ludum Dare 26 — April 26-29th, 2013
[ Results: Top 100 Compo, Jam | Top 25 Categories | View My Entry ]
[ View All 2346 Games (Compo Only, Jam Only) | Warmup ]

[ 10 Sec Video Compilation (x3) | 260 Game Video Compilation | IndieCade Deal | Ludum Deals (Unity Deal Ends Soon!) ]


Post-Mortem (And by god, there almost was mortem)

Posted by (twitter: @DrJarajski)
August 23rd, 2011 6:19 am

Seriously, my top tips? Nothing about sleep, organising your time or what to eat. I’m not going to talk about thinking out your idea before going into it headlong. I have two tips that will help IMMENSELY :

- KNOW your software, now is not the time to try out a new IDE or use a language you don’t know very well, and make sure you can and HAVE compiled stuff with this software that WORKS. Trying to understand the quirks of VS2010 isn’t what you want to be spending time on.

- KISS : Keep It Simple Stupid. And I don’t just mean the concept. In general in OOP it’s a good idea to make classes for each concept, but here you need speed. Just make a BIG mainloop with ALL your code in it, and make classes for the few things that REALLY need them. Remember, simple doesn’t mean elegant. Simple means an O(n²) algorithm is better than an O(n) if it means you get the job DONE.

 

To be honest, the game I put out has the gameplay I originally imagined when I started pondering the theme. So in that respect, I succeeded in building the idea that I wanted. But I didn’t respect the two previous points, so my game is SEVERELY lacking in aesthetics, and features.

I usually code in Linux, with gedit or Eclipse, in C++, and I’ve done some SFML stuff. And since I was making my game in SFML/C++ I didn’t think coding on a Windows machine with VS2010 would hurt. Turns out it does. First, SFML hasn’t been compiled for VS2010 yet, so you have to build it from source WITH VS2010. But that means knowing how VS2010 works IN THE FIRST PLACE. I could have done it, given the time to consult a few forums and manuals, but time wasn’t available.

Another mistake I made was that I made classes for everything, the was a state manager, an assets manager, a game loop manager, a class for monsters, a class for turrets and a class for the world, a class for tiles that compose the world, and I think that’s it.

Now given more time, this is a great idea : OOP allows for amazing flexibilty and extensibility if you structure your code nicely.  My original design would have allowed easy creation of new monster types, turret types and tiles. It would allow quick and easy mainenance of code, and since only the asset manager had access to SFML, it would be a cakewalk to port to a different graphics engine.

While all these features are nice, it quickly devolved into spaghetti code as I tried to beat the clock with an ever more complex code, sleep deprivation and panic started to settle in by the next day and I no longer understood my own code, and even switching to my trusty linux netbook that I’ve been using to learn coding for the past year didn’t help. My code was a beautifully designed mess.

I eventually bailed and posted an “I’m Out” blog, sat down and gave up.

But then I came to, realised that I COULD do this, and with less than 20 hours to spare, sat down and did it right.

The new code is a messily designed beauty, there’s a huge, unwieldy main loop with monster spawning, monster update calling, turret spawning turret update calling, points counting, credits counting, event handling all bundled up in a big mess. There is a class for monsters and a class for the turrets, and they contail their own rendering code. I do everything WHERE I NEED IT.

But the end result was that I made a game in 14 hours whereas I totally failed to do anything in the 20 or so before.

 

I’m going to learn VS2010 now, it seems to me like an interesting IDE, and there’s some stuff I’d like to use, and I’d like to develop for WIndows, but I’m going to do it now that I’m out of a time-limited mess. Expect my next LD to have a lot more content, and work better on Windows (My Windows build still fails on some machines, and I have no idea why, if you have SFML1.6 for Windows, please help me compile a version that will work for everyone : http://www.ludumdare.com/compo/ludum-dare-21/?action=preview&uid=1561 )

2 Responses to “Post-Mortem (And by god, there almost was mortem)”

  1. Felipe Budinich says:

    This should be called “Main Loop Private Function FTW Programming Paradigm”, and yes, I agree with most of what you said there.

  2. bitbof says:

    I created quite a few classes but I kept them very simple and predictable in their functionality. So I didn’t really run into too many problems. Making pretty much everything public saves a lot of time too.

Leave a Reply

You must be logged in to post a comment.


All posts, images, and comments are owned by their creators.

[cache: storing page]