Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Jeb Bush 2012
Apr 4, 2007

A mathematician, like a painter or poet, is a maker of patterns. If his patterns are more permanent than theirs, it is because they are made with ideas.

Doom Mathematic posted:

A lot about games is totally subjective. If it looks pretty when it renders, it doesn't really matter what the unit tests (or any other kind of automated tests) are saying. If the game is no fun to play then it doesn't matter how many of your unit tests are passing or how many of them would need to be broken to fix it. Play testing overrules everything.

say what you will about blow his arguments against unit testing make a lot more sense than this

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Xarn posted:

He said that before he really started, and what he means by compiler is a front-end to LLVM. :v:

the original Jai implementation used a hand-rolled x64 emitter when I saw it, is it now LLVM-based?

QuarkJets
Sep 8, 2008

A lot of games are supposed to have deterministic rules, you could at least test those. Which apparently Factorio does, at least. Developers like Paradox seem to actually care about the quality of their code, and will rip out and replace poo poo that is unmaintainable long after a game releases, so it wouldn't surprise me to learn that they have some unit tests.

You could even test the nondeterministic cases with a bit of Monte Carlo

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

the impression i get is that a lot of game devs (probably, correctly) see that unit tests are really hard to implement for good portions of their code and are just not worth the tradeoff.

And then they throw the baby out with the bath water.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Suspicious Dish posted:

the original Jai implementation used a hand-rolled x64 emitter when I saw it, is it now LLVM-based?

Also it's not like "a frontend to LLVM" would make it somehow not a compiler. Frontend logic is an enormous part of writing a compiler.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I also suspect it to be against Blow's style to use LLVM. Blow's all about performance and speed, and LLVM's backend is very slow lol.

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

Suspicious Dish posted:

I also suspect it to be against Blow's style to use LLVM. Blow's all about performance and speed, and LLVM's backend is very slow lol.

The point of an optimizer is not to be fast, it's to make stuff fast. And nobody in their right mind would try to roll their own nowadays.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
you can have both, though? LLVM is too slow for JITs, as Apple has rediscovered multiple times over.

OddObserver
Apr 3, 2009
Well, yeah, JITs need a different design than an ahead of time compiler. Not wasting resources on stuff that's rarely used is part of it, but also the languages used with JITs want different optimizations, too, than something C-like would.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Zopotantor posted:

The point of an optimizer is not to be fast, it's to make stuff fast. And nobody in their right mind would try to roll their own nowadays.

Yes, and we're talking about Jonathan Blow here sooo

Ola
Jul 19, 2004

Linear Zoetrope posted:

While testing higher level meta-effects like "things with the same tag stack properly" might be useful, this in particular just sounds like data duplication. You're writing the same properties in two places and hand testing if they're out of sync.

I totally get this and I've written tests myself that basically only test the integrity of the universe, that 1+1=2. But it's called unit tests for the reason that you can make a judgement about what constitutes a unit of computation in your software, what truths other bits of the software relies on and then devise a test for it. Mock what you need to mock, don't test the fundamentals of math but test the things that your components say or do to one another.

Letting the game run for a while and confirm that the plumber kills the turtle is not really unit testing imo. The input and output of a unit test isn't necessarily something that's seen by the user, but something the program does under the hood. Games are no different than any other software in this regard, unless Doom 3 is somehow a single Java main method or whatever.

Happy Thread
Jul 10, 2005

by Fluffdaddy
Plaster Town Cop
A great deal of graphics demos are coded as one giant main(), unfortunately

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

Dumb Lowtax posted:

A great deal of graphics demos are coded as one giant main(), unfortunately

Demos are to other software what a pointillist painting is to a photograph.

lobsterminator
Oct 16, 2012




Zopotantor posted:

Demos are to other software what a pointillist painting is to a photograph.

I'd say they are more like sketches. Demos sometimes come across some cool new ideas but they are mostly quickly hacked together, which can later be utilised in a more sensible form.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


Zopotantor posted:

The point of an optimizer is not to be fast, it's to make stuff fast. And nobody in their right mind would try to roll their own nowadays.

one of his top priorities for the language was to make compile times extremely fast

you can see him show off demos and code live on twitch, seems to never take more than a second

e: this is coding the actual game he plans to sell next, the grid-movement-teleport puzzle thing

Doc Hawkins fucked around with this message at 22:38 on Nov 12, 2019

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
if he's done a lot of work with c++, i can understand the motivation

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
saying that LLVM is the best we have and that there's no room for possible improvement why even bother trying is either wrong, or just plain sad.

Athas
Aug 6, 2007

fuck that joker

Xarn posted:

Don't you know that games are the most complex and advanced software? I mean it is harder to write a game than a compiler.

(This is something that Blow actually believes)

I have written several compilers and my day job is to be an academic researcher in compiler technology, and I absolutely believe compilers are easier to write than games. A traditional compiler is a pretty simple batch-mode program, basically a completely deterministic pure function. It may do complex things and it is hard to make it generate better output (this is why I have a job, after all), but as a context in which to write code, it's pretty comfortable. Simple debugging and fuzzing techniques work well. Games have way more stuff going on, a much less clear notion of what valid input and output may be, and tons of nondeterminism.

