code logs -> 2014 -> Sun, 03 Aug 2014< code.20140802.log - code.20140804.log >
--- Log opened Sun Aug 03 00:00:35 2014
01:11 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
01:25 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
01:25 mode/#code [+o himi] by ChanServ
01:36 Ozzy is now known as Ozzy{Away}
01:42
<&McMartin>
Oof. Always kind of disheartening when Java is transparently the best tool for the job.
01:44
<~Vornicus>
:(
01:44
<~Vornicus>
What's the job?
01:51
<&ToxicFrog>
Java, or the JVM?
02:12
<&McMartin>
In this case, Java, because Clojure's treatment of raw arrays is garbage.
02:12
<&McMartin>
javax.imageio is great but very array-heavy
02:13 * McMartin is breaking up a monochrome PNG into a C64 bitmap,
02:14
<&McMartin>
Except instead of hacking like I was supposed to I just went and solved a bunch of DROD levels.
02:20
<~Vornicus>
My brother calls it "swordmangame"
02:20
<&ToxicFrog>
McMartin: I would say "Scala then" but I honestly have no idea what Scala's array handling is like
02:21 * McMartin adds JtRH 23L1N2W to his list of amazing levels.
02:21
<&McMartin>
TF: Yeah, but this is also a problem where C would be a natural choice except for the "I have a PNG, give me an array" part.
02:22
<&McMartin>
And the resulting code will look like that, being a single class with two methods, both static.
02:22
<&McMartin>
I think I'll have dinner before actually writing the code though.
02:30
<~Vornicus>
I'd have picked Python with Pillow, personally
02:31
<&McMartin>
Sure, there are plenty of libraries out there
02:31
<&McMartin>
But when it's two lines of Java with no additional dependencies that's about as good as you can get (one to load it, one to extract a subrectangle as an array)
02:32
<&McMartin>
The rest of the code is basically the same in all ALGOL-oids, and that's the preferable one here, hence why I'm not using Clojure.
02:32
<&Derakon>
ImageMagick to convert the PNG into an easily-parseable text file, Perl to parse the file and output the desired result, then ImageMagick to convert it back to PNG~
02:32
<&McMartin>
For building spritesheets and stuff it is in fact *all* closure.
02:32
<&McMartin>
Derakon: The desired end result is an assembler data block~
02:32
<&Derakon>
Perl can output that!
02:33
<&McMartin>
It can!
02:33
<&McMartin>
There's a lossless PNG-to-text format thing out there, too
02:33
<&McMartin>
Still more work than load("filename").getRGB(x, y, w, h, stride)
02:35
<&McMartin>
Also, I don't like my logo~
02:35
<&McMartin>
But it will do for a proof of concept.
02:35
<&Derakon>
What are you doing, generating DROD maps?
02:35
<&Derakon>
Oh wait, you said C64.
02:35
<&McMartin>
No, this is the C64 game I've been working on on-and-off
02:35
<&Derakon>
Porting DROD to said platform?
02:35
<&McMartin>
I'm working on the title screen.
02:36
<&Derakon>
Use the FLEET launch screen you made~
02:36
<&McMartin>
No, I have a very specific plan.
02:36
<&McMartin>
(viz, run an attract mode underneath the title, rendered as a bunch of sprites that are enough to form a banner across the whole screen)
02:36
<&McMartin>
(That gives me a 152x21 workspace, which I just rendered some text to to start with and then gave Gradius wings)
02:37
<&McMartin>
This is Coreflight, which was originally codenamed Zappy Bird.
02:37
<&Derakon>
Hee.
02:38
<&McMartin>
And it's not like tunnel racers are some new strange thing. I just want to add a "shoot stuff" element to one.
02:38
<&McMartin>
But the real thing here is "I want to be able to use Game Maker's sprite editor as a C64 sprite editor"
02:39
<&McMartin>
And I think I can do that in under 30 lines of Java code, so~
02:40
<&McMartin>
But, now, dinner
02:40
<&McMartin>
Then DVD on the desktop while hacking on the laptop
02:40
<&McMartin>
And then probably more JtRH
02:40
<&McMartin>
It's not inconceivable that I might manage to win the game this weekend, which would be great
02:43
<~Vornicus>
And then it's potentially on to The City Beneath, which is a little harder to name levels on~
02:44 Bosnia_man [Bosanac@Nightstar-b88.uje.39.212.IP] has joined #code
02:45 Bosnia_man [Bosanac@Nightstar-b88.uje.39.212.IP] has left #code []
02:50 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
03:02 gnolam_ [lenin@Nightstar-rhnl04.cust.bredbandsbolaget.se] has joined #code
03:02 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
03:02 mode/#code [+o himi] by ChanServ
03:04 gnolam [lenin@Nightstar-rhnl04.cust.bredbandsbolaget.se] has quit [Ping timeout: 121 seconds]
03:28
<&McMartin>
Heh
03:29
<&McMartin>
Definitely taking a break after JtRH to play other things
03:29
<&McMartin>
And I'm not sure if I want to do TCB as the next DROD or GatEB.
03:29
<~Vornicus>
(tcb is also Crazy Hard)
03:44 RchrdB [RichardB@Nightstar-qe9.aug.187.81.IP] has quit [Ping timeout: 121 seconds]
04:15 Harlow [harlow@Nightstar-9hnfdm.il.comcast.net] has joined #code
04:15 Kindamoody[zZz] is now known as Kindamoody
04:17
<&McMartin>
55 lines with error-checking. Time to add the compositor part.
04:22
<&McMartin>
Oops, OK, a little more logic here so I can convert images that aren't multiples of 24x21.
04:28
<&McMartin>
Success!
04:28
<&McMartin>
OK, it was 75 lines, not 50.
04:29
<&McMartin>
Looking promising.
04:30
< Harlow>
mcmartin what does this script do?
04:30
<&McMartin>
I give it a PNG. It turns that PNG into monochrome by treating all pixels with alpha >= 0x80 to solid and the rest as transparent
04:31
<&McMartin>
It then breaks it into 24x21 chunks and encodes them as row-major bitmaps, with a 0 at the end so each chunk is 64 bytes long
04:31
<&McMartin>
It then formats it as a series of .byte directives for an assembler.
04:31
<&McMartin>
So, what it does is takes a monochrome PNG, possibly anti-aliased, and turns it into data suitable for feeding to Commodore 64 hardware sprites. :D
04:31
< Harlow>
lol
04:32
<&McMartin>
And so this, more importantly, means I can now use any old paint program to do 8-bit spritework.
04:32
<~Vornicus>
might I recommend in the absence of alpha channel, using greyscale values instead
04:33
<&McMartin>
Well
04:33
<&McMartin>
I get to have alpha channel, so~
04:33
<&McMartin>
It would be *quite a bit* more work to try to handle color right.
04:34
<&McMartin>
Since I wrote this because I had one very specific image I wanted to create, I'm keeping it minimal for now.
04:34 Attilla [uid13723@Nightstar-ed0oqj.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity]
04:36 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
04:45
<&McMartin>
Man, 8-bit assembly programming.
04:45
<&McMartin>
"Well, I could compute where I want to put all these sprites"
04:45
<&McMartin>
"Or I could precompute it all and just produce an array that I blit directly into the video chip's register bank"
04:49
<&McMartin>
http://pastebin.starforge.co.uk/646
05:08
< Harlow>
java!
05:09
< Harlow>
McMartin: are you just working in java because its easier to program in or is there another reason?
05:39
<&McMartin>
Basically, because javax.imageio has exactly the functions I need to do this one thing.
05:39 Kindamoody is now known as Kindamoody|gaming
05:57 Kindamoody|gaming [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has quit [Connection closed]
05:58 Kindamoody|autojoin [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has joined #code
05:58 mode/#code [+o Kindamoody|autojoin] by ChanServ
06:08
< Harlow>
ah
06:09 Kindamoody|autojoin is now known as Kindamoody
06:21 Derakon is now known as Derakon[AFK]
06:35 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
06:48 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
06:48 mode/#code [+o himi] by ChanServ
06:49 Kindamoody is now known as Kindamoody|afk
07:00 Harlow [harlow@Nightstar-9hnfdm.il.comcast.net] has quit [[NS] Quit: BED]
07:34
<&McMartin>
OK, I definitely need a better logo, but the logo code totally works.
07:46
<&McMartin>
https://dl.dropboxusercontent.com/u/63644917/mapgen.prg
08:47 celticminstrel [celticminst@Nightstar-6pf18d.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
09:15 KiMo|autorejoin [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has joined #code
09:15 mode/#code [+o KiMo|autorejoin] by ChanServ
09:16 Kindamoody|afk [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has quit [Ping timeout: 121 seconds]
09:18 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
09:31 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
09:31 mode/#code [+o himi] by ChanServ
10:19 Attilla [uid13723@Nightstar-ed0oqj.irccloud.com] has joined #code
10:35 RchrdB [RichardB@Nightstar-qe9.aug.187.81.IP] has joined #code
10:35 mode/#code [+o RchrdB] by ChanServ
10:43 macdjord is now known as macdjord|slep
10:48 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
11:01 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
11:01 mode/#code [+o himi] by ChanServ
11:48 gnolam_ is now known as gnolam
11:48 mode/#code [+o gnolam] by ChanServ
12:14 Ozzy{Away} is now known as Ozzy
12:52 thalasleep [thalass@Nightstar-ueen89.bigpond.net.au] has joined #code
13:19 macdjord|slep [macdjord@Nightstar-7rac1r.mc.videotron.ca] has quit [Ping timeout: 121 seconds]
13:21 macdjord|slep [macdjord@Nightstar-7rac1r.mc.videotron.ca] has joined #code
13:21 mode/#code [+o macdjord|slep] by ChanServ
13:49 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
14:02 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
14:02 mode/#code [+o himi] by ChanServ
14:45 gnolam_ [lenin@Nightstar-rhnl04.cust.bredbandsbolaget.se] has joined #code
14:46 gnolam [lenin@Nightstar-rhnl04.cust.bredbandsbolaget.se] has quit [NickServ (RECOVER command used by gnolam_)]
14:46 gnolam_ is now known as gnolam
14:46 mode/#code [+o gnolam] by ChanServ
16:38 RchrdB [RichardB@Nightstar-qe9.aug.187.81.IP] has quit [Ping timeout: 121 seconds]
17:05 thalasleep [thalass@Nightstar-ueen89.bigpond.net.au] has quit [Operation timed out]
17:21 KiMo|autorejoin is now known as Kindamoody
17:36 celticminstrel [celticminst@Nightstar-6pf18d.dsl.bell.ca] has joined #code
17:36 mode/#code [+o celticminstrel] by ChanServ
18:02
<@Tarinaky>
Python: recommendations for a library for packing/unpacking data from text files (format is unimportant, but ideally not XML).
18:02
<@Tarinaky>
Pickle has arbitary code-execution issues.
18:02
<@Tarinaky>
So I'd like something less... intelligent...
18:36
<&ToxicFrog>
JSON?
18:41 RchrdB [RichardB@Nightstar-qe9.aug.187.81.IP] has joined #code
18:41 mode/#code [+o RchrdB] by ChanServ
19:16 Kindamoody is now known as Kindamoody[zZz]
19:25
<&jerith>
Tarinaky: JSON is in stdlib, but has all the limitations of JSON.
19:27
<&jerith>
YAML is somewhat nicer if you want stuff to be human-readable, but you need to use the safe versions of PyYAML's methods.
20:05 Derakon[AFK] is now known as Derakon
21:43
<@Tarinaky>
jerith: 'safe'?
21:43
<@Tarinaky>
ToxicFrog: That's a file format, not a library.
21:44
<&jerith>
Tarinaky: YAML supports serialising arbitrary objects (although that's less interoperable) and does so by default.
22:06 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
22:19 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
22:19 mode/#code [+o himi] by ChanServ
22:49
<&ToxicFrog>
Tamber: I assume that Python has a variety of effective JSON libraries.
22:50 * Tamber waves at Tarinaky, dispatches that reply to.
22:51
<@Tarinaky>
ToxicFrog: I'm struggling to find them without knowing their name.
22:56 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
23:03
<&jeroud>
Tarinaky: "json" in the stdlib.
23:04
<@Tarinaky>
okay
23:04
<&jeroud>
There's also "simplejson" if you need support for Python older than 2.6, but the author values performance over correctness.
23:06
<&jeroud>
(stdlib json is a slightly modified copy of simplejson that doesn't sometimes return bytes instead of unicode because of zOMGFAST!)
23:06
<&jeroud>
(Yes, I am somewhat bitter about that particular misfeature of simplejson.)
23:41 Lappy-Caboose [IceChat9@Nightstar-ago7bl.abhsia.telus.net] has quit [[NS] Quit: The early bird may get the worm, but the second mouse gets the cheese]
23:47 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
23:47 mode/#code [+o Checkmate] by ChanServ
--- Log closed Mon Aug 04 00:00:51 2014
code logs -> 2014 -> Sun, 03 Aug 2014< code.20140802.log - code.20140804.log >

[ Latest log file ]