code logs -> 2012 -> Mon, 24 Dec 2012< code.20121223.log - code.20121225.log >
--- Log opened Mon Dec 24 00:00:48 2012
00:01
<&McMartin>
But a better solution for this is some kind of source-to-source translator, especially if you're written in a scripting language like Python in the first place
00:01
<&McMartin>
For a compiled engine written in C++ or Java, embedding a scripting language and deferring to that at appropriate points is more the standard approach.
00:02
<&McMartin>
For C++, Lua and Python are the "obvious" choices; for Java, JavaScript is due to Rhino being part of the standard library.
00:02
<&McMartin>
(Lua meanwhile is designed for C/C++ integration, and a semi-standard library called boost::python handles Python/C++ integration pretty cleanly)
00:03
<&McMartin>
Given my own twisted perversions of design, for Shitloads Of Dialogue I would probably use some kind of XML file and then generate code from that
00:03
<&McMartin>
Since it's text heavy the XML silliness would stay enough out of the way to not be obnoxious, and I have several languages handy which are really good at XML processing (Python is one of these)
00:04
<&McMartin>
I would not want to put python code *in* the XML, though; I'd probably add a layer of indirection of some kind; probably some kind of string that could be sent to getattr() on an extensions object, yielding a callable method
00:08
<&McMartin>
Some of that is inertia from more restrictive languages, but you can use that as a gating mechanism to block code injection attacks as well.
00:11
<@froztbyte>
I should note that you probably wouldn't want it all in one XML file
00:11
<&McMartin>
Yeah, that too
00:11
<&McMartin>
On the plus side, XML files are not hard to programatically break apart
00:12
<@froztbyte>
unless you have pretty decent length prefixing and a stream processor
00:12
<&McMartin>
Well, this is dialogue for a game
00:12
<&McMartin>
You should not be seriously memory constrained
00:12
<&McMartin>
Unless you're including base64-encoded speech files in it.
00:12
<&McMartin>
(do not do this)
00:12
<@froztbyte>
haha
00:12
<@froztbyte>
(make it an option)
00:12
<&McMartin>
(then have it produce screenfuls of profanity if used)
00:13
<@froztbyte>
(yessssss)
00:13
<@froztbyte>
oh, also
00:13
<&McMartin>
(There should also be a switch to make the %n format string code do this)
00:13
<@froztbyte>
please for the love of all the elder gods don't use regexes to deal with any of the XML :P
00:13
<@froztbyte>
lxml and friends are good for you.
00:13
<&McMartin>
If you're in Python, xml.dom.minidom r0xx0rz the s0xx0rz and h4xx0rz the, uh, b4xx0rz?
00:14
<&McMartin>
Again assuming you can cram the whole document into your address space
00:14
<@froztbyte>
why that over lxml/etree?
00:14
<&McMartin>
Hm. From scratch, no a priori reason
00:14 ToxicFrog [tb@2D9871.281A35.826466.528736] has joined #code
00:14 mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ
00:14
<@froztbyte>
fair enough
00:14
<&McMartin>
If you'd already been using libxml2 for some reason, though, the constants and such are already familiar so you can (by which I mean I could) jump right in
00:15
<@froztbyte>
yeah that makes sense
00:15
<@froztbyte>
familiar ABIs, etc
00:15 * McMartin nods
00:16
<&McMartin>
And in practice it's always ended up getting me where I needed to go so fast that I got what I needed done finished before I could think of maybe trying a new system.
00:16
<&McMartin>
clojure/xml is fairly good except for some technically correct but practically disastrous stuff it inherits from Java's XML libraries
00:17
<@froztbyte>
haha
00:17
<@froztbyte>
clojure seems to be developing semi decently
00:17
<@froztbyte>
though I only see some commentary about it from outside now and then
00:18
<@froztbyte>
atm my main interests are in sharpening my python ability a lot more (since I write python sloooooooooooooooooooooowly, mostly due to lack of practice), and then getting moar haskell
00:20
< ErikMesoy|sleepless>
So now I'm considering how to make Python dialogue the most readable, assuming a big honking parser that it passes through on the way to the game
00:22
< ErikMesoy|sleepless>
http://pastie.org/5570363
00:23
< ErikMesoy|sleepless>
I'll call back on this a few months or years from now, I suppose. :-P
00:24 * McMartin nods
00:24
<&McMartin>
Obvious things missing here are the ability to selectively enable and disable choices.
00:25
< ErikMesoy|sleepless>
other than how conditional_choice would hypothetically work by only showing the choice if the condition is met?
00:25
<&McMartin>
Yeah
00:25
< ErikMesoy|sleepless>
Please explain.
00:25
<&McMartin>
Hm.
00:25
<&McMartin>
This is easier with an example, so: have you played The Secret of Monkey Island?
00:25
< ErikMesoy|sleepless>
Not personally, but I have osmosed about half the content. :p
00:26
<&McMartin>
Heh
00:26
<&McMartin>
OK, any graphic adventures from that general era
00:26
<&McMartin>
Anyway, it had menus like this
00:26
<&McMartin>
Depending on the kind of conversation, you could have two kinds of menu shifts
00:27
<&McMartin>
There's what you've written here, where followup questions have to be taken immediately...
00:27
<&McMartin>
... and then there's a mechanism where followup questions get folded or spliced into ConversationMain
00:28
<&McMartin>
I had mentioned phtalkoo.h in the past.
00:29
< ErikMesoy|sleepless>
Right. Well, that's *doable* by having ConversationMain have a lot of conditional_choice(question in ListOfFollowups), but that's clunky and I see why you'd want a separate explicit function for this sort of thing
00:29
<&McMartin>
Yeah
00:29
<&McMartin>
Traditionally, that separate explicit function was actually *all you had* - the notion of conversation nodes was a later innovation
00:29
<&McMartin>
http://inform7.com/extensions/Michael%20Martin/Quip-Based%20Conversation/doc_5.h tml
00:30
<&McMartin>
In this library, "deliver the ___ quip" is "force choice X, even if it's not available", "run a conversation on ________" is "go to conversation node ______", and choices autodisable when selected unless forced otherwise.
00:31
<&McMartin>
(Redesigning the API for this has been on my list of things to do for years)
00:32
<&McMartin>
(Inform 7 allows you to invoke code from *inside strings as print statements*, and this can be used to drastically streamline much of the code)
00:33 * ErikMesoy|sleepless is learning programming through rediscovering the wheel! :D
00:33
<&McMartin>
It's a good way to do it
00:33
<&McMartin>
I'm the old codger on the porch with the rocking chair and the shotgun who reads the history books
00:33
<@Tamber>
And the mined front lawn.
00:33
<&McMartin>
(I am, after all, only 34)
00:33
<&McMartin>
I can't mine the front lawn, how will the deliveryman bring me my pie
00:34
<&McMartin>
Priorities, people!
00:34
<@Tamber>
:)
00:34
<&McMartin>
Speaking of histories, I had lots of fun with this book: https://mitpress.mit.edu/books/racing-beam
00:35 AbuDhabi [annodomini@Nightstar-dc07a91d.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
00:37
<&McMartin>
The early programmers were goddamned madmen
00:37
<@Tamber>
They had to be, though~
00:37
<&McMartin>
Well, yes
00:37
<&McMartin>
But that they succeeded at things is still kind of astounding
00:38
<&McMartin>
That book traces the evolution of some of the techniques, and shows how constraints influenced and sometimes improved the designs.
00:38
<&McMartin>
It's fun
00:38 You're now known as TheWatcher[T-2]
00:38
< ErikMesoy|sleepless>
Reminds me of the running gag about Sidereals in Exalted: "You have a cat, a lump of silly putty, and the favor of the Prince of Denmark. Your job is to get these twenty nails hammered in. You have 28 minutes."
00:39
<&McMartin>
Heh
00:39
< ErikMesoy|sleepless>
I gather early programming was about that restricted, although the constraints weren't quite as humorous.
00:39
<&McMartin>
Yeah, so, the Atari 2600 had 4KB ROM and 128 bytes of RAM
00:39
<&McMartin>
Which is a thing on its own, but it also didn't have any video processing to speak of
00:39
<&McMartin>
So you had to manually throw VBLANKs
00:39
<&McMartin>
There *was* a timing register that was basically "wait for HBLANK to stark"
00:40
<&McMartin>
"Sprites" were one scanline long, and locked in place (so your processing speed determined your vertical resolution)
00:40
<&McMartin>
To place a sprite, there was a register you would write to. That register was "put the sprite where the electron gun is *right now*"
00:41
<&McMartin>
So X-positioning of sprites on the 2600 required cyclecounting
00:41 You're now known as TheWatcher[zZzZ]
00:41
<&McMartin>
(One placed, it stuck, so you could then move it relatively, but there was artifacting unless you only did this between frames)
01:39 McMartin is now known as McM|travails
01:58 Thalass [thalass@Nightstar-724ec5eb.bigpond.net.au] has quit [[NS] Quit: Leaving]
02:03 thalass [thalass@Nightstar-724ec5eb.bigpond.net.au] has joined #code
02:03 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code
02:22 thalass [thalass@Nightstar-724ec5eb.bigpond.net.au] has quit [Ping timeout: 121 seconds]
02:38
< Vornotron>
"Hey, princey. Know a crazy caprenter? I can pay in cat.
02:42 thalass [thalass@Nightstar-724ec5eb.bigpond.net.au] has joined #code
02:51 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: night all]
03:03 himi-cat [himi@Nightstar-5d05bada.internode.on.net] has joined #code
03:07
<&McM|travails>
wat
03:22
< Vornotron>
You get the prince to find you a carpenter who will accept a cat as payment for hammering nails.
03:22
< Vornotron>
Obviously
03:22
<&McM|travails>
That is science, but I cannot see to what end
03:24
< Vornotron>
ErikMesoy's thing up there
03:25
<&McM|travails>
Ah, yes, I see
03:30 Kindamoody[zZz] is now known as Kindamoody
03:37 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
03:37 mode/#code [+qo Vornicus Vornicus] by ChanServ
03:40 Vornotron [vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
04:20 ToxicFrog [tb@2D9871.281A35.826466.528736] has quit [Client closed the connection]
04:58 ToxicFrog [ben@2D9871.281A35.826466.528736] has joined #code
04:58 mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ
05:39 iospace is now known as iospacedout
05:57 McM|travails [mcmartin@Nightstar-8eef3929.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds]
05:59 McM|travails [mcmartin@Nightstar-2934636f.pltn13.sbcglobal.net] has joined #code
06:03 McM|travails [mcmartin@Nightstar-2934636f.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds]
06:04 McM|travails [mcmartin@Nightstar-2934636f.pltn13.sbcglobal.net] has joined #code
06:09 McM|travails [mcmartin@Nightstar-2934636f.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds]
06:16 McM|travails [mcmartin@Nightstar-3a78275c.pltn13.sbcglobal.net] has joined #code
06:31 McM|travails [mcmartin@Nightstar-3a78275c.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds]
06:33 McM|travails [mcmartin@Nightstar-a5fb2cfc.pltn13.sbcglobal.net] has joined #code
06:38 thalass [thalass@Nightstar-724ec5eb.bigpond.net.au] has quit [Ping timeout: 121 seconds]
06:49 McM|travails [mcmartin@Nightstar-a5fb2cfc.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds]
06:56 McM|travails [mcmartin@Nightstar-479d9015.pltn13.sbcglobal.net] has joined #code
07:00 thalass [thalass@Nightstar-724ec5eb.bigpond.net.au] has joined #code
07:21 ErikMesoy|sleepless is now known as ErikMesoy
07:32 thalass is now known as Thalaway
07:36 Thalaway [thalass@Nightstar-724ec5eb.bigpond.net.au] has quit [Ping timeout: 121 seconds]
07:39 Reiv [Reiver@Nightstar-6ca59a6f.callplus.net.nz] has joined #code
07:39 mode/#code [+o Reiv] by ChanServ
07:41 syksleep is now known as Syk
07:56 AbuDhabi [annodomini@Nightstar-48c4fba4.adsl.tpnet.pl] has joined #code
09:25 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has left #code ["Leaving"]
09:28 Attilla_ [Obsolete@Nightstar-9e7fa2b2.range86-162.btcentralplus.com] has joined #code
09:30 Attilla [Obsolete@Nightstar-9e7fa2b2.range86-162.btcentralplus.com] has quit [Ping timeout: 121 seconds]
09:40 Attilla_ is now known as Attilla
09:52 RichyB [richardb@Nightstar-8cf58535.in-addr.btopenworld.com] has joined #code
10:16 You're now known as TheWatcher
10:34 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: ]
10:46 ReivDriod [Reiver@5B433A.3CF6C7.4F3A2C.475A74] has joined #code
10:47 Reivles [Reiver@Nightstar-6ca59a6f.callplus.net.nz] has joined #code
10:47 Reiv [Reiver@Nightstar-6ca59a6f.callplus.net.nz] has quit [Client closed the connection]
10:50 ReivDriod [Reiver@5B433A.3CF6C7.4F3A2C.475A74] has quit [Ping timeout: 121 seconds]
11:25 Reivles [Reiver@Nightstar-6ca59a6f.callplus.net.nz] has quit [Ping timeout: 121 seconds]
11:33 gnolam [lenin@Nightstar-0fcc80a0.tbcn.telia.com] has joined #code
11:33 gnolam [lenin@Nightstar-0fcc80a0.tbcn.telia.com] has quit [Client closed the connection]
11:39 Reiv [Reiver@Nightstar-6ca59a6f.callplus.net.nz] has joined #code
11:39 mode/#code [+o Reiv] by ChanServ
11:43 Reiv [Reiver@Nightstar-6ca59a6f.callplus.net.nz] has quit [Ping timeout: 121 seconds]
11:52
< ErikMesoy>
I want to google and RTFM something. What's the proper name for the subject of when the GUI should call the UI with GiveMeNextButtons(ChosenButton) as opposed to the UI calling the GUI with ShowAndGetUserChoice(ButtonChoices) ?
11:55
< AbuDhabi>
Focus? I dunno.
12:16 Kindamoody is now known as Kindamoody|out
12:56 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
12:56 RichyB [richardb@Nightstar-8cf58535.in-addr.btopenworld.com] has quit [[NS] Quit: Leaving]
13:25 Netsplit *.net <-> *.split quits: @Rhamphoryncus, Xon, @jerith, @simon`, @Azash, @PinkFreud, @rms
13:27 Netsplit over, joins: @PinkFreud, &jerith, @simon`, @Rhamphoryncus, @Azash, @rms, Xon
13:36 Netsplit *.net <-> *.split quits: @Rhamphoryncus, Xon, @jerith, @simon`, @Azash, @PinkFreud, @rms
13:36 Thalass [thalass@Nightstar-724ec5eb.bigpond.net.au] has joined #code
13:39 PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code
13:39 simon` [simon@Nightstar-fe311ff3.pronoia.dk] has joined #code
13:39 Rhamphoryncus [rhamph@Nightstar-cc6253d6.abhsia.telus.net] has joined #code
13:39 jerith [jerith@ServerAdministrator.Nightstar.Net] has joined #code
13:39 Azash [ap@Nightstar-339920e6.net] has joined #code
13:39 rms [rstamer@genoce.org] has joined #code
13:39 Xon [Xon@Nightstar-362effcc.highway1.net.au] has joined #code
13:39 ServerMode/#code [+oooaooo PinkFreud simon` Rhamphoryncus jerith jerith Azash rms] by *.Nightstar.Net
15:53 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
16:07 iospacedout is now known as iospace
16:17 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
16:17 mode/#code [+o himi] by ChanServ
16:24 ToxicFrog [ben@2D9871.281A35.826466.528736] has quit [Ping timeout: 121 seconds]
16:29 ToxicFrog [ben@2D9871.281A35.826466.528736] has joined #code
16:35 ToxicFrog [ben@2D9871.281A35.826466.528736] has quit [Ping timeout: 121 seconds]
16:40 ToxicFrog [ben@Nightstar-be32113b.cable.teksavvy.com] has joined #code
16:40 mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ
19:06 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
19:06 mode/#code [+qo Vornicus Vornicus] by ChanServ
19:11 Vash [Vash@Nightstar-221158c7.sd.cox.net] has joined #code
19:11 mode/#code [+o Vash] by ChanServ
19:33
< AbuDhabi>
I have an argument that takes an integer pointer. Can I pass an array there like {1,2,3} there?
19:35
<@Tamber>
C?
19:35
< AbuDhabi>
Yes.
19:36
<@Tamber>
I ...think so, yes; but it'll only access the first element.
19:36
<@Tamber>
I could be wrong, it happens a lot.
19:37
< AbuDhabi>
I am presuming the argument actually wants an array. It's not 100% clear from the documentation.
19:40
<@Tamber>
Well, an array *is* just a bit of gloss on pointers.
19:40
<@Tamber>
Will anything break if you try it and see what happens?
19:41
< AbuDhabi>
Apparently it breaks on trying to convert int* to Sint16*.
19:41
<@Tamber>
Hm.
19:41 * AbuDhabi makes actual arrays of Sint16s.
19:44 * AbuDhabi is making units!
19:45
< AbuDhabi>
So far there are like nearly 200k types of units!
19:45
< ErikMesoy>
"types" as in?
19:46
< AbuDhabi>
I have sixteen unit property flags. Each combination counts as a different unit.
19:46
< ErikMesoy>
Aha.
19:46
< AbuDhabi>
I am presently figuring out how to properly have them displayed using a modified NATO symbology.
19:46 * ErikMesoy is making containers.
19:46 * AbuDhabi breaks the pot!
19:46
< ErikMesoy>
I have been storing dialogue in dicts of {dialogue option:branch it leads to} but want to tweak this so that Yes/No questions don't show as No/Yes.
19:46 Scoot [Scoot@Nightstar-29777108.sd.cox.net] has left #code []
19:49 * AbuDhabi walks around with a flying AA engineer unit.
19:49
< ErikMesoy>
Are you going for SMAC's "two flags per unit" limit, or a huge table of what is and isn't compatible with other flags, or something else?
19:50
< AbuDhabi>
Probably limits in the designer to unselect incompatible things.
19:50
< AbuDhabi>
Though I don't really foresee much problems with that. After all, MoO managed pretty well without arbitrary restrictions.
19:50
< AbuDhabi>
You just had to mind the cost/space.
19:50
< ErikMesoy>
That had three flags per unit.
19:51
< AbuDhabi>
I blame that on early programming. :P
19:52
< AbuDhabi>
I don't see why you can't have flying settler-engineers with artillery, rockets and nuclear weapons.
20:04 Kindamoody|out is now known as Kindamoody
20:09
< AbuDhabi>
http://i48.tinypic.com/2aenf2u.jpg
20:09
< AbuDhabi>
This is an air-defence boat.
20:11 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code
20:23
<@Tarinaky>
ErikMesoy: Use a list of tuples?
20:24
<@Tarinaky>
[("Yes", graphNodeYes), ("No", graphNodeNo)]
20:25
<@Tarinaky>
The user then selects either 0 or 1 - refering to the index of the element in the list.
20:28
< ErikMesoy>
Tarinaky: That makes it hard to call by key.
20:29
<@Tarinaky>
You shouldn't be using the dialogue itself as a key.
20:29
< ErikMesoy>
If I have options=[("Yes", graphNodeYes), ("No", graphNodeNo)], then options["Yes"] is invalid.
20:29
<@Tarinaky>
options[0] is valid.
20:29
< ErikMesoy>
I'm currently actually using two sets of dictionaries
20:30
< ErikMesoy>
One maps option numbers to option labels, the other maps option labels to dialogue branches.
20:30
< ErikMesoy>
This is already a sign that I need something other than a dict, possibly involving triples, but the key-call of dicts is very convenient.
20:30
< ErikMesoy>
So I'm reading about container types and considering rolling my own.
20:58
< ErikMesoy>
Meh. A list of 2-tuples it is.
20:59
<@Azash>
No key-value data structures?
21:01
< ErikMesoy>
They'd need a search anyway; I might as well put one on the list, I think
21:09 Kindamoody is now known as Kindamoody[zZz]
21:27
< ErikMesoy>
Mehblahblahgrumble
21:28
< AbuDhabi>
ErikMesoy: A PROTIP, if you will. Leave hints for Future Erik.
21:33
< ErikMesoy>
Yeah, but I'm not seeing any I need to leave just yet
21:33
< ErikMesoy>
So far my sister can understand the code from reading it. :p
21:36 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has quit [[NS] Quit: This computer has gone to sleep]
21:45 Syk is now known as syksleep
22:43 thalass_ [thalass@Nightstar-724ec5eb.bigpond.net.au] has joined #code
22:56 AbuDhabi_ [annodomini@Nightstar-9cf11b9c.adsl.tpnet.pl] has joined #code
22:58 AbuDhabi [annodomini@Nightstar-48c4fba4.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
23:11 ToxicFrog [ben@Nightstar-be32113b.cable.teksavvy.com] has quit [Ping timeout: 121 seconds]
23:14 ToxicFrog [ben@2D9871.281A35.826466.528736] has joined #code
23:16 AbuDhabi_ [annodomini@Nightstar-9cf11b9c.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds]
23:45 himi-cat [himi@Nightstar-5d05bada.internode.on.net] has quit [Client closed the connection]
--- Log closed Tue Dec 25 00:00:03 2012
code logs -> 2012 -> Mon, 24 Dec 2012< code.20121223.log - code.20121225.log >

[ Latest log file ]