• Create Account

## The great GD.net collaborative coding horror experiment? (...and the results are in!)

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

65 replies to this topic

### #41FuzzyRhombus  Members

Posted 26 October 2013 - 07:15 PM

This sounds awesome. I've been wanting to be more active on here/contribute to little projects and contests. This would be a great way without putting any stress or taking up a lot of any single person's time.

• Dependencies are limited to the standard library and the multimedia library only. No OS-specific calls
• The code must compile on your platform of choice, and should strive to be cross platform
These are kind of conflicting if it's to be truly cross-platform and native. What about X calls on linux? And on Mac unless you launch from shell and use fullscreen only it's pretty close to impossible to have a game running without some Obj-C (unless you opt for X as well I suppose). I haven't done anything Windows in a very long time but I'm pretty sure you'd need some specific calls, HWND's and all that junk to get something running as well haha.
I think that should be the only area allowed to have those dependencies, just so it can get up and running.
Of course this wouldn't matter if it's browser based. Or Java.
With SFML like was originally proposed I am almost positive you can get a window up and running with the exact same code. For the most part if people use standard C++ calls and didn't get absolutely crazy with SFML(I think their are a few calls that act different on the different OS's) then it should compile just fine for everyone. I just migrated my SF code over to Linux from Windows and it compiled and ran without one problem. That's the beauty of SFML. How easy it is to get going with it and how easy it is to work with other OS's

Whoops, my fault, thought it said SFMT (http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/). That would make more sense lol. Just looked up SFML; I think that should do it then, looks awesome!

### #42rip-off  Moderators

Posted 27 October 2013 - 06:47 AM

Ok, here is my current plan.

There does appear to be quite a bit of interest in HTML 5, so I'm considering running two concurrent ones, one in C++ and one in HTML 5. There will be a theme for each. I am thinking I'll start the experiment at midnight (GMT) 31st of October, and leave it run for the weekend.

While restricting consecutive commits by the same person is appealing, I don't want to disenfranchise people in odd timezones, so I don't think I want to enforce this.

My own experience with HTML 5 is limited, I wrote a basic pong many moons ago. Is vanilla HTML 5 sufficient, or is there a clear library (not a framework) that is popular for HTML 5, like what SFML/SDL are to C++/C? I'll probably include jQuery.

Do you really think you need art for such an experiment? You could just generate some bitmaps in memory procedurally, which could add some interesting code.

Good idea! I'd certainly encourage procedural generation, both for art and for levels or whatever. I think allowing manually generated programmer art could add to the hilarity.

Once you sort out all the details and get this thing started -- assuming you decide to go ahead -- might I suggest pinning the official topic in the "coding horrors" forum for the duration and linking from the lounge like the "PUTT" contest is currently doing?

Sure, will do.

Maybe I misread it somewhere but will their a end goal that we are to strive for? As in will what is added to the code actually be of "use" to the project? Or could I just say go and implement a simple/stupid game inside and force everyone to work around that?

The end goal is to have some kind of playable game, related to the theme. The details are left to your imagination.

That way the game and a built in editor could be embedded as a sticky at the top of the forum (similar to JSFiddle) so everybody could see live updates of the game.

I don't think that will be feasible in the time available, but it is a nice idea.

Also, I don't know if you plan on keeping any kind of actual repo, but if you're not I wouldn't mind making a git repo and updating it with each post to keep a "proper" history.

I didn't want to try to organise an official repository for the experiment itself, but I would appreciate someone who wishes to maintain one from what happens in the thread(s).

And if this works well, can we please do this annually?

Let us see how this one goes, but I'd certainly be interested in doing something similar next year. I reckon we'll learn a lot from running this one, as to what works or not.

### #43TheComet  Members

Posted 27 October 2013 - 07:16 AM

If it's HTML 5 then I'll have to pass, as I have absolutely no clue how that works.

"I would try to find halo source code by bungie best fps engine ever created, u see why call of duty loses speed due to its detail." -- GettingNifty

### #44swiftcoder  Senior Moderators

Posted 27 October 2013 - 07:20 AM

If it's HTML 5 then I'll have to pass, as I have absolutely no clue how that works.

Learning is half the fun!

Plus, with HTML 5 we have the opportunity to actually run it in a versioned, live-coding environment like JSFiddle...

Tristam MacDonald - Software Engineer @ Amazon - [swiftcoding] [GitHub]

### #45gzaloprgm  Members

Posted 27 October 2013 - 08:52 AM

Really interesting idea! I'm willing to participate.

I'd prefer C and SDL (without OpenGL), since its easier to access the framebuffer, and do direct pixel manipulation on surfaces, even if we can't directly rotate/scale sprites.

I think that direct pixel manipulation is also posible in HTML5/Canvas, but I think it was slower IIRC.

In tangent space no one can hear you scream

### #46slicer4ever  GDNet+

Posted 27 October 2013 - 08:53 AM

Really interesting idea! I'm willing to participate.

I'd prefer C and SDL (without OpenGL), since its easier to access the framebuffer, and do direct pixel manipulation on surfaces, even if we can't directly rotate/scale sprites.
I think that direct pixel manipulation is also posible in HTML5/Canvas, but I think it was slower IIRC.

Just....no.
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

### #47FuzzyRhombus  Members

Posted 28 October 2013 - 05:28 PM

I am thinking I'll start the experiment at midnight (GMT) 31st of October, and leave it run for the weekend.

Is it only going to be for 2 days then?

### #48Buster2000  Members

Posted 29 October 2013 - 07:50 AM

If it's HTML 5 then I'll have to pass, as I have absolutely no clue how that works.

Programming is programming.  Type stuff in, cross your fingers and hope that it does something.

### #49rip-off  Moderators

Posted 29 October 2013 - 05:22 PM

Is it only going to be for 2 days then?

Would it not be three days: Friday, Saturday and Sunday? I was hoping that a relatively short duration would lend some focus and impetus. However, when stated like that - it does sound perhaps overly short. Maybe I'll leave it run until the following weekend.

I wasn't going to lock the thread or anything, so the program could continue to evolve as long as people are sufficiently interested.

### #50FuzzyRhombus  Members

Posted 29 October 2013 - 08:37 PM

Programming is programming.  Type stuff in, and watch the magic happen!

Fixed.

Is it only going to be for 2 days then?

Would it not be three days: Friday, Saturday and Sunday? I was hoping that a relatively short duration would lend some focus and impetus. However, when stated like that - it does sound perhaps overly short. Maybe I'll leave it run until the following weekend.

I wasn't going to lock the thread or anything, so the program could continue to evolve as long as people are sufficiently interested.

You're right, 3 days. Thought the 31st was Friday. My reading skills are not going well for me lol.

I was under the impression the whole idea was to be more a relaxed, hope for the best kinda thing. Either way would be cool. Perhaps two version could run alongside for a time? The short version, requiring more effort and organization; the long version, becoming a contrived mess but a more creative end result.

Is there really any reason it has to come to an end though? It's not being judged or anything like that, right? Why not leave it for a few months and see what happens. The only thing I see becoming difficult over longer durations is making sure everyone's following the rules. Although that's what makes it so fun, so I don't see why anyone wouldn't!

Posted 29 October 2013 - 09:54 PM

What is going to be interesting: Seeing how the advanced and the beginning type programmers work in the same exact file.  We are bound to see some crazy obscure looking C++ code followed by some C++ code that seems to be written by a beginner.

And knowing me I bet I will think I can follow that obscure code and end up writing something that breaks that obscure code and ends up breaking a lot of things in the project.

### #52Buster2000  Members

Posted 30 October 2013 - 07:04 AM

What is going to be interesting: Seeing how the advanced and the beginning type programmers work in the same exact file. We are bound to see some crazy obscure looking C++ code followed by some C++ code that seems to be written by a beginner.

So just like production code in a AAA studio then

### #53rip-off  Moderators

Posted 31 October 2013 - 05:16 PM

