code logs -> 2012 -> Thu, 16 Feb 2012< code.20120215.log - code.20120217.log >
--- Log opened Thu Feb 16 00:00:48 2012
00:08 You're now known as TheWatcher[T-2]
00:11 You're now known as TheWatcher[zZzZ]
00:14 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
02:03 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Need to reboot. Might as well shut it down for the night.]
02:05 * Eri shuffles home, after having spent six hours installing ubuntu 11 on an pentium II celeron
02:06
<@Eri>
*a
02:06
<@Eri>
It only takes 11 minutes to turn on. I timed it
02:07
<@Alek>
lol
02:07
<&McMartin>
That's a bummer
02:07
<&McMartin>
Ubuntu usually does lots of boot cheats
02:07
<&McMartin>
And I used to run Fedora Core 3 on a Celeron.
02:07
<&McMartin>
Omicron was a great system.
02:07
<&McMartin>
It had a Voodoo 3!
02:12
<@Eri>
So, I have no formal programming training. Is there a way for me to me to communicate between two different programs, in C? One of them may be a child process of the other.
02:12 Stalker [Z@Nightstar-5aa18eaf.balk.dk] has quit [Ping timeout: 121 seconds]
02:14
<&Derakon>
Sockets.
02:15
< RichyB>
Lots. Pipes, sockets, reading and writing to the same file
02:16
< RichyB>
shared memory, message queues, signals.
02:16
<&Derakon>
Note that sockets basically are files.
02:16
< RichyB>
There are more solutions to the problem "how do I make these two programs talk to each other?" than there are satisfactory methods of heating custard.
02:17
<@Eri>
.... are there many satisfactory ways to heat custard?
02:17
< RichyB>
Eri, the quick rule of thumb is, when in doubt, use TCP sockets.
02:17
< RichyB>
Lots.
02:17
< RichyB>
or pipes.
02:17
< RichyB>
Lemme rephrase that. ;)
02:17
<@Eri>
'Kay, I'll start researching along these lines.
02:17
< RichyB>
Eri, for data flow in only one direction, use a pipe.
02:17
<&Derakon>
For bidirectional, use two pipes? :)
02:17
< RichyB>
For more complicated data flow, use TCP or a Unix socket. The APIs for both of those are very nearly identical.
02:18
< RichyB>
That's a rule of thumb. One day you will run into a situation where you're better off using something else instead.
02:18
<&McMartin>
Unix domain sockets, of course, only actually work on Unix-based systems. However, the Windows version of Named Pipes are roughly equivalent to domain sockets in Unix.
02:18
<&Derakon>
Ooh, you could embed Python into your programs and use Pyro for communications.
02:19
< RichyB>
Derakon, no.
02:19
<&McMartin>
(Unix named pipes - fifos - are terrible and AFAICT nobody uses them ever)
02:20
<@Namegduf>
None of these solutions are sufficiently complicated to be enterprise-ready. You should use CORBA.
02:20
<@Namegduf>
:D
02:20
< RichyB>
McMartin, I use them for a couple things. I have mpd set up to send audio to a named pipe which I use JustePort to send to an apple Airtunes device. Kind of an unusual thing to do. :)
02:20
<@Eri>
Ah, sorry, not enterprise
02:20
<@Eri>
It's for a project. I'm with the university team, designing a satellite, and I need to design a groundstation.
02:21
<@Eri>
So, We're using GNU radio, some other stuff. Need to make some kind of a communication framework between them
02:21
< RichyB>
It'd help if we knew what programming languages or environments you're working in.
02:21
<&McMartin>
He did mention C, which makes the environment much more important
02:21
<@Eri>
Ah, sorry. It's gonna be on ubuntu, most likely in C
02:22
< RichyB>
McMartin, I missed that.
02:22
<&McMartin>
If you can get away with nothing but popen, you'll be happy
02:22
< RichyB>
There are a bunch of interprocess communication libraries that are more *convenient* than raw sockets, but only if you happen to be using the language that they're already written in.
02:23
<&McMartin>
"One of them may be a child process of the other."
02:24
<&McMartin>
If one of them is *always* a child process of the other, pipes are the traditional way to do this.
02:24
<@Eri>
I could make them child processes by having one controlling program that spawns off everything else.
02:24
<@Eri>
Err, that spawns everything else.
02:25
<@Eri>
That has the benefit of making everything modular, where each program communicates with me and me only
02:25
<@Eri>
And I choose what goes where
02:26
<&McMartin>
That said, getting bidirectional with that is tricky in C, though there is probably a spell for it.
02:27
<@Eri>
What are the C tcp libraries?
02:27
<&McMartin>
None standard
02:27
<&McMartin>
You'll need to find what Ubuntu uses
02:27
< RichyB>
McMartin, uh?
02:27
< RichyB>
Really? Berkely sockets is standard in every Unix since forever.
02:28
<&McMartin>
RichyB: Sure, but that's not going to show up in man 3
02:28
<&McMartin>
Or tutorials about the language.
02:28
<&McMartin>
There is no C equivalent of java.net.* package, is what I'm getting at here
02:28
< RichyB>
and Winsock is an implementation of Berkely sockets on Windows which has been in Windows since Windows had TCP at all
02:29
<&McMartin>
Actually, Winsock has either gone away entirely or been submerged since Win2k~
02:29
<&McMartin>
NT presents the stock interface
02:29
<&McMartin>
But yeah
02:29
< RichyB>
http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html
02:29
<&McMartin>
However, you have to research "how to use sockets in C", not look through the C stdlib.
02:29
< RichyB>
^- that is the standard tutorial for "how do I use TCP sockets in C?"
02:30
<@Eri>
Cool. Beats Wikipedia, for that
02:30
<&McMartin>
That said
02:30
<&McMartin>
Don't Install Cygwin
02:30
< RichyB>
Oh aye.
02:30
< RichyB>
McMartin, fair enough. I blame C for not having any namespacing at all.
02:30
<&McMartin>
Cygwin is a security blanket for people who get hives if everything isn't Unix in some way.
02:30
< RichyB>
Mm.
02:30
< RichyB>
If you think you want Cygwin, install Colinux or Wubi instea.d
02:31
<&McMartin>
Alternately, if you want to have a POSIX compatibility layer for Windows-targeted development that other people will use, install MSYS and MinGW.
02:31
<&McMartin>
But yeah
02:31
< RichyB>
Colinux is Linux running concurrently with Windows (it's quite trippy), Wubi is Ubuntu installed alongside Windows without having to reformat your hard disk.
02:32
< RichyB>
Or better yet fire up Ubuntu in a virtual machine.
02:32
< RichyB>
because that presents significantly less insanity than Colinux.
02:32
<&McMartin>
And MSYS is the unix toolkit compiled to be Windows native, and MinGW is the development toolchain hosted by and targeting native Windows.
02:32
<&McMartin>
Cygwin is this horrible monstrosity that tries to be More Than MSYS by introducing DLL Hell into every application in the universe.
02:34
<&McMartin>
Most of this is because they're desperate to have fork() available even though they never use it or invariably exec() right after it, thus making it exactly equivalent to CreateProcess().
02:40 Kindamoody[zZz] is now known as Kindamoody
02:42 Attilla [Obsolete@Nightstar-9ecc7891.as43234.net] has quit [Ping timeout: 121 seconds]
02:44
<&McMartin>
This article is good stuff
02:44 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
02:45
< RichyB>
McMartin, Beej's? I think someone at university recommended it to me.
02:46
< RichyB>
AIUI it's widely considered to be The Standard C Sockets Tutorial.
02:48
<&McMartin>
Yeah, and it's pretty clear why
02:49
<&McMartin>
Most of my C networking experience is restricted to trying to make libcurl do what I want
02:49
<@Eri>
So, using tcp, each program should have a socket listening to a specific port, and I send data to the local loopback, with the relevant port?
02:50
< RichyB>
Eri, you open connections to the loopback.
02:50
< RichyB>
So, yes.
02:51
<@Eri>
Cool. That makes sense. Without getting too deep into the guide so far, it doesn't sound like it'll be a nightmare
02:51
< RichyB>
Not all programs are necessarily going to be listening for connections. It's fairly common to have some processes listen for connections and others only make connections.
02:53
<&McMartin>
Domain sockets are even nicer, because they don't require a network interface of any kind, not even the loopback.
02:53
<&McMartin>
However, they're less portable
02:53
<&McMartin>
On the plus side, they freak out antimalware scanners less~
02:53
< RichyB>
Easiest way to keep it all straight in your head is, servers start out with socket() bind() listen(), then their main loop is accept(), send() and recv() intermixed, close() and back to the start again.
02:53 * McMartin shoryukens the ones that were convinced Python was up to no good
02:53
< RichyB>
Clients just go socket() connect(), then send() and recv() intermixed, then close().
02:55
<&McMartin>
Also, given what you were saying before
02:56
<&McMartin>
Section 7.2 has a sample program that is "clients talk to master program, master program echoes to all clients"
02:56
<&McMartin>
That sounds a whole lot like your use case
02:56
<@Eri>
I'll skip ahead to it
02:57
< RichyB>
McMartin, imho the nice thing about using tcp by default is that, when you decide that you want to take your single-machine system and distribute the components of it over several machines, it works.
02:58
<&McMartin>
Yup
02:58
<&McMartin>
Eri: It kind of assumes you're familiar with the rest, you'll want to then skip back.
02:58
< RichyB>
McMartin, at some point, I recommend that you look at zeromq.
03:00
< RichyB>
I'm not sure when is the most pedagogically-appropriate time to introduce something like that to a networking student.
03:00
<&McMartin>
... neither am I, since I would be coming it at as a distributed programmer expert~
03:01
<&McMartin>
s/expert/journeyman/
03:17
< maoranma>
s/journeyman/illustrious grand master
03:17 * McMartin reduces all the maps
03:20 eckse [eckse@Nightstar-79175eee.dsl.sentex.ca] has joined #code
03:20 mode/#code [+o eckse] by ChanServ
03:46 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
03:47
< maoranma>
Hmm, someone ported dumbfrotz to the Kindle
03:48
<&McMartin>
Dumbfrotz is pretty portable
03:49
< maoranma>
is it a decent terp though?
03:49
< maoranma>
The only thing I don't like about iplayif.com is the saving scheme
03:50
<&McMartin>
Hm
03:50
<&McMartin>
I consider WinFrotz to be The Standard
03:50
<&McMartin>
It really depends on which settings they put into dumbfrotz
03:50
< maoranma>
I see
03:50
<&McMartin>
And in particular if they allocate more than the default 1KB for stack.
03:51
<&McMartin>
Most modern IF needs more than 1KB to run its logic.
04:21 * Vornicus should really actually work on one of these things that he's got in his programming stack.
04:21
< maoranma>
http://www.geekosystem.com/worlds-smallest-chameleon/ IT IS SOO WITTLE
04:26 iospace [Alexandria@Nightstar-635d16fc.org] has quit [Ping timeout: 121 seconds]
04:35 iospace [Alexandria@Nightstar-635d16fc.org] has joined #code
04:55 Kindamoody is now known as Kindamoody|breakfast
05:31 Kindamoody|breakfast is now known as Kindamoody
05:46 * ToxicFrog upreads
05:47
<@ToxicFrog>
Cygwin is, in fact, Fucking Sweet
05:47
<@ToxicFrog>
But more as a usage environment than a platform target.
05:48
<@ToxicFrog>
Also, one of the googlers I correspond with may have convinced me to implement Spellcast in Haskell, possibly using Protocol Buffers for the networking.
06:06 eckse [eckse@Nightstar-79175eee.dsl.sentex.ca] has quit [Client closed the connection]
06:38 Derakon is now known as Derakon[AFK]
07:00 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Client closed the connection]
07:10 You're now known as TheWatcher
07:34 Vash [Vash@Nightstar-cdeba41f.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
08:01 You're now known as TheWatcher[afk]
08:02 Kindamoody is now known as Kindamoody|afk
08:10 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
08:23 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
08:43 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has joined #code
08:45 cpux|2 [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
08:47 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
09:12 Attilla [Obsolete@Nightstar-9ecc7891.as43234.net] has joined #code
10:13 Stalker [Z@Nightstar-5aa18eaf.balk.dk] has joined #code
10:17 You're now known as TheWatcher
10:56
< Rhamphoryncus>
"Do you maintain X?" "Don't ask to ask, just ask!" "*asks*" "I dunno, check the bug tracker."
11:39 You're now known as TheWatcher[d00m]
11:57 Kindamoody|afk is now known as Kindamoody
12:05 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has joined #code
12:21
< Rhamphoryncus>
My timetabling algorithm has a flaw :(
12:23
< Rhamphoryncus>
If your departure window has hit the next stop before you arrive at the current stop then it will do some skipping to resync the vehicles. However, if you're just short of that and there's enough slack overall then you can have all vehicles wait at one order in the list, then when released they race around moderately late and finally get back to that one stop again
12:24 * Rhamphoryncus enters grumble mode as this is leading him to a redesign, not a tweak or bugfix
12:27
< Rhamphoryncus>
ironically, back to my solution of a couple years ago. Back then I had a bodge that treated each station independently, constantly tweaking the departure interval up or down based on how early or late vehicles arrived relative to it. Ugly, but effective.
12:28
< Rhamphoryncus>
My modern take would have fixed intervals but have the chance of skipping one go up or down based on how often they're late.
12:37
< RichyB>
You should *expect* catastrophic failure modes.
12:37
< RichyB>
You're trying to set the behaviour of an anthill by programming the individual ants. That's difficult.
12:37
< RichyB>
(and fun)
12:38
< RichyB>
Rhamphoryncus, that sounds like a good idea to me. Then the probability of hitting the same stop twice in a row becomes arbitrarily small as the loop grows more stops. :)
12:38
< Rhamphoryncus>
Oh, I have been expecting catastrophic failure
12:39
< Rhamphoryncus>
this version is MUCH better than the other alternatives I considered
12:39
< Rhamphoryncus>
Just with one significant flaw
12:39
< RichyB>
Namely?
12:39
< Rhamphoryncus>
Actually, it's quite likely to have multiple vehicles hit the same stop in a row
12:40
< RichyB>
Er, opposite condition.
12:40
< Rhamphoryncus>
the flaw is what I mentioned. The resync mechanism isn't robust enough.
12:40
< RichyB>
The thing that is vanishingly unlikely is for one vehicle to go all the way around the loop without hitting any stops.
12:40
< RichyB>
^- that's what I was referring to as vanishingly unlikely.
12:41
< Rhamphoryncus>
It's quite likely. The requirement is wide, evenly spaced stops. Having just one area where two stops are right near each other would make it *eager* to skip there
12:42
< Rhamphoryncus>
If you assume normal deviation is 20% then a 1:1 ratio will never hit it while a 5:1 ratio will regularly hit it
12:43
< Rhamphoryncus>
IOW, the spacing on A-B is 10 days but B-C is 2 days. 20% on the A-B leg will cause you to be late for C when you hit B
12:50
< Rhamphoryncus>
To backtrack a moment, the problem here is this is NOT a catastrophic failure. It is a consistently small failure. Anything more significant would cause a resync.
12:53
< Rhamphoryncus>
In particular, a breakdown, adding/removing vehicles, or manually skipping orders would be handled.
12:53
< RichyB>
I don't remember the problem/goal statement here well enough to participate meaningfully in this conversation.
12:53
< Rhamphoryncus>
RichyB: timetabling in openttd
12:54
< RichyB>
So what I've got in my head is, I have 40 buses and 80 bus stations on a giant ring road
12:54
< Rhamphoryncus>
Yup
12:54
< RichyB>
and buses sometimes break down and they run at different speeds because I don't replace them all in one go when the new ones come out
12:54
< Rhamphoryncus>
Although the other ratio is more likely. 200 buses, 5 stations (large and widely spaced).
12:55
< RichyB>
okay, that's a different problem
12:55
< Rhamphoryncus>
Mostly you do replace them all at once
12:55
< RichyB>
80 stations and 40 buses is a different problem because it means that you want the network to tune itself to the fact that some stations generate more passengers than others
12:56
< Rhamphoryncus>
I'm deliberately not including any self-tuning. The timings are fixed.
12:56
< RichyB>
whereas with 200 buses on 5 stations, your only goal is for everyone to get one bus every five minutes?
12:56
< Rhamphoryncus>
yup
12:58
< RichyB>
So when does each bus make its next routing decision?
12:59
< RichyB>
I assume that it's not on every frame because that could be expensive.
13:00
< Rhamphoryncus>
They don't pick stations. They go through in order.
13:01
< Rhamphoryncus>
I only control when it leaves the station.
13:03
< Rhamphoryncus>
ergh. Constant prefixes used in just the saveload code include: CH_, OC_, OCL_, REF_, SGT_, SL_, SLE_, SLEG_, SLF_
13:04
< RichyB>
So your possible outputs are leave immediately without loading/unloading; load/unload then leave; load/unload and then wait for n seconds, then leave. }
13:04
< RichyB>
?
13:04
< Rhamphoryncus>
Just ranting about code structure :P
13:05
< RichyB>
(or wait for n seconds then leave without loading/unloading, but that seems wasteful)
13:05
< Rhamphoryncus>
Nope, don't skip loading/unload. Just "leave as soon as finished loading/unloading" or "wait n seconds while loading/unloading"
13:05
<@Tamber>
Missing the most important prefixes: WTF_, HACKS_, BS_, and RUN_AWAY_
13:07
< Rhamphoryncus>
They're in the rest of the code base
13:07
<@Tamber>
Aha.
13:07
< Rhamphoryncus>
total count: 11000
13:07
< Rhamphoryncus>
(constants, not just prefixes.)
13:07 * RichyB is perfectly sympathetic to things like: enum train_T { TRAIN_FOO, TRAIN_BAR, TRAIN_BAZ };
13:08
< RichyB>
er no, _t is bad.
13:08
<@Tamber>
train_coffee?
13:08
< Rhamphoryncus>
RichyB: in principle I am. However, having experienced this codebase.. OMFG. :P
13:08
< RichyB>
Identifiers ending with _t are supposed to be reserved for use by the C compiler.
13:08
< RichyB>
Yeah, it doesn't have a great reputation.
13:09
< Rhamphoryncus>
The reputation is not helped by my ranting in here ;)
13:09
< RichyB>
My boss plays TTD a lot and is getting into modding it
13:09
< RichyB>
and his opinion is that pretty much the entire TTD community (both OpenTTD and the TTDPatch) has Asperger's.
13:10
< Rhamphoryncus>
Hey, I have aspergers too :P
13:10
< RichyB>
Not that that makes them bad people or anything but it helps keep things interesting.
13:11
< RichyB>
*and they're all insane too.
13:11
< Rhamphoryncus>
Although it might help explain why so much of what I say in #openttd simply gets ignored.
13:12
< Rhamphoryncus>
Hmm.. the code is very meticulous about following the style guidelines.. yet the overall structure is horrible.
13:12
< RichyB>
Heh.
13:13
< RichyB>
Are the style guidelines themselves horrible?
13:13
< Rhamphoryncus>
Oddly enough I like nearly all of it
13:14
< Rhamphoryncus>
Not so much the commenting parts though
13:15
< Rhamphoryncus>
All that stuff about javadoc tags and such yet I've literally spent days, maybe even a week or two, trying to decipher how the saveload code works. Ultimately failed to get array-saving to work.
13:15
<@Tamber>
"If you can't figure out what we were doing, without comments, you don't *deserve* to work on it."
13:15
< RichyB>
The only thing that I actively dislike about OTTD is the insistence on doing things the same way as they've historically been done, even when it sucks.
13:15
<@Tamber>
Hysterical compatibility?
13:15
< RichyB>
The way that GRF sets get scripted is fucking insane, for instance, but it's just sorta accepted.
13:15
< Rhamphoryncus>
RichyB: yup. A lot of that is there's no direction in the project. It's just random patches people have done
13:16
< RichyB>
That makes sense.
13:17
< Rhamphoryncus>
My start of attempting to patch it this time (as opposed to a couple years ago) was me grumbling about the lack of leadership not drawing developers in
13:17
< RichyB>
IMHO that is a sign that they should be using DVCS (ideally Github) just so that they can cherry-pick packages more easily!
13:17
< Rhamphoryncus>
If there's no sense of "the developers care" then you'd be wasting your time to make and submit a patch.
13:17
< RichyB>
Having a single /trunk/ only makes sense if either a) everyone works in feature branches or b) there's leadership so that everyone agrees on the goals.
13:18
< RichyB>
I bet if they had been using Github for the last few years, you'd see a really healthy network of repos with patches being thrown around constantly.
13:19
< RichyB>
Please continue to politely ignore my git zealotry. ;)
13:19
< Rhamphoryncus>
hmm. The transport tycoon trademark is still "live"
13:20
< Rhamphoryncus>
There actually are an assortment of patch sets
13:20
< Rhamphoryncus>
Hosted on git or hg
13:20
< Rhamphoryncus>
But since they don't consistently get pulled back into trunk.. eventually they stop getting maintained.
13:22
< Rhamphoryncus>
There's a page on the wiki (which I'm sure is outdated anyway) of feature requests, often linked to a forum post for someone fixing it. Often their patch works (even if not of sufficient quality), with the last post 2 or 3 years ago.
13:22
< Rhamphoryncus>
No hint of developer review anywhere
13:23
< RichyB>
I postulate that: there is no single unified TTD community
13:23
< RichyB>
what's actually happening is that random people are grabbing the OTTD sources and adding their own features
13:24
< RichyB>
and the community that is labelled as the "official" one just happens to be the largest of these groups
13:24
< RichyB>
and all of the others (many of which are single individuals) have died off due to lack of interest from the official one.
13:25
< Rhamphoryncus>
Somebody who owns the openttd domain has created a svn subdomain hosted by somebody else who has given commit access to a few different people
13:26
< RichyB>
Your summary is terser than mine, still correct and therefore better. :)
13:26
< Rhamphoryncus>
It originally started as ttdpatch, which is written in assembly and the base game is in assembly. At some point later another project spawned to reimplement ttd in C, which became openttd. Later still it adopted some C++.
13:27
< Rhamphoryncus>
Many of the features originated in ttdpatch and it took many years for openttd to adopt them (such as the grf stuff, all came from ttdpatch.) There's still features ttdpatch has that openttd does not.
13:27
< Rhamphoryncus>
And ttdpatch is still developed.
13:29
< RichyB>
"ttdpatch is still developed" <- that is the most mind-boggling bit.
13:29
< Rhamphoryncus>
yup
13:30
< Rhamphoryncus>
Hrm. I'm wrong.
13:30
< Rhamphoryncus>
Last version was 2007.
13:30
< RichyB>
Idly dreaming, but the silliest thing you could possibly do with TTD would be to develop an MMO pulling together several tycoon games.
13:31
< Rhamphoryncus>
heh
13:31
< RichyB>
and then Pizza MmoTycoon players would end up buying ingredients from Farm MmoTycoon players
13:31
<@Tamber>
...that sounds like it could be pretty fun, at least for gits and shiggles.
13:31
< RichyB>
who buy their shipping from Transport MmoTycoon players, and so on
13:32
< RichyB>
I think that it could work from a gameplay point of view, with the proviso that you have to have really good AI.
13:32
< RichyB>
so that if there (for instance) if aren't enough Farm MmoTycoon players logging in this month, the Pizza MmoTycoon players don't all get fucked over.
13:33
< Rhamphoryncus>
Time scales are extremely different
13:33
< RichyB>
because there are NPC mmotycoons everywhere running baseline services that are affordable but which suck.
13:33 Kindamoody is now known as Kindamoody|out
13:34
< RichyB>
Are they? I bet you could design *everything* on the same 5-minute cadence.
13:34
<@jerith>
RichyB: So you'd have to outperform the bots in order to get any business?
13:34
< RichyB>
jerith, right, but it's easy.
13:34
<@jerith>
The only way for it to be easy is for the bots to be crap.
13:34
< RichyB>
The bots immediately just spend like 50% of their money on hookers and blow.
13:35
< Rhamphoryncus>
RichyB: ttd is around 2.5 seconds/day
13:35
< RichyB>
so everyone wants to buy from PC-run services and sell to other PC-run services because they'll make somewhat more money that way.
13:35
< Rhamphoryncus>
Although I have pondered changing that. It looks easy.. hah.
13:36
< RichyB>
Rhamphoryncus, yeah, I'd have to ditch that.
13:36 You're now known as TheWatcher
13:36
< Rhamphoryncus>
74 ticks/day.. not 72, nobody had a sane reason why (I'm sure it's a historical accident from the original TT.)
13:36
< RichyB>
I mean I'd ditch the notion of calendar time.
13:37
< RichyB>
So the Transport Mmotycoon would run at a cadence of roughly 5-ish minutes for a train journey between stations, the Farm Mmotycoon would run at a cadence of roughly 20-ish minutes for a crop to grow. Pizza Mmotycoons would take about 1 minute to bake a pizza and serve it to a customer.
13:38
< Rhamphoryncus>
real time?
13:38
< RichyB>
Yes, but with less clicking than Farmville.
13:39
< RichyB>
So you'd be mainly setting policy everywhere and just watching things take about 5 minutes to happen rather than having to be logged in 24/7 bossing shit around.
13:40
< Rhamphoryncus>
hrm. Looks to be around 1-3 minutes as is
13:42
< RichyB>
Also, an MMO doesn't want things like an advancing calendar and a technological progression like TTD has, 'cuz people are always joining in the middle of the game. :)
13:43
< Rhamphoryncus>
Got around 400 tiles in 2 minutes with a fairly fast (but not monorail or maglev) train.
13:43
< Rhamphoryncus>
Most trips should be around 100 tiles, but originally with slower trains
13:43
< Rhamphoryncus>
Only if you're a silly person trying to do super-long routes does it end up at 100
13:44
< Rhamphoryncus>
err 400
13:44
< Rhamphoryncus>
512x512 is a decent sized map. 64x64 is minimum, 2048x2048 is maximum.
13:46
< Rhamphoryncus>
So I'll revise that to 1 minute being typical
13:48 * Tamber ponders.
13:48
< Rhamphoryncus>
If you wanted to increase that to 5 minutes you'd have to do it by increasing map resolution. Otherwise it's just too painful to watch a train that slow.
13:49
<@Tamber>
Is there a way of renting out your railway lines to other players? (That, if you've got a line, you can allow them to run on it, and charge them for the privilege?) *ponder*
13:49
< Rhamphoryncus>
Currently no, although it's not inconceivable
13:50
<@Tamber>
Hmm.
13:50
< Rhamphoryncus>
Biggest problem is preventing abuse
14:24
<@TheWatcher>
...
14:24
<@TheWatcher>
WTF
14:25
<@TheWatcher>
I'm serting up an xml file with an external dtd. Doctype is <!DOCTYPE response SYSTEM "dtds/cstateapi.dtd" >
14:25
<@TheWatcher>
*serving
14:27
<@TheWatcher>
Not only is the dtd apparently not being read (I can't see any requests for it, anyway), Firefox is refusing to parse the xml because it claimsan element is invalid... despite being defined in the dtd it isn't loading
14:27
<@TheWatcher>
argh
14:29
< Rhamphoryncus>
random guess: should that be an absolute URI, not relative? ie have a domain name?
14:29
< Rhamphoryncus>
or at least http://
14:33
< maoranma>
God the new version of dwarffortress is hard in adventure mode
14:33
< maoranma>
Keep getting shot in vital organs from impossible paces
14:36
<@TheWatcher>
Rhamphoryncus: ... I hope not, that'll be a real pain in the arse, and I may just inline the dtd in that case
14:38
<@TheWatcher>
Nope, still not fetching the dtd. Htm
14:45 You're now known as TheWatcher[afk]
15:01
< RichyB>
Rhamphoryncus, I remember a friend of making the largest possible train on the largest possible map and then finding that, when it arrived, he got awarded the same amount of cash as if he'd only run for a few dozen squares.
15:01
< RichyB>
Rhamphoryncus, he postulated that he'd found an integer overflow bug. :)
15:01
< Rhamphoryncus>
Nope. Payment is funky :/
15:01
<@Tamber>
Took him so long to get there that the payment rates weren't worth it?
15:03
< Rhamphoryncus>
What happens is it starts at 100%, then for every (time period) over a certain cargo-dependent threshold it drops that by 0.4%, then at another threshold it drops another 0.4% per (time period), for a 0.8% drop, and those goes on until it hits 12% (penalty of 88%)
15:04
< Rhamphoryncus>
When you get there it multiplies that by distance and a per-cargo multiplier
15:05
< Rhamphoryncus>
So if your goal is to maximize payment per time spent of each train then optimal is that first threshold. Of course due to acceleration time and whatnot you're actually better a little further in
15:07
< Rhamphoryncus>
If your goal is to maximize profit from a given industry (usually is) then there's two optimal points. You multiply that drop by the distance and you get a large curve where it starts low, gets fairly high, then comes back down again. Then it hits that 88% penalty cap and goes up proportional to distance forever.
15:07 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
15:07 mode/#code [+o Syloqs_AFH] by ChanServ
15:08 Syloqs_AFH is now known as Syloqs-AFH
15:09 Vash [Vash@Nightstar-cdeba41f.wlfrct.sbcglobal.net] has joined #code
15:09 mode/#code [+o Vash] by ChanServ
15:12
< RichyB>
Rhamphoryncus, cool! Thank you for the explanation. :)
15:15
< Rhamphoryncus>
np :)
15:15 * Rhamphoryncus has decided to test that ;)
15:27
< Rhamphoryncus>
6 trains at a length of 20, 40, 80, 160, 320, 480
15:30
< Rhamphoryncus>
First trip got 12800, 24900, 49924, 97944, 188580, 273644
15:30
< Rhamphoryncus>
And oops, I had them share a common station, which means all but the first are very slightly further
15:30 * Vornicus could never play on a map larger tha 128x64 because he couldn't figure out how to 1. get started and 2. organize his tracks.
15:31
< RichyB>
Vornicus, start by finding all of the coal mines and power stations and wire those directly together with single-track railways.
15:32
< RichyB>
That gets you seed money.
15:32
< Rhamphoryncus>
Also, it looks to take.. about 41 tiles to hit the top speed of 230 km/h
15:32
< RichyB>
Then build roads between a few towns and run a regular bus service. That'll cause those towns to expand over time.
15:33
< RichyB>
Then you start working on the multi-stage industries. Things like farm (livestock) -> factory (goods) -> town, because those routes are worth semi-infinite cash.
15:34
< RichyB>
Factories will produce goods proportionally to the quantity of raw materials you bring in, so it's possible to gain incredible quantities of cash by forcing them to produce tons upon tons of goods.
15:34
< RichyB>
Make two or three of those big industrial railway lines and then you'll notice that you suddenly have semi-infinite cash and don't need to use bank loans to build track any more.
15:34
< RichyB>
Then you just go nuts. =)
15:36
< Rhamphoryncus>
In exactly 1 year my profits are.. 192580, 314100, 452180, 627960, 687290, 750688
15:38
< Rhamphoryncus>
Which is oddly contradictory to what I said :)
15:38
< RichyB>
480 tiles sounds low.
15:39
< RichyB>
My flatmate was using the largest size map that OTTD supported at the time and he was sending goods from the southmost corner to the northmost corner.
15:39
< RichyB>
He had abused the map generator a bit. :)
15:40
< Rhamphoryncus>
that 480 train took 10 weeks to deliver, so 70 days
15:40
< Rhamphoryncus>
My default settings were a 512x512 map
15:41 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Connection closed]
15:41
< Rhamphoryncus>
I think there's a rather severe penalty at the low end for getting up to speed. Gonna test that now
15:41
< RichyB>
It was a 2048x2048 map. :)
15:42
< RichyB>
with top-end maglev trains in the Temperate climate.
15:42 Stalker [Z@Nightstar-5aa18eaf.balk.dk] has quit [Ping timeout: 121 seconds]
15:45 Stalker [Z@26ECB6.A4B64C.298B52.9B92DB] has joined #code
15:51 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
15:51 mode/#code [+o Syloqs_AFH] by ChanServ
15:51
< Rhamphoryncus>
4 days to load, 5 unload, transit time in days was 6, 13, 18, 28, 47, 67
15:52 Syloqs_AFH is now known as Syloqs-AFH
15:55
< Rhamphoryncus>
So, counting each leg as separate, I get a speed in tiles/day of 3.333, 2.857, 8, 8, 8.421, 8
15:57
< Rhamphoryncus>
Or as the full distance each has an average tiles/day of 3.333, 3.077, 4.444, 5.714, 6.808, 7.164
16:17 Attilla_ [Obsolete@Nightstar-246717f9.as43234.net] has joined #code
16:18 Attilla [Obsolete@Nightstar-9ecc7891.as43234.net] has quit [Ping timeout: 121 seconds]
16:18 Attilla_ is now known as Attilla
16:52 ShellNinja is now known as TheHead
17:01 RichyB [RichardB@Nightstar-3b2c2db2.bethere.co.uk] has quit [[NS] Quit: Leaving]
17:13 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
17:27 You're now known as TheWatcher
17:37 Kindamoody|out is now known as Kindamoody
17:44 Derakon [chriswei@Nightstar-a3b183ae.ca.comcast.net] has joined #code
17:44 mode/#code [+ao Derakon Derakon] by ChanServ
17:44
<&Derakon>
Man, OpenGL 3 makes me so angry.
17:45
<@Tamber>
Oh?
17:45
<&Derakon>
Maybe because I have enough trouble understanding what's going on when the functions I'm calling do intuitive stuff.
17:45
<&Derakon>
Now I have to do everything with vertex and fragment shaders and VBOs.
17:46
<&Derakon>
I get that calling glVertex, glBegin(GL_TRIANGLES), etc. wasn't as efficient, but it was efficient enough and dammit it made sense.
17:46
<&Derakon>
Also, the tutorials for the new system are shit.
17:46
<&Derakon>
Probably because they're trying to explain an arcane system.
17:57
< RichyB>
Derakon, aiui you should look up tutorials for iPhone game development
17:57
< RichyB>
because they're all OpenGL ES 2.0, which is unified-shader-oriented
17:58
<&Derakon>
Really all I want to do here is implement a false-color filter for my camera displays (which are all monochrome).
17:58
<&Derakon>
I have the displays working using the old system.
18:00 TheHead is now known as Number3
18:08
<@TheWatcher>
SO why not use opengl 2?
18:09
<@TheWatcher>
AFAIK, it's not going away any time soon.
18:09
<&Derakon>
Because the tutorial I found for fragment shaders was a GL3 tutorial.
18:09
<&Derakon>
So I figured, fuck it, how hard can it be?
18:09
<&Derakon>
Answer: the tutorial doesn't work in three different ways.
18:09
<&Derakon>
So fuck them!
18:15
<&Derakon>
Though one of the reasons it doesn't work is that compileShader doesn't work.
18:15
<&Derakon>
So even using OpenGL 2 I think I'm screwed.
18:16 Kindamoody is now known as Kindamoody[zZz]
18:22 Tarinaky is now known as Lowpass
18:22
< RichyB>
(and the other reason for recommending iPhone-graphics-tutorials is that some of them are well written on account of being targeted at an audience who want to learn OpenGL rather than an audience who paradoxically already know it :P)
18:23
<&Derakon>
Heh.
18:23
<~Vornicus>
How the space do I get basic linear algebra wrong but not screw up horrible spherical geometry
18:26
<&Derakon>
You're having to actually think about the latter but assume you can do the former in your sleep?
18:28
<~Vornicus>
Apparently
18:36
< gnolam>
Derakon: well, actually, shaders are more intuitive than the "classic" OpenGL pipeline.
18:37
< gnolam>
You don't have to memorize an oodleplex of obscure state, for instance.
18:37
<&Derakon>
Mm, my main complaint is with how you have to specify all your geometry as arrays of vertices, really.
18:38
<&Derakon>
I'm surprised they don't make you manually generate your own transformation matrices too.
18:39
< gnolam>
Well. It is a /bit/ annoying, but it basically only affects the quick test hacks.
18:40
<&Derakon>
Or the people who are focused more on getting something that generates the desired display than on making things as optimized as possible, because they aren't game developers and they need their code to still be readable when they come back to it two months later.
18:40
< gnolam>
Wrapping a VBO isn't that hard.
18:41
<&Derakon>
It's additional complexity for zero gain.
18:41
<&Derakon>
Oh, sure, it's a bit faster. Who cares? What I have is fast enough.
18:41
<&Derakon>
Basically this is one of those situations in which the people who wanted the speed used VBOs because, duh, they need the speed. But that was true in GL2.
18:42
<&Derakon>
So in GL3 they're enforcing that everyone optimize for speed even if they'd rather optimize for readability.
18:42
< gnolam>
I'll grant you that if you don't have immediate mode/glVertexPointer, AND no shaders, you're going to be in a world of pain. But AFAIK, that's never the case.
18:42
< gnolam>
Thing is, the GL 3/ES way /is/ more readable.
18:42
< gnolam>
OpenGL has a LOT of state.
18:43
<&Derakon>
I look at the GL3 tutorials, and they're pretty much 100% mystic incantations.
18:43
<&Derakon>
GL2, you called glVertex, the reader could think "Ah, it's specifying a vertex location"
18:43
<&Derakon>
Maybe this is just the tutorials being shit though.
18:44
< gnolam>
And you the programmer have to keep track of /all/ that state, or it'll come back to bite you. Either by setting/resetting absolutely everything before drawing anything, or by keeping track of /exactly/ what's been set previously (which makes refactoring a pain).
18:45
< gnolam>
Probably just the tutorials, yes.
18:46
<&Derakon>
Here's the email I sent earlier today to pyopengl-users, for example: http://sourceforge.net/mailarchive/message.php?msg_id=28844831
18:47
< gnolam>
(Ditching immediate mode wasn't /strictly/ necessary to get around this, but... it makes the HW/driver part so much easier to implement, it gets rid of a slow way of drawing stuff that people shouldn't be using, and last but not least it gets rid of more functions in OpenGL classic's humongous API)
18:52
< gnolam>
Derakon: can you get the OpenGL version string?
18:53
< gnolam>
(glGetString(GL_VERSION). Also, GL_SHADING_LANGUAGE_VERSION.)
18:54
<&Derakon>
...both print out None, which is Python's NULL equivalent.
18:54
< gnolam>
o_O
18:54
<&Derakon>
Yeah, I don't know.
18:56
<&Derakon>
Hm, moved the call a bit later and it says 3.3.0 for the first, "3.30 NVIDIA via Cg compiler" for the second.
18:58
< gnolam>
Wait
18:58
< gnolam>
That suggests you don't have an OpenGL context then.
18:59
<&Derakon>
I didn't the first time, no, because I was making the call in the constructor for the canvas object I was using.
18:59
<&Derakon>
I moved it to the first paint call and got actual results, though the attempt to create a shader still failed.
18:59
< gnolam>
The same canvas object in which you're creating the shaders.
18:59
<&Derakon>
"actual results" meaning glGetString worked, not the painting.
18:59
< gnolam>
For which you need an OpenGL context for getting access to the shadercreaty functions.
19:00
<&Derakon>
Yeah, I moved all of the glFoo and shader stuff to the first paint call.
19:00
< gnolam>
What's the code and error now then?
19:00
<&Derakon>
http://pastebin.com/aFfDvJV5
19:01
<&Derakon>
...oh, that's a different error now.
19:01
<&Derakon>
"gl_ModelViewProjectionMatrix is deprecated after version 120"
19:01
<&Derakon>
"global variable gl_Vertex is deprecated after version 120"
19:01
<&Derakon>
So their own tutorial uses deprecated concepts!
20:35 Derakon [chriswei@Nightstar-a3b183ae.ca.comcast.net] has quit [[NS] Quit: leaving]
21:04 mode/#code [+o iospace] by ChanServ
21:29
<~Vornicus>
There. FInally. Jeez.
21:33 * Vornicus now pokes at going from xy to lat-long, because that's the next step.
21:34
<~Vornicus>
And then I get to go from vorn projection pixel to equirectangular projection polygon, and then use that to determine colors for the image.
21:35
<~Vornicus>
WHich I then get to send to Viper, along with the source code to this thing.
21:35
<~Vornicus>
Which I should actually post.
21:49 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [Ping timeout: 121 seconds]
21:49 gruber [lenin@9D46A2.F4E9D7.E4B4CF.2072AD] has joined #code
21:51
< RichyB>
Vornicus, github!
21:52
< RichyB>
Vornicus, we have at least one data point indicating that use of github by #code users causes people to submit patches to them. ;)
21:52
< RichyB>
s/data point/anecdote/
22:19
<@ToxicFrog>
To.
22:19
<@ToxicFrog>
Two, even.
22:22
< RichyB>
Whassa other one?
22:24 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Client closed the connection]
22:24 himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
22:24 mode/#code [+o himi] by ChanServ
22:30 Vash [Vash@Nightstar-cdeba41f.wlfrct.sbcglobal.net] has quit [Ping timeout: 121 seconds]
22:31 Vash [Vash@Nightstar-cdeba41f.wlfrct.sbcglobal.net] has joined #code
22:31 mode/#code [+o Vash] by ChanServ
22:55
<@ToxicFrog>
RichyB: vstruct.
22:56
< RichyB>
ToxicFrog, nice library. Is it pure Lua or FFI?
22:57
<@ToxicFrog>
Pure lua.
22:58
< RichyB>
https://github.com/ToxicFrog/vstruct/blob/master/vstruct/io/endianness.lua <- that looks painful.
22:58
< RichyB>
No FFI in the reference implementation? :/
22:59
<@ToxicFrog>
It's a C->Lua interface, not a Lua->C one
23:00
< RichyB>
No reason not to have both but fair enough.
23:05
<@ToxicFrog>
Well, the reasoning is that lua is meant to be (a) embedded (b) minimal and (c) clean ANSI C/++
23:05
<@ToxicFrog>
I'm pretty sure (c) alone rules out including a Lua->C FFI (although they already bend that in a few areas with optional features)
23:07
<@ToxicFrog>
and (a) implies that if using it as designed, you won't need one (although it's getting used standalone more and more these days, most of its use is still embedded)
23:07
< RichyB>
(c) is indeed a killer reason.
23:08
<@ToxicFrog>
luaJIT is the "so you care more about features and performance than portability" implementation.
23:08
< RichyB>
AIUI you can write a ctypes-style C FFI using libFFI without having to actually do any of the dirty can't-manage-this-in-C work *yourself*.
23:08 * ToxicFrog nods
23:09
<@ToxicFrog>
"clean ANSI C/++" here means "compiles out of the box in any compliant C or C++ compiler with no external dependencies", though.
23:09
< RichyB>
I should look into that some day. I'm not entirely clear on what are the bits that you *can't* do with just C and dlsym().
23:09
<@ToxicFrog>
(I've even built it on systems that don't have an ANSI C89 compliant libc)
23:10
<@ToxicFrog>
dlsym() et al are POSIX, though.
23:10
< RichyB>
Oh yes, I wouldn't consider something that depended on libFFI to meet that requirement. It just pushes the nonportable part into a dependency.
23:12
<&McMartin>
dlsym() is POSIX, but Lua 5.2 has standard extensions that rely on it or its Win32 equivalent (GetProcedureAddress)
23:13
<@ToxicFrog>
Yeah, that's the "bends requirement (c)" I mentioned.
23:13
<@ToxicFrog>
(and that goes back to 5.0 at least)
23:13 gruber is now known as gnolam
23:31 cpux|2 is now known as cpux
23:31 Derakon [chriswei@Nightstar-a3b183ae.ca.comcast.net] has joined #code
23:31 mode/#code [+ao Derakon Derakon] by ChanServ
23:31
<&Derakon>
Boss is trying to track down a data file we were fiddling with a few years ago.
23:32
<&Derakon>
This isn't the first time this has happened, so I showed him my massive collection of old data files.
23:32
<&Derakon>
He takes a look and asks me to print the list out so he can look at it.
23:32
<&Derakon>
I do so, hand him the ~20 page wad, he takes one look and asks for it with the creation dates as well.
23:32 * Derakon sighs.
23:33
<&Derakon>
There's an additional problem here in that the creation dates I have are from when I made the copies, not when they were actually created...
23:33
< RichyB>
Grep!
23:34
< RichyB>
If grep isn't the solution then the problem is much too difficult.
23:34
<&Derakon>
Heh.
23:34
<@ToxicFrog>
This is textbook Doing It Wrong.
23:34
<&Derakon>
Actually the solution here would be "find . | xargs ls -hl" if it weren't for the fact that the creation dates for these files are wrong.
23:40
<@Alek>
isn't there an argument for copy that preserves original creation dates?
23:40
<@Alek>
which should perhaps have been used?
23:40
<@Alek>
originally?
23:40
<@Alek>
?_?
23:40
< RichyB>
No, that's too difficult to arrange. ctimes are delicate.
23:40
< RichyB>
(in the face of backups, file system copies, etc)
23:42
< RichyB>
The solution *was* something along the lines of "find . -exec ls -l {} + > catalogue.txt" and then add new lines to that file periodically.
23:50
<&Derakon>
Man, find's "exec" command always screws with me.
23:50
<&Derakon>
Always complaining about "missing argument to exec".
23:50
< RichyB>
You need both {} and +.
23:50
<&Derakon>
That I don't remember.
23:50
< RichyB>
Some implementations suck and you end up needing {} and \;
23:51
<&Derakon>
What I used to use, IIRC, was \{\} instead.
23:51
< RichyB>
{} goes where you'd like the arguments to be substituted in. \; or + goes after the last argument.
23:51
<&Derakon>
Ah.
23:51
< RichyB>
\{\} works just fine too but {} works just as well.
23:51
<&Derakon>
I seriously don't remember that +
23:51
<&Derakon>
Maybe I used a semicolon instead.
23:51
< RichyB>
You're escaping something that isn't actually a shell metacharacter. :)
23:52
< RichyB>
The difference between + and \; is that \; runs the command once per file while + runs the command on batches of files each time.
23:52
< RichyB>
You can get away without ever using + if you don't care how fast the command runs. :)
23:52
<&Derakon>
Well, it doesn't run at all without it, apparently.
23:53
< RichyB>
I meant "with \;" rather than "entirely without any terminator"
23:53
< RichyB>
find horks without both the substitution and the terminator.
23:56
<@ToxicFrog>
quite reasonably, since otherwise it can't infer the end of the command
23:59
<&Derakon>
Hm, any of you know an invocation to sort files by creation date?
--- Log closed Fri Feb 17 00:00:04 2012
code logs -> 2012 -> Thu, 16 Feb 2012< code.20120215.log - code.20120217.log >

[ Latest log file ]