code logs -> 2019 -> Wed, 23 Oct 2019< code.20191022.log - code.20191024.log >
--- Log opened Wed Oct 23 00:00:38 2019
00:04 Kindamoody is now known as Kindamoody[zZz]
00:07 himi [sjjf@Nightstar-1drtbs.anu.edu.au] has joined #code
00:07 mode/#code [+o himi] by ChanServ
00:38 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds]
01:12 celticminstrel [celticminst@Nightstar-ocfc15.dsl.bell.ca] has joined #code
01:12 mode/#code [+o celticminstrel] by ChanServ
01:12 celmin|away [celticminst@Nightstar-ocfc15.dsl.bell.ca] has quit [Ping timeout: 121 seconds]
01:16 celticminstrel [celticminst@Nightstar-ocfc15.dsl.bell.ca] has quit [Ping timeout: 121 seconds]
01:16 celmin [celticminst@Nightstar-ocfc15.dsl.bell.ca] has joined #code
01:17 mode/#code [+o celmin] by ChanServ
02:10 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code
03:11 macdjord [macdjord@Nightstar-rslo4b.mc.videotron.ca] has joined #code
03:11 mode/#code [+o macdjord] by ChanServ
03:11 Degi [Degi@Nightstar-oqdctf.dyn.telefonica.de] has quit [Ping timeout: 121 seconds]
03:12 Degi [Degi@Nightstar-cq6e82.dyn.telefonica.de] has joined #code
03:40 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
04:33 Vorntastic [uid293981@Nightstar-6br85t.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity]
05:26 celmin [celticminst@Nightstar-ocfc15.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
05:30 VirusJTG_ [VirusJTG@Nightstar-42s.jso.104.208.IP] has joined #code
05:33 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has quit [Ping timeout: 121 seconds]
06:20 himi [sjjf@Nightstar-1drtbs.anu.edu.au] has quit [Ping timeout: 121 seconds]
07:11 Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
07:25 Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code
09:17
<&jeroud>
Why is quasiquotation so much harder to implement as AST transforms in my Rust code than as a Scheme macro?
09:32 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
09:32 mode/#code [+qo Vornicus Vornicus] by ChanServ
09:56 himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code
09:56 mode/#code [+o himi] by ChanServ
10:06
<@abudhabi>
ToxicFrog: [R]: It worked, thanks.
12:13 Kindamoody[zZz] is now known as Kindamoody
12:59 Emmy is now known as Emmy-Camping
13:22 celticminstrel [celticminst@Nightstar-ocfc15.dsl.bell.ca] has joined #code
13:22 mode/#code [+o celticminstrel] by ChanServ
13:28
<@ErikMesoy>
This overgrown IDE is spellchecking my variable names and my string literals. :/
13:48
<&[R]>
Word is not an IDE
13:50
<@ErikMesoy>
Pfffft.
14:38 * Vornicus resists the urge to name his sections about various special cases: "a special case" "a special special case" "a special special special case"
14:42
<@ErikMesoy>
"a special case" "a very special case" "an extremely special case" "a ludicrously special case" "the most specialest case"
14:48
<~Vornicus>
and of course "the not actually special at all" case
15:12
<&McMartin>
The general case
15:12
<&McMartin>
The lieutenant case
15:17
<~Vornicus>
the rear admiral case?
15:24
<&McMartin>
the ablative case
15:26
<@ErikMesoy>
the brief case
15:31
<~Vornicus>
oh I have four. Okay. special, special special, special special special, and special special special special.
15:31
<~Vornicus>
:P
15:32
<@ErikMesoy>
Name them after dimensions: a cubic special case, a quartic special case, a quintic special case.
15:45
<~Vornicus>
(more specifically: there's landing on an existing edge; there's landing on an existing edge that is also a potential multi-edge; there's doing that and it also happens to be outside of the convex hull of the finite section; and there's -- okay that's actually a subcase of the special special case -- landing on a potential multi-edge that happens to be in line with the very first point)
15:45
<~Vornicus>
so actually I have special, special special, special special special, and other special special special.
15:46
<&McMartin>
case 1 (not special), case 2.1, case 2.2.1, and case 2.2.2
15:46
<&McMartin>
Arguably, just cases 1 through 4, with case 2 refined to "landing on an existing edge that is not a potential multi-edge and not etc etc"
15:59 Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
15:59 mode/#code [+o Syloq] by ChanServ
17:25 Kindamoody is now known as Kindamoody|out
18:30 Derakon [Derakon@Nightstar-f1lpvo.ca.comcast.net] has joined #code
18:30 mode/#code [+ao Derakon Derakon] by ChanServ
18:30 * Derakon grumbles at this sqlite library.
18:31
<&Derakon>
It seems purpose-built to make it impossible to let you conveniently write queries and iterate over the results.
18:31
<~Vornicus>
?
18:31
<&Derakon>
Because every fucking object you make with it has to be Disposed of when you're done, which is usually handled using a `using` block.
18:31
<&Derakon>
So it's like, (create connection and (create command and (execute command and read results out)))
18:32
<&Derakon>
Which really does not lend itself to, say, writing a "execute this query and give me the results reader back".
18:32
<&Derakon>
You either have to say "execute this query and give me the connection and command and reader back so I can clean things up properly" or "execute the GetTheShipData query and give me the ships back".
18:33
<&Derakon>
...I mean, I assume. The documentation is pathetic.
18:33
<&Derakon>
But all of the examples I'm seeing have `using` blocks out the wazoo.
18:35
<&McMartin>
sqlite3 is a little wacky with this, so, um, I'm not 100% sure whose fault this one is
18:35
<&McMartin>
The connection is generally "open one and leave it open forever"
18:36
<&McMartin>
But statements are "compile it when you create it, and then bind values, and then read results out *from the statement itself because that is also the reader* and then reset and rebind as needed for different parameters and then only dispose of the statement when you're done making the queries of that sort"
18:36
<&McMartin>
... and it leaks if you don't
18:37
<&McMartin>
So the idea that a query and the reader of the results are different are being imposed by the library over a memory discipline that mixes very poorly with GC or multithreaded use~
19:00
<&Derakon>
Ah yeah, guess I can just keep the connection open indefinitely.
19:00
<&Derakon>
And a read-only command, sure, why not.
19:03
<&McMartin>
When I had to do a GC wrapper over SQLite3, I had a Connection class wrapping sqlite3 * and a Query class wrapping sqlite3_stmt * that retained the connection.
19:03
<&McMartin>
The query could be reset and rebound and served as its own iterator, of sorts; it represented the compiled version of a specific SQL query.
19:40
<&Derakon>
I'm mostly just feeling pissy that this is proving to be so hard to set up.
19:41
<&Derakon>
I'm used to better-supported and -documented libraries. :
19:41
<&Derakon>
:\
19:41 * McMartin nods
19:41
<&McMartin>
That said, say
19:41
<&McMartin>
er
19:41
<&McMartin>
-say
19:41
<&McMartin>
I do have significant experience with sqlite3 *specifically* if you need to wrangle it
19:41
<&McMartin>
And sqlite3 itself is well documented at the C level
19:41
<&McMartin>
(Also one of the very few libraries that is Actually Public Domain)
19:42
<&McMartin>
So if you have questions about *those* parts (I think C#-ese for the direct interface would be something like P/Invoke?) I can probably give some guidance
19:43
<&Derakon>
At the moment my code is a) opening a connection (static, never closed), b) making a command (static, never disposed), c) setting that command's query text to "SELECT * FROM Ships" with no parameters, then d) trying to iterate over command.ExecuteReader and getting nulls when I try to read from it.
19:44
<&Derakon>
Looks like this: https://pastebin.com/6NdeD3XW
19:45
<&Derakon>
I suppose I should verify that it's able to access the database file.
19:53
<&McMartin>
OK, yeah.
19:54
<&McMartin>
At the raw C level that is one call to sqlite_prepare_v2() and no bindings are necessary
19:54
<&McMartin>
Start iteration with sqlite3_reset and then iterate over the result with successive calls to sqlite3_row()
19:55
<&McMartin>
And in this case you'd be recompiling the query each time.
19:55
<&Derakon>
Which is fine, because I'm basically loading assets here.
19:55
<&Derakon>
The sqlite database is functionally read-only; it's just meant to be a convenient way to organize large blocks of ship and part statistics.
19:56
<&Derakon>
But honestly at this point I feel like a Google Sheet exported to CSV and converted into JSON by a Python script would be easier. >.<
20:03
<&McMartin>
... yes, for static data JSON all day every day
20:04
<&McMartin>
sqlite3 has a command shell that I think lets you do CSV export too
20:04
<&jerith>
(XML.)
20:04
<&McMartin>
(I suspect the data here is too individually brief for me to prefer XML.)
20:05
<&jerith>
JSON's a perfectly acceptable format.
20:05
<&jerith>
Just... don't try to pretend it's human-readable or (especially) human-editable.
20:06
<&McMartin>
If your text includes Strings With Paragraphs, JSON becomes seriously problematic, imo.
20:06
<&McMartin>
But if you're just a collection of numbers and one or two word phrases? Go nuts.
20:07
<&Derakon>
The point here is to be able to examine my parts and say "OK, all guns under 8" diameter need to deal 5% more damage" or whatever.
20:08
<&Derakon>
My first inclination was to do a spreadsheet and work with a CSV file, but CSVs turned out to be a clusterfuck.
20:08
<&Derakon>
In terms of the library support, I mean.
20:08
<&jerith>
Sounds like spreadsheet->JOSN is a good option.
20:08
<&McMartin>
Yeah, CSV is... ambiguous at worst and unergonomic at best.
20:08
<&jerith>
CSV is a data format the same way LISP is a programminng language.
20:09
<&Derakon>
I'd been hesitant on the spreadsheet->JSON because it'd be a clunkier import process -- export sheet as CSV, run script to get JSON. But the script is trivial so I guess I'll just put up with it.
20:09
<&Derakon>
I wasn't planning on actually parsing raw CSV text.
20:09
<&jerith>
There are dozens of poorly specified and thoroughly incompatible variants.
20:10
<&jerith>
If you control all the input and don't need multiline or quoting or whatever, it's pretty trivial to handroll an appropriate parser.
20:11
<&jerith>
Or finding the right settings for an off-the-shelf CSV parser.
20:11
<@TheWatcher>
Dera: you could export from the spreadsheet as XML!
20:11 * TheWatcher flrrrrrd
20:11 * Derakon has TW shot.
20:11
<&Derakon>
jerith: tried the off-the-shelf parser. It made Unity crash.
20:12
<&McMartin>
I do not understand this but I am compelled to share https://twitter.com/Limax7/status/1187050428405559297
20:14
<@TheWatcher>
That is impressive
20:14
<@TheWatcher>
I wonder how many tries that took
20:18
< Mahal>
I think the understanding is "because"
21:27
<&Derakon>
CSV to JSON converter: https://pastebin.com/MuGtHvie
21:45
<~Vornicus>
that is pretty much exactly what I was hoping it'd be
22:14
<&jerith>
`json.dumps(list(reader))`?
22:14 * McMartin hands Derakon the .readlines() function
22:16
<&Derakon>
McM: .readlines is for file I/O, doesn't exist on DictReader so far as I'm aware.
22:16
<&Derakon>
list(reader) might work though.
22:16
<&jerith>
I tend to avoid splitlines() and such unless I specifically want to keep the newlines on the strings, so I tend not to think of the variants that don't.
22:18
<&Derakon>
Anyway, got the JSON-based importer working. So now all of my ship stats are in a single file.
22:18
<&Derakon>
Now I get to do it for parts, too.
22:18
<&jerith>
\o/
22:19
<&jerith>
Another page in the same spreadsheet?
22:20
<&Derakon>
Separate CSV files. What they look like in Google Sheets is a separate question.
22:21
<&jerith>
Yeah, I don't know any variants of CSV that support multiple sheets in a single file.
22:21
<&jerith>
I'm pretty sure gsheets has an export API.
22:21
<&McMartin>
Yeah. This is where JSON's ability to nest arrays is nice, if you need it.
22:21
<&Derakon>
It does.
22:22
<&Derakon>
Honestly it's easier for me to have separate CSV to separate JSON.
22:22
<&Derakon>
It's not like opening one additional file during program start is going to be that noticeable.
22:23
<&jerith>
So with another hour or so of finding the right library you could probably build a one-touch "suck data from spreadsheet into JSON file(s)".
22:23
<&jerith>
But likely not worth it right now.
22:23
<&jerith>
And separate files per entity/resource type makes sense.
22:24
<&McMartin>
And if you need them as individual files again later, zip files (though NOT tarballs) make great resource packs
22:24
<&Derakon>
This is all going in Unity's "Resources" folder.
22:25
<&Derakon>
Which is basically that, AIUI.
22:25
<&jerith>
Why not tarballs?
22:25
<&jerith>
(I know they're not great for such things, but never really thought about the reasons.)
22:26
<&McMartin>
Zip files let you independently decompress each file
22:26
<&McMartin>
Tarballs require you to decompress the entire archive to access any individual member, because it's collected/indexed/concatenated and then compressed.
22:26
<&McMartin>
While with Zip files, they're compressed, then collected and indexed.
22:26
<&jerith>
Whereas tarballs are compressed as a complete stream.
22:27
<&McMartin>
Yep.
22:27
<&McMartin>
The concise lies-to-children version is "zip files are random access"
22:27
<&jerith>
How do zipfiles exploit cross-file duplication, then?
22:28
<&McMartin>
They don't. That's why they're larger than equivalent tarballs.
22:28
<&jerith>
Ah. I was pretty sure they did.
22:28
<&McMartin>
It is not theoretically impossible for such a scheme to exist, and for all I know RAR or 7z uses it.
22:28
<&jerith>
There's probably a way to build your symbol tables from the complete set of files or something.
22:28
<&McMartin>
But the version of the ZIP format I've dealt with does not.
22:28
<&McMartin>
Yeah
22:29
<&McMartin>
Such a zip file would however be extremely hard to edit.
22:29
<&jerith>
There area lso a dozen different compression options in ZIP.
22:29
<&McMartin>
Also true!
22:29 Kindamoody|out is now known as Kindamoody
22:29
<&McMartin>
And UQM, for instance, uses "stored" for all file types that include decent compression already (ogg, png).
22:30
<~Vornicus>
rar works like tarball
22:31
<&jerith>
I don't like 7z for some things because it's very difficult to do anything with an incomplete file.
22:32
<&McMartin>
ZIP has that problem in a bizarre way
22:32
<&McMartin>
Incomplete ZIP files are quite usable...
22:32
<&McMartin>
... as long as you have an intact suffix.
22:33
<&McMartin>
Any file present can be accessed if you pad out the initial bit back to the zipfile's initial size with garbage, because it's never checked.
22:33
<&jerith>
There are a bunch of tools for heuristically repairing zipfiles, though.
22:33
<&McMartin>
Yep.
22:33
<&McMartin>
It's pretty robust
22:33
<&McMartin>
I am mad that they got the magic number wrong, but that error was made like 35 years ago or longer
22:34
<&McMartin>
The index is at the end of the file, but the magic number is at the *beginning of the index*, so you have to start at the end and scan backwards looking for something that looks like an index.
22:34
<&jerith>
I once knew rather more than I ever expected to about zipfiles, though: https://github.com/jerith/zipix
22:36
<&McMartin>
Here were my adventures, long ago: https://github.com/michaelcmartin/monocle/blob/master/src/raw_data.c#L71
22:36
<&jerith>
Which is a nneat crossover with the conversation in #fleet: https://arcengames.com/starward-rogue-drm-free-release-and-30-off/
22:37
<&McMartin>
... velociraptor game?
22:39
<&McMartin>
Ah, there it is
22:39
<&McMartin>
I guess this didn't get released
22:39
<&McMartin>
... though now, um
22:39
<&McMartin>
Untitled Velociraptor Game
22:40
<&ToxicFrog>
Re cross-file duplication: the term you're looking for is "solid archive". It's optional in both RAR and 7z, and mandatory in compressed tar.
22:41
<&McMartin>
NSIS also has a "solid archive" option.
22:41
<&jerith>
Velociraptor game went Early Access, but received many "asset flip" review because some of the assets used were not original art.
22:41
<&McMartin>
Yes, I noticed how defensive they were about it
22:42
<&jerith>
This was about the time Steam's curation issues were starting to have a major impact.
22:42
<&ToxicFrog>
Back in the day I recall using a compressor that would produce "solid ZIPs", but IIRC these were actually done by creating an uncompressed zip and then compressing that and the UI just abstracted that away as long as you used this specific tool.
22:42
<&McMartin>
jerith: I remember getting bad reviews of some open-source stuff I did because they could tell what tools I used to create UI elements in-renderer
22:42
<&McMartin>
So, uh
22:42
<&McMartin>
While I acknowledge that people like original content
22:43
<&McMartin>
I feel like "asset flip" is defined a little too broadly
22:43
<&McMartin>
Like, to "having an asset store is strictly counterproductive" levels.
22:44
<&jerith>
All the actual work in the game was in the character design, the rendering pipeline, and tuning the movement and attacks to feel awesome.
22:44
<&McMartin>
Right
22:44
<&McMartin>
It's just, the lesson I've taken from this is "literally just ship with programmer art. You know what isn't panned as an asset flip? THOTH."
22:45
<&jerith>
The stock assets were placeholders for the raptor to romp around in and demolish.
22:48
<&jerith>
Because it's pointless designing a bunch of awesome areas to Velociraptor (well, Deinonychus) in until you know exactly how the dino's going to behave and what kinds of things you're going to want around.
22:50
<&jerith>
Anyway, asset flips are a problem created directly by Steam's lack of basic quality control. While the somewhat extreme overreaction of their customerbase is highly problematic, it's also somewhat understandable.
22:51
<&jerith>
And that whole situation makes me sad.
22:52
<&jerith>
Especially since In Case Of Emergency, Release Raptor was looking like it would become one of the most fun first-person games I'd seen in a while.
22:52
<&jerith>
(Not necessarily one of the best, but certainly loads of fun.)
22:53
<&Derakon>
There's three definitions of "asset flip" I'm familiar with. The first is "I recognize these assets from other games", a.k.a. the asset store is worthless for release-tier art. The second is "you took the demo game from an asset that handles significant game logic (like an FPS system or a shopkeeper system) and published it as a game"...generally those aren't good games though because they're just designed to show off the asset's capabil
22:53
<&Derakon>
ities.
22:54
<&Derakon>
And the third is just "your art lacks cohesion".
22:54
<&jerith>
The second is the original.
22:54
<&Derakon>
Yep.
22:55
<&Derakon>
The first is, I think, the most common usage these days.
22:55
<&Derakon>
Er, the third, but with people who think they mean the first.
22:56
<&jerith>
"Take a bunch of existing example or tutorial code, publish it as your own game for ~$10, rake in a few hundred (or maybe more) dollars for and afternoon of 'work'."
22:57
<&Derakon>
That sounds gratuitously optimistic.
22:57
<&Derakon>
Especially since it costs $100 to get a game out on Steam.
22:58
<&jerith>
I think the early asset flips predated that cost.
22:58
<&Derakon>
Ah, yes, they did.
22:58
<&jerith>
And when they weren't ubiquitous they suckered more people.
23:36 Kindamoody is now known as Kindamoody[zZz]
--- Log closed Thu Oct 24 00:00:39 2019
code logs -> 2019 -> Wed, 23 Oct 2019< code.20191022.log - code.20191024.log >

[ Latest log file ]