Here are the slightly revised "rules" - note that they are self enforced. Please abide by the spirit of the experiment.
• There are two experiments, one in C++ and one in HTML 5
• Each experiment will have a thread, to be created by me, which will be populated with a minimal, terrible program
• Each experiment will have a separate but related theme. Strive to make a playable, or even fun, game!
• The threads will act as a kind of revision control system, each post containing code is a commit
• You must attempt to amend the current version of the code
• If, having posted, you find someone has committed something new, please immediately edit your post to remove the code (to avoid confusion)
• Posts must include the full source of the program so far, but please highlight what was changed
• The program will be in a single file only
• Dependencies are limited to the standard library and the multimedia library only
• Assets can be procedurally generated, or inlined into the source file, do not refer to external assets
• For C++, the GIMP has the ability to export images into C source
• For HTML 5, you can use a data URI
• Remember, any assets and source code must be free of copyright restrictions
• You can only add new code, do not remove existing code
You may alter existing code, but please be conservative. Here are some examples:
• Changing numeric or string constants
• Adding a new clause to a condition
• Adding to an existing expression
• Adding parameters to existing function declaration/definition/call sites
• Adding a comment at the start of a line is allowed by this rule, but please minimise such use
• You may also "insert" a newline after a single line comment (thus uncommenting such code)
• The code must compile on your platform of choice, and should strive to be cross platform
• A simple example in C++ is assuming that certain types have or share a particular size
• Do not make OS or Browser specific calls
• Your code must not crash (to the best of your ability)
• Bad commits are ignorable under the "amend the current version" rule. Please clearly state if this step is taken
• For the sake of the experiment, please:
• Try keep each commit relatively small and cohesive - for example add or change a single feature at most
• Avoid committing twice in a row (if the thread is quiet, feel free to ignore this one)
• Have fun everyone!

Edited by rip-off, 31 October 2013 - 05:35 PM.

### #54Cornstalks  Members

Posted 31 October 2013 - 05:36 PM

I've made a repo (totally unofficial) which I'll use to track the history of the two programs. I plan on making two branches, "c++" and "web", where the two programs will be separately tracked. If you have any feedback/questions about the repo, please just let me know (either via thread or PM).

I'm excited for this!

[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

### #55Cornstalks  Members

Posted 31 October 2013 - 09:34 PM

Sorry for the double post, but I want to point out that in the commit history, I plan on deleting all trailing whitespace and converting tabs to spaces. If you have objections, speak now.

As for rules... rip-off, do you care if indentation changes between commits? My editor automatically changes tabs to spaces for me and deletes trailing white space. If you don't want indentation to change at all (and to create a mix of tabs and spaces), I can change my editor, but I want to know before I make any changes to the code.

[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

### #56rip-off  Moderators

Posted 01 November 2013 - 03:48 AM

I've made a repo (totally unofficial) which I'll use to track the history of the two programs.

Great stuff!

As for rules... rip-off, do you care if indentation changes between commits?

Good point, I didn't think of that. No, I don't mind particularly. It will be interesting to see if the community follows the established coding standard or does it become a riot of styles.

### #57ProgrammerDX  Members

Posted 02 November 2013 - 06:08 AM

why is

while(running)

replaced with

void loop() {
...
if(running) { loop() }

}

shouldn't that cause a Stack Overflow?

Edited by ProgrammerDX, 02 November 2013 - 06:09 AM.

### #58slicer4ever  GDNet+

Posted 02 November 2013 - 06:25 AM

why is

while(running)
replaced with
void loop() {
...
if(running) { loop() }

}
shouldn't that cause a Stack Overflow?

tail-recursion, since the function doesn't return meaningful data, the compiler effectively turns it back into a loop.

edit: note that with no optimizations on, the compiler won't do this, and you'll get a overflow crash.

Edited by slicer4ever, 02 November 2013 - 06:57 AM.

Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

### #59swiftcoder  Senior Moderators

Posted 02 November 2013 - 08:22 AM

edit: note that with no optimizations on, the compiler won't do this, and you'll get a overflow crash.

Note that I spent a good 20 minutes with optimisations disabled trying to get a stack overflow out of this, and ultimately failed.

That said, the stack frame just isn't very large at this point. It might take quite a while to actually reach the 8 MB stack limit.

Tristam MacDonald - Software Engineer @ Amazon - [swiftcoding] [GitHub]

### #60slicer4ever  GDNet+

Posted 02 November 2013 - 08:59 AM

edit: note that with no optimizations on, the compiler won't do this, and you'll get a overflow crash.

Note that I spent a good 20 minutes with optimisations disabled trying to get a stack overflow out of this, and ultimately failed.

really? what compiler are you using? i got it very quickly when i ran your commit. I think the current crash is related to the spawnTicks variable, and the tail recursion, trying to figure it out now.

Edited by slicer4ever, 02 November 2013 - 09:00 AM.

Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.