Live data from Hacker News

VVVVVV’s source code is now public, 10 year anniversary jam happening now

distractionware.com

201–210 of 232 posts

Re: VVVVVV’s source code is now public, 10 year anniversary jam happening now

#201
post #192

Earlier quoted context omitted.

That's a weighed average with, presumably, hand-chosen coefficients to make a nice visual effect. I fail to see how these numbers are "magic." How would you produce this effect without numbers?

> How would you produce this effect without numbers? That's not what 'magic numbers' means. The idea is that you factor out the number into named variables so they don't appear unnamed in the body of expressions.

Ok, sure. Even so, this is about the least compelling example of "magic number" that I've seen. They're used once, the intent is clear, and you don't have to go hunting for the definition.

Re: VVVVVV’s source code is now public, 10 year anniversary jam happening now

#202

It’s always great to be able to study the source code for successful, released, real games. I will note that this is actually the source code of the C++ rewrite! The original game was written in Flash, and this version was apparently written by Simon Roth. My impressions: The source code is a bit of a tangle here. There are magic numbers ( https://wiki.c2.com/?MagicNumber ) all over the place, plenty of god classes (…

> The source code is a bit of a tangle here. There are magic numbers ( https://wiki.c2.com/?MagicNumber ) all over the place, plenty of god classes ( https://wiki.c2.com/?GodClass ), and in general you will have to do a bit too much archaeology to figure out what a particular class or member function is supposed to do (the function and class names don’t give you enough, and there are no comments to help out). There a…

Where this style applies the most is with hardcoded assets: initializations and runtime behaviors that require an unknown degree of flexibility.

When someone is trained in OOP, the requirement "flexible behavior" triggers a search for answers through polymorphism, but polymorphism is much more structured than a copy-paste-modify code path. It creates limits to scope and requires more explicit names for things. That is the point, of course. You have write more code and do more complex things to get the same level of flexibility, and it'll be harder to debug since the call stack will have to jump around throughout the layers of abstraction. In a "time from idea to production code" latency analysis, OOP structures lose to copy-paste.

And that's why, across the bulk of game codebases I've seen, there tends to be a big jump from hardcoded assets straight into data-driven ECS-style approaches. Small games start with the former, and if they get big enough switch to the latter. The ECS approach still exacts a debugging penalty because more bugs will exist in data, where they're harder to analyze with IDE tooling, but more behaviors are encoded as explicit patterns with limited scope, which is good in a team environment, and it's possible to go data-driven in an incremental rewrite: simply find all the truly redundant stuff, replace it with a parameterized pattern, expose the pattern as data. For the stuff that isn't easily parameterized, consider encoding a small state machine interpreter so that an imperative program definition may occur in data. In the entity system, add some notion of dynamic compositions of state and behavior at initialization. Between those three you can cover just about everything, and you never have to do it 100% to ship: it's there to assist the things that benefit from additional structure, which probably isn't all of the game. (rather, in the AAA environment the data-driven approach can tend to get out of hand - it's a move that allows the designers to avoid needing explicit code support for longer and longer periods of time, with the predictable result of enterprise anti-patterns that abuse scripting in a fashion that is much harder to debug than the hardcoded equivalent.)

This distinction is also basically why you don't see Jon Blow, for example, really get excited about discussing the runtime architecture of his game projects: If the bulk of the game is assets all the way down, there's nothing to talk about, and the only part that concievably could be exciting is some of the core algorithms that drive the interactivity.

It's also why so many gamedevs are apologetic about their code: half of them try to escape this reality by finding a magic mix of abstractions(which eventually blows up and causes rewrites once sufficient complex behavior hits the codebase), the other half run with it and stay in the local optimum of inlined, hardcoded, primitive-heavy functions.

Re: VVVVVV’s source code is now public, 10 year anniversary jam happening now

#203
post #189
post #67

If anyone is looking for a really great game, you should check out Terry's latest, Dicey Dungeons. Incredible variation. Each episode and character has you discovering new strategies and play styles. 30% off on Steam right now: https://store.steampowered.com/app/861540/Dicey_Dungeons/

Hmm, not anymore it seems (the 30% off).

[deleted]

Re: VVVVVV’s source code is now public, 10 year anniversary jam happening now

#204

Earlier quoted context omitted.

The analogy doesn’t really hold. Is a bathroom door at a grocery store called a “window” rather than a “door” if they prohibit you from bringing unpaid groceries through it?

I have no idea what you're going for here. I feel like Programmer Analogies always rely on the reader agreeing with the author... :|

Not all windows are doors. Don’t worry about it, I’m terrible at analogies that make sense to anyone (including programmers, sadly). And if I clarified I’d just be attacked further for not endorsing the OSI party line when it comes to these things. It’s not you, it’s me, etc.

Re: VVVVVV’s source code is now public, 10 year anniversary jam happening now

#205

It’s always great to be able to study the source code for successful, released, real games. I will note that this is actually the source code of the C++ rewrite! The original game was written in Flash, and this version was apparently written by Simon Roth. My impressions: The source code is a bit of a tangle here. There are magic numbers ( https://wiki.c2.com/?MagicNumber ) all over the place, plenty of god classes (…

> The source code is a bit of a tangle here. There are magic numbers ( https://wiki.c2.com/?MagicNumber ) all over the place, plenty of god classes ( https://wiki.c2.com/?GodClass ), and in general you will have to do a bit too much archaeology to figure out what a particular class or member function is supposed to do (the function and class names don’t give you enough, and there are no comments to help out). There a…

The key insight is that most games are released largely once, and then only minor work is done after that. If it's really successful it may get additional ports or content expansions. It does not make sense to pour so much time into making code reusable and clean if it is not going to be built on continuously for long periods of time. Additionally, games do not have to deal with security issues as much; most code is running on trusted data sans networking features. Bad code is 100% counter to security - it's those edge cases where assumptions fail and you lose big time.

As a counterpoint for example, code running on servers should totally be built for the long haul: it's gotta evolve continuously with requirements, it has to cope with edge conditions and especially it has to be secure. You can't get away with the same type of spaghetti in your ACL checking that you can in the code that handles player physics in a platformer.

That does not mean video game devs are bad coders. They are just optimizing for different scenarios.

Re: VVVVVV’s source code is now public, 10 year anniversary jam happening now

#206
post #69

Earlier quoted context omitted.

> Open source is defined by the OSD To be a bit pedantic, your statement is a slightly ambiguous. They have a good/accurate definition of open source. They don't "define it" in that they can change the definition to mean "and the packaging must be blue" and that becomes part of what open source means.

Yes, OSI is responsible for the OSD, but the term has gotten somewhat "genericised". It's like saying that the Kimberly-Clark company doesn't define what "kleenex" is anymore. Whenever this debates comes up everyone always says, "wait, the term existed before OSI", but no, it really did not. Essentially nobody was saying "open source" before 1998 when OSI and Tim O'Reilly started pushing "open source". https://thebaf…

Well, there are references of "Open source" being in use earlier; for example:

https://groups.google.com/forum/#!msg/comp.os.ms-windows.pro...

http://www.xent.com/FoRK-archive/fall96/0269.html

Especially that Caldera one seems pretty high profile.

"Open source" has always been used as a generic term, because it's a very descriptive adjective+noun one. Trying to reserve such terms for one particular narrow usage seems like an fools' errand to me, which is why these discussion are being held all the time.

Re: VVVVVV’s source code is now public, 10 year anniversary jam happening now

#207

The Awesome Games Done Quick speedrunning marathon [0] ran this game this morning. I didn't get a chance to see it, but I wonder if they mentioned anything about its tenth anniversary? Watch for the video here [1] after today's stream is archived. [0] gamesdonequick.com [1] https://www.reddit.com/r/speedrun/comments/ek9zmz/agdq_vod_t...

Here is the direct link to watch (the run is 21 minutes total): https://www.twitch.tv/videos/533706108?t=05h29m30s

And the exact occasion when the source code release was announced:

https://www.twitch.tv/videos/533706108?t=05h52m06s

Re: VVVVVV’s source code is now public, 10 year anniversary jam happening now

#208

It’s always great to be able to study the source code for successful, released, real games. I will note that this is actually the source code of the C++ rewrite! The original game was written in Flash, and this version was apparently written by Simon Roth. My impressions: The source code is a bit of a tangle here. There are magic numbers ( https://wiki.c2.com/?MagicNumber ) all over the place, plenty of god classes (…

> I will note that this is actually the source code of the C++ rewrite!

"The repo contains two versions – the desktop version, ported to C++ by Simon Roth in 2011, and later updated and maintained by Ethan Lee – and the mobile version, written in Actionscript for Adobe AIR, based on the original v1.0 flash version of the game."

Re: VVVVVV’s source code is now public, 10 year anniversary jam happening now

#209

Earlier quoted context omitted.

> The source code is a bit of a tangle here. There are magic numbers ( https://wiki.c2.com/?MagicNumber ) all over the place, plenty of god classes ( https://wiki.c2.com/?GodClass ), and in general you will have to do a bit too much archaeology to figure out what a particular class or member function is supposed to do (the function and class names don’t give you enough, and there are no comments to help out). There a…

This is a classic, but I think it applies here: https://web.archive.org/web/20200108125657/https://www.jwz.o... Edit, I've been informed that the direct link has a NSFW redirect, so using archive.org instead

I've read that before but on this re-reading it really hit me that he was describing 'go fast and break things' more or less with the so called New Jersey approach.

"It is better to get half of the right thing available so that it spreads like a virus. Once people are hooked on it, take the time to improve it to 90% of the right thing."

This is like Facebook.

Re: VVVVVV’s source code is now public, 10 year anniversary jam happening now

#210
post #72

Oh gods. VVVVVV's core mechanic is that you don't so much "jump" as you just flip gravity, and you only get to do so when your feet are firmly on the floor. This leads to some very interesting designs. The stage "Veni Vidi Vici (Doing Things The Hard Way)" is possibly the evilest level I've ever completed in a video game. Just a tiny little block, trivial to jump over, but the lack of a jump button means you have to.…

How those rooms are implemented: https://github.com/TerryCavanagh/VVVVVV/blob/master/desktop_...

Thanks for the link. This is actually pretty neat! Elegant in its own way, gets the job done pretty quickly, and you can change and fine tune the level designs. I like it!
Post reply on HN