Compiler frontends that provide more IDE-like services (e.g. Roslyn) are not as batch-oriented, but I'll still argue that the problem they solve is much more well-defined, and amenable to old-school systems design, than a modern game.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Programming languages actually have some interesting similarities with games in the sense that different mechanics tend to combinatorially explode in complexity rather than being naturally “additive”.

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
Both compliers and games have massive ranges of complexity depending on objectives. Compilers don't have to deal with terrible platform APIs so much, though.

spiritual bypass
Feb 19, 2008

Grimey Drawer
Much like games, some programming languages are very bad while others are less bad

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Ralith posted:

Both compliers and games have massive ranges of complexity depending on objectives. Compilers don't have to deal with terrible platform APIs so much, though.

Let me tell you about the special case for -[NSString length] in Clang's Objective-C support. Or the workarounds for outright broken standard libraries in Clang's C++ support. Or all the terrible language extensions that are only used in various platform headers because hey, they're shipped with the toolchain so why not be totally dependent on it?

EDIT: Oh, and just on the implementation level the built-on-demand aspects of features like modules mean we get to deal with the wonderful world of efficient change detection and filesystem locks.

rjmccall fucked around with this message at 01:22 on Nov 13, 2019

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
What I feel is also missing from Mr. Blow's decision to roll everything himself are things like interactive autocompletion and debugging support. In his live stream he's typically clacking away in vi or some such, which may not be the ideal environment for a lot of developers.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Are there any games that are developed in a modular fashion like a business app? I.e. with a pure "business logic" library where all the rules play out and the abstract game state evolves via ABI calls, and a separate "frontend" that gets the updated game state from the library and renders it in the engine?

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
I'm pretty sure all the Paradox Grand Strategy games are structured roughly like what you describe.

But the comedy answer is Aurora 4x.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Ralith posted:

Both compliers and games have massive ranges of complexity depending on objectives. Compilers don't have to deal with terrible platform APIs so much, though.

Just terrible CPU APIs

Hughlander
May 11, 2005

Suspicious Dish posted:

Probably the best-known example of testing in video games is Riot's test harness for League of Legends, where they record game playback and ensure very high-level things like "when I am this character with this spell with these stats, and fire at this enemy with these stats 5 times, it will eventually die". That's not unit testing, that's super high-level and just about the level that starts becoming helpful for games.

That's not really a fair example of what riot actually does... https://technology.riotgames.com/news/automated-testing-league-legends That's almost four years old and it's just increased in complexity from there.

The biggest problem of that twitter thread is the innate coupling of unit tests to TDD in his mind. One of my sound bites I use a lot is, "I don't believe in TDD personally but any code base that an engineer could develop on using TDD is one that is in good shape." And I still maintain that.

Plorkyeran posted:

Game devs tend to have very negative opinions on automated testing of all sorts, for some good reasons and some bad reasons.

That's becoming more and more of a minority opinion among professional developers and I suspect is on the order of no more than developers at large. I know I'm working on recruiting someone from a medium sized insular organization and they haven't changed their process in the 16 years since we had started there, and that's one reason I'm able to recruit.

NihilCredo posted:

Are there any games that are developed in a modular fashion like a business app? I.e. with a pure "business logic" library where all the rules play out and the abstract game state evolves via ABI calls, and a separate "frontend" that gets the updated game state from the library and renders it in the engine?

Mobile and Unity games tend to be like that. I worked on client predictive/server authoritative games for years where you'd run the same logic on the client as on the server as an anti-cheat yet responsive measure. Separately two projects enforce a no UnityEngine/UnityEdfitor boundary between Game logic and UI/UX one reason being to run it in a bog standard test runner outside of a UnityEditor

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆

NihilCredo posted:

Are there any games that are developed in a modular fashion like a business app? I.e. with a pure "business logic" library where all the rules play out and the abstract game state evolves via ABI calls, and a separate "frontend" that gets the updated game state from the library and renders it in the engine?

Deserts of Kharak did this. A dev did a talk about their architecture and other stuff at GDC. Interestingly, despite being a 3d game the simulation layer only runs a 2d abstraction, and then the presentation layer fakes the third dimension (even including running a separate physics engine to make vehicles bounce on their shocks and get airtime from jumping off dunes)

https://www.youtube.com/watch?v=wwLW6CjswxM

VikingofRock
Aug 24, 2008




rjmccall posted:

Let me tell you about the special case for [...] the workarounds for outright broken standard libraries in Clang's C++ support.

Please do, this sounds fascinating.

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof
Years ago there was an article about how an engine developer implemented scripting so level designers could write their own high-level game mechanics, but I can't find it now. I'm pretty sure it was a Star Wars game.

feedmegin
Jul 30, 2008

Suspicious Dish posted:

saying that LLVM is the best we have and that there's no room for possible improvement why even bother trying is either wrong, or just plain sad.

Also llvm may be low level but it is still a vm. The stuff I want to mess about with in my own language (closures/spaghetti stacks, calling conventions, object file formats) is exactly what llvm abstracts away from you so I wrote my own backend that goes direct to writing out machine code in ELF, MachO etc files. It's also a fun learning experience!

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
LLVM has practically never been a VM. It's a confusing legacy name for what is basically a compiler toolkit at this point.

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆

DaTroof posted:

Years ago there was an article about how an engine developer implemented scripting so level designers could write their own high-level game mechanics, but I can't find it now. I'm pretty sure it was a Star Wars game.

Many games do this, hence the popularity of Lua. It's a bad scripting language whose main redeeming feature is being easy to integrate into a pre-existing codebase, so you can expose internal game stuff for designers/modders/players to tinker with.

feedmegin
Jul 30, 2008

Suspicious Dish posted:

LLVM has practically never been a VM. It's a confusing legacy name for what is basically a compiler toolkit at this point.

I don't mean it executes byte code, I mean it is an abstraction over the real hardware.

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

RPATDO_LAMD posted:

Many games do this, hence the popularity of Lua. It's a bad scripting language whose main redeeming feature is being easy to integrate into a pre-existing codebase, so you can expose internal game stuff for designers/modders/players to tinker with.

Yeah, very true. I thought of this article in particular because it included a lot of technical detail and examples of how the scripts' versatility exceeded their expectations. Unfortunately, my google fu is still failing me.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

VikingofRock posted:

Please do, this sounds fascinating.

Compilers sometimes permit code to be written that shouldn't actually compile, and sometimes that code is in system headers. So, for example, there is (or used to be) a function in libstdc++'s hashtable implementation that returns false from a function that returns a pointer type; false used to be a valid null pointer constant, and while that stopped being true in C++11, we can't exactly just refuse to parse the libstdc++ headers, so instead there's a hack which just allows this as a null pointer constant when it appears in system headers. I think that's a bad fix; it would be better to have been more specific about the hack. For example, GCC used to have a bug where it treated the conditional operator as producing an r-value in a case where it was supposed to produce an l-value, and they relied on that behavior in std::common_type, and so there is literally a check in Clang when instantiating a typedef named type within a class template called ::std::common_type declared in a system header to strip references before binding the typedef, and without that hack some versions of libstdc++ won't work.

The more general example of this is with template parsing. EDG was the first C++ compiler that implemented the name lookup rules within templates (mostly) correctly, but they intentionally hid that behavior behind a flag and implemented compatibility modes for how GCC and MSVC implemented templates, both of which were quite wrong on some fundamental issues according to the spec. Because compilers were using the wrong rules, people could write C++ code that compiled according to the broken behavior, and of course that included C++ library authors. Clang actually used the correct rules by default, and as a result we couldn't parse existing C++ library headers. You can't really stand on principle at that point; you have to figure out some way to make it work, ideally without completely surrendering to broken behavior everywhere. So we fixed libc++ (because it was new enough that we didn't really need to care about existing installs), and we put some hacks in the compiler to get around the libstdc++ problems. The problems in MSVC's headers were much more pervasive, and eventually we just had to add a compatibility mode for them which (IIRC) is only enabled by default within their STL headers.

Happy Thread
Jul 10, 2005

by Fluffdaddy
Plaster Town Cop

DaTroof posted:

Years ago there was an article about how an engine developer implemented scripting so level designers could write their own high-level game mechanics, but I can't find it now. I'm pretty sure it was a Star Wars game.

Does anyone know how PS4 Dreams handles this? I don't think it allows players/designers to do any scripting, but the end results do look like highly customized shader effects and render effects as if they had. See the below "game level" made by someone inside Dreams while playing it, submitted to the big online collection players browse through.

They achieved some pretty serious custom lighting effects at the timestamp linked. Do you know if you can type code at all in Dreams or is it all just done by players flipping a million flags in menus, and placing objects?

https://www.youtube.com/watch?v=6v8BTanhMQw&t=91s

OddObserver
Apr 3, 2009

rjmccall posted:

false used to be a valid null pointer constant, and while that stopped being true in C++11

praise be.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Dumb Lowtax posted:

Does anyone know how PS4 Dreams handles this? I don't think it allows players/designers to do any scripting, but the end results do look like highly customized shader effects and render effects as if they had. See the below "game level" made by someone inside Dreams while playing it, submitted to the big online collection players browse through.

They achieved some pretty serious custom lighting effects at the timestamp linked. Do you know if you can type code at all in Dreams or is it all just done by players flipping a million flags in menus, and placing objects?

You can buy a copy of the game right now and check their tools. They're pretty expansive and detailed. Their graphics tech is state-of-the-art in my opinion.

Adbot
ADBOT LOVES YOU

fritz
Jul 26, 2003

feedmegin posted:

I don't mean it executes byte code, I mean it is an abstraction over the real hardware.

Do you mean the IR?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply