code logs -> 2013 -> Thu, 05 Sep 2013< code.20130904.log - code.20130906.log >
--- Log opened Thu Sep 05 00:00:30 2013
00:34 ktemkin[zz] is now known as ktemkin
00:48 Turaiel[Offline] [Brandon@Nightstar-949d7402.resnet.mtu.edu] has quit [Ping timeout: 121 seconds]
00:54 Turaiel[Offline] [Brandon@Nightstar-949d7402.resnet.mtu.edu] has joined #code
01:08 You're now known as TheWatcher[T-2]
01:14 Derakon_ is now known as Derakon
01:14 mode/#code [+ao Derakon Derakon] by ChanServ
01:18 You're now known as TheWatcher[zZzZ]
02:06 Derakon_ [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
02:09 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
02:16
<@Alek>
....
02:16
<@Alek>
Character.toLowerCase(Character.toUpperCase(ch))
02:16
<&McMartin>
I strongly suspect that there are localization regimes where that's not the same thing as Character.toLowercase(ch) >_<
02:18
<@Alek>
"is there a Law of Conservation of Information?" "sure, output piped to /dev/null will eventually exit from /dev/random"
02:24 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
02:24 mode/#code [+qo Vornicus Vornicus] by ChanServ
02:26 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
02:26 mode/#code [+ao Derakon Derakon] by ChanServ
02:30 Derakon_ [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
02:52 Derakon_ [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
02:53 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
02:54 ktemkin is now known as ktemkin[awol]
03:12 thalass [thalass@Nightstar-ecf59cc1.bigpond.net.au] has joined #code
03:55 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
03:56 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
03:56 mode/#code [+ao Derakon Derakon] by ChanServ
03:59 Derakon_ [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
04:02 Vornicus [vorn@Nightstar-221158c7.sd.cox.net] has joined #code
04:02 mode/#code [+qo Vornicus Vornicus] by ChanServ
04:24 Turaiel[Offline] is now known as Turaiel
04:36 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
04:54 Reiv [NSwebIRC@Nightstar-95746c1f.kinect.net.nz] has quit [Ping timeout: 121 seconds]
05:04 Derakon is now known as Derakon[AFK]
05:07 Reiv [NSwebIRC@Nightstar-95746c1f.kinect.net.nz] has joined #code
05:07 mode/#code [+o Reiv] by ChanServ
05:27 Derakon_ [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
05:28 Derakon[AFK] [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Operation timed out]
05:38 Kindamoody[zZz] is now known as Kindamoody
05:48 ErikMesoy|sleep is now known as ErikMesoy
05:48 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
05:48 mode/#code [+ao Derakon Derakon] by ChanServ
05:50 Derakon_ [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Operation timed out]
06:05 Kindamoody is now known as Kindamoody|afk
06:16 Turaiel is now known as Turaiel[Offline]
06:36 Derakon_ [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
06:39 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Operation timed out]
06:42 RichyB [RichyB@D553D1.68E9F7.02BB7C.3AF784] has quit [[NS] Quit: Gone.]
06:45 RichyB [RichyB@D553D1.68E9F7.02BB7C.3AF784] has joined #code
06:58 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
06:58 mode/#code [+ao Derakon Derakon] by ChanServ
07:01 Derakon_ [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Ping timeout: 121 seconds]
08:41 celticminstrel [celticminst@Nightstar-ae361035.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
09:04 You're now known as TheWatcher
09:20 thalass [thalass@Nightstar-ecf59cc1.bigpond.net.au] has quit [Ping timeout: 121 seconds]
09:21 YoLtA [YoLtA@Nightstar-ddf007ac.abo.wanadoo.fr] has joined #code
09:26 YoLtA [YoLtA@Nightstar-ddf007ac.abo.wanadoo.fr] has quit [Killed (jerith (Go away.))]
09:26
< Syka>
haha
09:27
< Syka>
yeah i was about to say something
09:27
< Attilla>
it would be something if you could force /dev/random to never generate info that went to /dev/null but i don't think it would be so random anymore~
09:40 Kindamoody|afk is now known as Kindamoody
09:48 AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has joined #code
09:55 Kindamoody is now known as Kindamoody|out
10:25 thalass [thalass@Nightstar-ecf59cc1.bigpond.net.au] has joined #code
10:53 AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has quit [[NS] Quit: Leaving]
12:26 Vornicus [vorn@Nightstar-221158c7.sd.cox.net] has quit [[NS] Quit: ]
13:39 Syka_ [the@Nightstar-c4be3f1f.iinet.net.au] has joined #code
13:41 Syka [the@Nightstar-1bdaef13.iinet.net.au] has quit [Ping timeout: 121 seconds]
15:36 celticminstrel [celticminst@Nightstar-ae361035.dsl.bell.ca] has joined #code
15:36 mode/#code [+o celticminstrel] by ChanServ
16:03 thalass is now known as thalasleep
16:35
< ErikMesoy>
http://i.imgur.com/zmviusf.png Seen in my textbook. Generation 5 looks incredibly optimistic to me.
16:36
< ErikMesoy>
I've never actually run into a 5th-generation language like that, but in my experience, gen 3 is preferable to both 2 and 4.
16:38 Kindamoody|out is now known as Kindamoody
17:02 * TheWatcher eyes that
17:02
<@TheWatcher>
Who on earth counts code in "pages" anyway?
17:03
< ErikMesoy>
People who write too much code?
17:03
<@TheWatcher>
I've written over 1200 lines of code in the last two days. I don't count code in pages.
17:04
< ErikMesoy>
If you're curious about the source, it's Information Modeling and Relational Databases by Terry Halpin and Tony Morgan.
17:04
<@TheWatcher>
And I call bullshit on 3, even if you do use pascal, unless they're using horribly designed data structures >.>
17:06
<@TheWatcher>
(yeah, I know that's not their point, but still)
17:06
<@TheWatcher>
(that reads like something written in 1985)
17:12
< ErikMesoy>
"that" being the code sample, the textbook, or what?
17:15
< Ogredude>
TheWatcher: I think "pages" to give you a rough estimation of how many LOC there are
17:16
< Ogredude>
but still, there's more Unix-nature in one line of shell script than in ten thousand lines of C
17:36 Kindamoody is now known as Kindamoody|out
18:34 Derakon_ [Derakon@31356A.8FA1FE.CF2CE9.D6CF77] has joined #code
18:36 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Operation timed out]
19:05
<&ToxicFrog>
Oh god oh god oh god
19:05
<&ToxicFrog>
I'm pushing a button that affects ~3k servers handling ~500k QPS
19:06
< ErikMesoy>
Get a glove?
19:08
<@Tamber>
Cackle madly, too.
19:12
<@gnolam>
Oh god it's written in visual basic
19:22
<@froztbyte>
ToxicFrog: man I wish I could do that again
19:22
<@froztbyte>
I miss the days when a single thing I mistyped could take out the internet for a whole country :(
19:31
<@Pandemic>
I need a random 28 digit hex number generator...
19:31
<@Pandemic>
>.>
19:31
<@Pandemic>
<.<
19:31
<@Pandemic>
to the googles!
19:35
<@froztbyte>
[str(random.randint(1,16)) for x in range(0,28)]
19:35
<@froztbyte>
jiggle appropriately for ord->hex conversion
19:35
<@Pandemic>
or that, thanks!
19:36
<@froztbyte>
you'll probably end up a little bit away from it
19:36
<@froztbyte>
but random.randint and the range() is about all you need
19:50
< [R]>
dd if=/dev/urandom bs=14 count=1 2>/dev/null | xxd | awk '{ print $2 $3 $4 $5 $6 $7 $8}'
19:59 Kindamoody|out is now known as Kindamoody
20:07
<&ToxicFrog>
Hmm. Is the distribution of something that randomly selects 28 digits the same as something that randomly selects a 28-digit number?
20:08
< ErikMesoy>
Very theoretically, yes.
20:09
< ErikMesoy>
In practice, the thing that selects 28 digits might pick lots of leading zeroes and the 28-digit-number might be forced to be at least 10^28, because 10^27 is sort of not a 28-digit-number.
20:12
<&ToxicFrog>
I'm using 28 digits in the "expressible in 28 digits" sense, not in the "is exactly 28 digits once leading zeroes are stripped" sense.
20:14
< ErikMesoy>
Okay. Next issue I can think of is that randomly selecting a 28-digit number might be done by 10^29*(rand) and (rand) doesn't have 28 digits of precision.
20:14 Kindamoody is now known as Kindamoody[zZz]
20:15
< ErikMesoy>
Really, this is a question to the person who wrote the algorithms. Because practice can have all sorts of messy defects that stop it working like it should in theory.
20:17
<&ToxicFrog>
Yeah, I'm asking statistical theory here
20:17
<&ToxicFrog>
Not everything that can go wrong with a PRNG
20:19
< ErikMesoy>
I'd spell out the requirements that the former selects digits 0-9 twentyeight times to concatenate, and the latter randomly selects in 0000000000000000000000000000-9999999999999999999999999999, then they should have the same distribution.
20:23
< Ogredude>
you need lavarand. http://en.wikipedia.org/wiki/Lavarand
20:25
<&ToxicFrog>
ErikMesoy: ok. That was my intuition, but stats are so rarely intuitive.
20:25 * iospace makes ToxicFrog use bogosorts for the rest of his life
20:25
<@iospace>
o:
21:41 Moltare [Moltareish@583787.FF2A18.190FE2.4D81A1] has joined #code
21:43
< Moltare>
Gentlemen! I have a question.
21:43
< Moltare>
(In fact I have several, but "why doesn't Runescript have proper support for X?" and "why won't Engine get off their arses and give us Y?" count more as rants)
21:44
< Moltare>
Essentially, I have a list of n integers; I should like a reasonably efficient way to determine, for any such list, the list of indices for which the values are equal.
21:45
< Moltare>
eg, in the list (1, 1, 3, 5, 6, 8, 6, 1) I should like (0, 1, 7), (4, 6)
21:46
< Moltare>
er, ~any lists* of indices for~
21:48
< Moltare>
This is made slightly harder by the fact that Runescript doesn't have any idea what a data structure is, apart from variables and integer-only arrays.
21:57
< Moltare>
(The question, therefore, is "could any of you fine lads and ladies advise on potential avenues that don't involve beating Engine with sticks until they give me proper support, please?")
21:59
<@Azash>
I was going to answer before I read "doesn't have any idea" etc
21:59
<&ToxicFrog>
Ditto
21:59
< Moltare>
heh
21:59
<@Azash>
That sounds like a terrible environment
21:59
<&ToxicFrog>
Can you have arrays of arrays?
21:59
<&ToxicFrog>
Do you know what the bounds on the values contained in the list are?
22:00
<&ToxicFrog>
Have you ever considered writing a compiler for a real language that emits runescript?
22:00
< Moltare>
No, yes, and OH GOD PLEASE YES, respectively
22:00
<&ToxicFrog>
You can't? Well cocks.
22:00
<&ToxicFrog>
What data types do you have available apart from int and array[int]?
22:00
< Moltare>
As I may have ranted before, we have five arrays per server
22:00
<&ToxicFrog>
waitwaitwait
22:01
< Moltare>
hence any given code block relinquishes and clears any array it has been using
22:01
< Moltare>
so the next proc, trigger etc can use it
22:01
<&ToxicFrog>
You have five (global?) pre-existing arrays, which can hold only integers, and no other way of storing composite data?
22:01
<&ToxicFrog>
jesus
22:01
<&ToxicFrog>
christ
22:01
<&ToxicFrog>
fucking
22:01
< Moltare>
"The world's most popular free MMO"
22:01
< Moltare>
"Our tech is our unfair advantage" - CEO, 2012
22:01
<&ToxicFrog>
I am willing to port this to Lua and write a Runescript->Lua compiler for automated conversion of existing scripts on a contract basis~
22:02
<&ToxicFrog>
Anyways. Data types. What do you have to work with?
22:03
<@TheWatcher>
Just watch where his pinky finger goes when he tells you what his contracting fee is, though ¬¬
22:03
< Moltare>
Our data types are int, string-but-only-as-a-temporary-variable, coord, npc_id, player_id, loc_id, controller_id
22:03
<&ToxicFrog>
What is the "only as a temporary" part?
22:03
<&ToxicFrog>
And what can you do with those last five?
22:03
< Moltare>
You can't store strings outside code blocks either
22:04
<&ToxicFrog>
But you can, say, have a var holding a string, and modify it over the course of a function?
22:04
< Moltare>
correct.
22:04
<@TheWatcher>
Do you have per-character access to the string, and are the contents of said string ascii?
22:04
< Moltare>
the last five are 32-bit unique ids of placed actors in the game world, idly
22:05
<&ToxicFrog>
"reasonably efficient" may be out the window here, but I'm thinking your best bet may be to implement a (value => list of indices) map as string contents.
22:05
<&ToxicFrog>
Including coord?
22:05
< Moltare>
er, last four, sorry
22:05
< Moltare>
coord is a five-part value indicating a position in the game world by level, map square and map tile
22:06
<&ToxicFrog>
Ok, so that...basically lets you store five ints in one value? Not super useful.
22:06
< Moltare>
yeah, it's functionally the same as an int
22:06
<&ToxicFrog>
And since it's not an int you can't put it in an array.
22:07
< Moltare>
It's just 32 bits partitioned
22:07
<&ToxicFrog>
I'll provide an alibi, if you need one.
22:07
< Moltare>
and, yes, you can't put it in an array
22:07
< Moltare>
unless you pack it into an integer, which is frowned on but I have done
22:07
< Syka_>
"He was here, with me, not murdering the Engine team"
22:07
<@TheWatcher>
Question! how do you actually /do anything/ with that engine, other than go slowly insane?~
22:08
<&ToxicFrog>
Moltare: ok, what string manipulation capabilities do you have?
22:08
<&ToxicFrog>
And what are the bounds on the values in that array? Small enough that you can get away with creating a var for each one, or large enough/unknown enough that you'd need to create them on the fly?
22:08
< Moltare>
TW: mostly hax and algorithms of order n! or n2.
22:09
< Moltare>
With strings I can set, append/prepend and compare.
22:09
<&ToxicFrog>
...can you split/substring?
22:09
< Moltare>
hahaha. no.
22:09
< Moltare>
Comparison returns 0 if the two strings given are identical, -1 if the former is smaller and +1 if the former is larger.
22:09
<&ToxicFrog>
Oh, also
22:10
<&ToxicFrog>
What is the final output going to be?
22:10
< Moltare>
These latter two values are not of a great deal of practical use for the most part.
22:10
<&ToxicFrog>
I mean, you want (0, 1, 7), (4, 6), but as far as I can tell you have no way of actually expressing that or anything like it in this homesick abortion of a language
22:10
<&ToxicFrog>
(going to bus terminal now, back in ~20)
22:11
< Syka_>
i suggest crying
22:11
< Syka_>
also
22:11
<@TheWatcher>
(he's so enranged, he needs to go kill hobos, obviously)
22:11 * Syka_ thwaps Moltare over the head
22:11
< Syka_>
pass that on to whoever touched ace of spades
22:11
< Moltare>
Syka: Can't
22:11
< Moltare>
We fired them all
22:11
< Syka_>
fucking good
22:12
< Syka_>
hire them back
22:12
< Syka_>
then fire them again
22:13
< Moltare>
Anyway, to answer TF's question, the list of values represents players standing in line within a minigame. If two or more players try to stand in the same spot in the line, both of them get penalised.
22:14
< Moltare>
Hence I start with a list of which spot each player is standing in, and need to end with a list of which spots have which multiple players standing in them
22:14
< Moltare>
Obviously the naive approach is to compare the position of 1 vs 2, 3, 4...n, 2 vs 3,4...n
22:14
< Moltare>
But I'd rather not put any more O(n!) algorithms in our game
22:14
< Moltare>
than we already have
22:15
< Moltare>
(my troll face wants to show TF and TW the code for Clan Citadels
22:15
< Moltare>
but I'd have to qork out what minimum safe distance was first)
22:16
< Moltare>
*work
22:19
< RichyB>
Moltare, do you have a RuneScript reference to hand?
22:19
<@TheWatcher>
So (1, 1, 3, 5, 6, 8, 6, 1) is the list of squares each player is in (p0 in square 1, p1 in square 1, p2 in square 3, etc)? If what you need is a list of spots with multiple players in, what I'd do is set up an array of zeros, one index for each square, then iterate over the player list incrementing the count at each square. That'll give you a list of occupation levels for each square.
22:20
< Moltare>
Richy: No, sorry, I'm at home
22:21
< Moltare>
TW: I also need the identity of the players, so I need to know for those squares which indices make up that occupation
22:22
< Moltare>
(from which indices on the original list I can get the player_id)
22:22
<@TheWatcher>
Ugh. Well, do you have a max number of players?
22:23
< RichyB>
The two easy ways I can think of to do this are: 1. sort the array and maintain a mapping from the current indexes to the player numbers, then walk down the array looking up the duplicated ones in the currentindex->playerno map, 2. hash tables, which you probably don't have but could write given arrays.
22:23
<&McMartin>
My half-formed idea looked more like RichyB's 1.
22:23
< Moltare>
I can declare one, TW. 20-50 is an appropriate sort of size for the minigame.
22:24
< Moltare>
Richy: I've implemented sortof hash tables in runescript before. Engine wasn't pleased.
22:24
< RichyB>
Haha.
22:24
< Moltare>
"Why not just get us to do that? be far more efficient"
22:24
< RichyB>
I assume that you don't have a sort routine on-hand?
22:24
< Moltare>
We've got the World's Worst Quicksort.
22:24
< RichyB>
How is it the world's worst quicksort?
22:25
< Syka_>
a shiny bogosort
22:25
< Moltare>
it works only on precisely two of the five integer arrays and is slower than quicksort should theoretically be able to run
22:25
<&McMartin>
Quicksort can be as bad or worse than bubblesort in theory
22:25
< RichyB>
Is it actually bubblesort but they called it "quick" because some dude spent a whole 15 minutes trying to optimise it and thinks it's fast now? ;)
22:26
< RichyB>
Can you sort *pairs* of integers?
22:27
< Moltare>
Well, since the sort requires two arrays, I can sort the second array in increasing index order of the values of the first array.
22:27
< Moltare>
s/can/must
22:27
< RichyB>
Oh good.
22:27
<@TheWatcher>
How about: set up an array with 51 ints per square, use the first int as the occupation count, and the remaining 50 as the indexes in the original list. Then you can traverse the input list, increment counts[square * 50] each time, and then counts[square * 50 + (counts[square * 50])] = index.
22:28
<@TheWatcher>
Utterly horrible, but I think that'd work. Essentially a 2D array with counters.
22:29
<@TheWatcher>
(also, don't ask where those parenthesis came from, I dunno)
22:30
< RichyB>
So you fill array A with the positions [1 1 3 5 6 8 6 1] and array B with the indexes [0 1 2 3 4 5 6 7], call the sort() and it'll modify them in-place, causing A to now contain [1, 1, 1, 3, 5, 6, 6, 8] and B to now contain [0, 1, 7, 2, 3, 4, 7, 5]?
22:31
< RichyB>
Moltare, ?
22:32
< Moltare>
hm, yes, I can see that working, actually.
22:32
< Moltare>
for either method
22:34
< Moltare>
in fact, if I break out my horrible coord bitpacking I could make that work in 2D too :D
22:37
<@TheWatcher>
I'm not going to ask
22:38
<&ToxicFrog>
This is an abomination in the eyes of god and man
22:38
< RichyB>
The pseudo-code I made up because I have no knowledge of Runescript is a larger abomination but what the Hell http://pastebin.starforge.co.uk/588
22:38
< RichyB>
Moltare, -^
22:38
< Moltare>
Basically, I could use this and our hunt system to implement collision detection between players
22:38
< RichyB>
I'm not sure if that array-walk is correct, I've only executed it in my head, not on a computer.
22:39
< Moltare>
in script.
22:39
< RichyB>
Hah, fun idea.
22:40
< Moltare>
These days anything I code is liable to give Engine fits
22:40
<@TheWatcher>
I'd count that as payback~
22:40
< RichyB>
Moltare, I should write that up into a real programming language so that I can try it for correctness. Can you read Python or, barring that, C?
22:41
< RichyB>
(or anything, really, it's just arrays and shit, I could probably learn enough of whatever language you name in 5 minutes to do a direct translation, assuming I can find an interpreter ;P)
22:41
< Moltare>
I can read C, yes. But what you've got there is entirely sufficient to guide my hand
22:41
< Moltare>
Thank you :)
22:42
<&ToxicFrog>
Moltare: hang on, if the underlying goal is "get the sets of players that are occupying the same squares", can't you just use whatever existing collision dtection it has?
22:42
< Moltare>
TF: You're a funny man.
22:43
<&ToxicFrog>
(seriously WHAT IS WRONG WITH THESE PEOPLE)
22:44
< Moltare>
player to loc, player to npc, npc to loc and npc to npc 'collision detection' only
22:44
< Moltare>
by which I mean "is something in the square you're trying to walk to? yes? then fail line of walk test"
22:45
< RichyB>
Moltare, I got some of the boundary conditions wrong, I'm going to post a fixed python version in a minute.
22:45
< Moltare>
That's alright, Richy, I got the jist
22:45
< Syka_>
runescape collision detection is lol
22:46
< Syka_>
also pathfinding
22:46
< Syka_>
which seems to be naieve as hell
22:46
< Syka_>
"Sure, we can go there. let's walk straight through this giant dragon, rather than the slightly longer way :D"
22:47
< Syka_>
"no dont do that" "you have mith armour don't you? stop being such a pus- oh you're dead, hm"
22:47
< Moltare>
The pathfinding's more robust than the collision detection, but it is strictly a shortest-path
22:47 Vornicus [vorn@Nightstar-221158c7.sd.cox.net] has joined #code
22:47 mode/#code [+qo Vornicus Vornicus] by ChanServ
22:47
< Moltare>
also, lol mithril armour. Get barrows if you're going to fight dragons.
22:47
< Syka_>
i havent played since um
22:47
< Syka_>
...uh.
22:47
< Syka_>
...I literally don't know
22:48
< Syka_>
it was before there were capes for everything, I think?
22:48
< Moltare>
You may be interested in our Old School servers, which we brought back by popular demand
22:48
< Syka_>
yeah I saw that on /v/
22:48
< Moltare>
It's the 2007 build of the game, from just after we added the & operator to Runescript.
22:48
< Syka_>
everyone going "KSDGBUDFG OLD RS" and then slightly later "oh right old rs was shit"
22:50
< Syka_>
also heh
22:50
< Syka_>
is that the version with the non-gimped wilderness
22:50
< Moltare>
both versions are
22:50
< Syka_>
because isnt the current wilderness like, absolutely harmless
22:50
< Moltare>
we ungimped it
22:51
< Syka_>
heh
22:51
< Moltare>
Andrew G went "OMG credit card fraud, remove all player transactions"
22:51
< Syka_>
good days, good days
22:51
< Moltare>
the new guy went "OMG credit card fraud, improve the anti-fraud systems"
22:51
<~Vornicus>
Mol: wat
22:51
< Moltare>
and then we put the player transactions back.
22:51
<~Vornicus>
wat
22:51
< Syka_>
my old char, that u've lost to time
22:51
< Syka_>
ive*
22:51
< Syka_>
it had like, level 60 avg
22:52
< Syka_>
and level 100 woodcutting and fletching
22:52
< Syka_>
i made arrows to level fucking 100
22:52
< Moltare>
not bad for old school
22:52
< Syka_>
or 99, or whatever was the cap
22:52
< Syka_>
i would fucking murder forests
22:52
< Syka_>
also, when houses came out
22:52
< Syka_>
i was like HA HA, SCRUBS because i had like 9,000,000 wood already
22:53
< Moltare>
aw, construction
22:53
< Syka_>
oh, good days
22:53
< Syka_>
when i could play games like runescape or puzzle pirates and not get bored :(
22:53
< ErikMesoy>
mmm puzzle pirates
22:53
< Syka_>
that game was great
22:54
< Syka_>
i kicked ass at the sword fighting and bilge stages
22:54
< Syka_>
oh and the repair one
22:54
< ErikMesoy>
everyone kicks ass at bilge
22:54
< ErikMesoy>
bilge is the newbie pool :P
22:54
< Syka_>
heh
22:54 * TheWatcher ponders sending a printout of http://www.lua.org/manual/5.2/ to a company in Cambridge with "Attn of: Engine Team" on the box...
22:55
< Syka_>
"GUYS we found this brilliant new language"
22:55
< RichyB>
Moltare, er, please excuse Python instead of C because it's quicker to write: http://pastebin.starforge.co.uk/589
22:55
< Syka_>
<engine goes on to make a distinctly incompatible lua>
22:55 ErikMesoy is now known as ErikMesoy|sleep
22:55
< Moltare>
heh
22:55
<@Reiv>
TW: Which company >_>
22:55
<@TheWatcher>
(Idly mol, what /is/ runescape's engine written in? Or do I not want to know?)
22:55
< RichyB>
Moltare, oh and be aware that "for i in range(0, 8)" in Python means the same thing as "for i in [0, 1, 2, 3, 4, 5, 6, 7]" - range() doesn't include the top.
22:56
< RichyB>
TheWatcher, google says Java! ^_^
22:56
< Moltare>
Mostly Java, TW.
22:56
<@TheWatcher>
Ohgods
22:56
< Moltare>
Bits of C here and there
22:56
< RichyB>
Meh
22:56
<@Reiv>
Hey now
22:56
< Syka_>
jerver
22:56
<@Reiv>
When it first released, this was an astonishingly positive feature!
22:56
< RichyB>
Java has typically sucked fat rocks client-side
22:56
< Moltare>
Cheers, Richy
22:56
<@Reiv>
It meant it could run browser-based and platform agnostic!
22:56
< RichyB>
but really you should see the Puppygames games
22:56
<@Reiv>
Not many games can claim *that*, eh?
22:56
<@Reiv>
ohshitunity
22:56
<&ToxicFrog>
Syka_: there is an existing high-performanc elua implementation for the JVM for the VM that they can use!
22:57
< Syka_>
ToxicFrog: screw that, nih
22:57
< RichyB>
e.g. Puppygames' "Revenge of the Titans" is a java webstart application
22:57
< RichyB>
it actually has sensible loading times and smooth animation.
22:57
<@TheWatcher>
!
22:57
< Syka_>
rott got an update recently
22:57
< Syka_>
apparently it is hard as fuck
22:58
<&ToxicFrog>
Unfortunately RoTT, itself, sucks hugely
22:58
< RichyB>
Surprisingly enough, if you care about performance in the first place, it's really not very hard to get very good performance out of the JVM.
22:58
< Syka_>
out, or outside? :D
22:58
<&McMartin>
Out
22:58
<&ToxicFrog>
RichyB: provided you don't have hard realtime constraints, in which case trying to tune the gc to not pause you at innoportune times will make you weep tears of blood
22:58
< Syka_>
I was making a joke that java is slow :(
22:58
<&ToxicFrog>
Or so the platforms team tells me
22:59
<&McMartin>
I'd use Spiral Knights as my first example of Java working as a platform for soft realtime
22:59
< RichyB>
ToxicFrog, sorry, I'll amend that statement to be strictly accurate.
22:59
<&ToxicFrog>
Syka_: the thing is, the JVM is actually quite fast.
22:59
<&ToxicFrog>
Memory-hungry, but fas.t
22:59
< Syka_>
yeah
22:59
< Syka_>
JIT will do that
22:59
<&McMartin>
dynamic JIT even more so, especially for middleware
22:59
< RichyB>
If you care about performance in the first place, it's really not all that hard to get very good throughput out of the JVM.
22:59
< Syka_>
it's too bad that Java lends itself to people writing terrible code on top
23:00
< Syka_>
augh 6am, time for nap
23:01
<&ToxicFrog>
McMartin: Chrome - the FPS - predates Spiral Knights by some years and is mostly Java
23:01
< RichyB>
ToxicFrog, IMHO hard realtime is another matter entirely. For that use case, you have to mandate strictly no GC and no bloody paging either. Write your application in something with manual memory management (*) and either on bare hardware or with an OS that's been carefully cleared out to make sure it will never try to take a page away from you in the first place. :P
23:02
<&McMartin>
RichyB: I have to admit, when I've programmed under hard realtime constraints, I did it by *having no heap* and barely having a stack
23:03
<~Vornicus>
wait, if you have no heap and barely a stack where do you keep stuff
23:03
< RichyB>
(For reference, I'm going by the distinction: "soft realtime" -> "your program has deadlines and must meet at least N% of them to be useful" and "hard realtime" -> "your program has deadlines and must meet all of them or it is useless"
23:03
<&McMartin>
Vorn: The .bss segment
23:03
<&McMartin>
Or, more formally, "global statics"
23:03
< RichyB>
e.g. algorithmic trading is soft real-time; when you miss a deadline by a millisecond you lose some money, but you can make it back if you miss sufficiently few.
23:03
<&McMartin>
(In practice: "I'm writing for an 8-bit console, so I just specify raw addresses")
23:05
< RichyB>
"No heap" means "no dynamic memory allocation", but perfectly happily allows you to use as many preallocated arrays as you wish. Global statics FTW.
23:05
<~Vornicus>
So basically for hard realtime you're making sure all your memory is where it needs to be at the start.
23:05
<~Vornicus>
Checkarooni.
23:05
< RichyB>
Yes.
23:06
<&McMartin>
Hard realtime means "you cannot take more than X microseconds to run this function"
23:06
< RichyB>
McMartin, what'd you work on that was hard-realtime?
23:06
<&McMartin>
That tends to mean things like "you do not get to have pointer-chase data structures"
23:06
<&McMartin>
RichyB: I've done a few small programs for the Atari 2600, which has to throw its own VBLANKs in software.
23:06
< RichyB>
Eh, not if you can prove an upper bound on how many pointers you will chase.
23:07
<&McMartin>
Well, true, but if you can do that you can pre-allocate it~
23:08
< RichyB>
We already assumed pre-allocation because malloc() with arbitrary sizes is forbidden because searching the freelist can cause unbounded pauses.
23:09
< RichyB>
I just meant that you are not categorically banned from using any pointers anywhere.
23:09
<&McMartin>
Well, sure
23:09
<&McMartin>
But that seems to mostly be used as call-by-reference or block-transfer in a bounded loop
23:09
<&McMartin>
Arrays are pointers, most of the time, too
23:10
<&McMartin>
(This is complicated by 6502 pointers being Kind Of Shit)
23:10
< RichyB>
Anyway, a more interesting fine-point: "real-time" does not always mean fast, just bounded-time. A program that has 1000ms deadlines but may never ever miss one is still hard-real-time.
23:11
<~Vornicus>
hooray, long and short pointers
23:11
<&McMartin>
Vorn: That's x86
23:11
<&McMartin>
On 6502, pointers cannot live in registers, and must live only in the first 256 bytes of memory, which are thus usually under heavy contention
23:12
<&McMartin>
In order to dereference such a pointer you also have to trash 2/3s of your registers, because there is no unindexed dereference that isn't Jump Indirect.
23:12
< RichyB>
But they may index anywhere into a full 65536 byte range?
23:12
<&McMartin>
Yes.
23:12
<&McMartin>
Into *the* full, because it's an 8-bit machine and so 64K is all it can address.
23:12
<&McMartin>
In practice, almost nothing with a 6502 chip had that much stuff.
23:12
< RichyB>
4k?
23:13
<&McMartin>
The NES had 2KB, and the Atari 2600 had 128 bytes.
23:13
<&McMartin>
On the plus side, that meant you could use all of the 2600's RAM as a pointer if you wanted~
23:14
<&McMartin>
The late-era Apple IIs and the C128 both had 128KB bankswitched
23:14
<&McMartin>
The C64 had a full 64KB and you had to bankswitch to get at it, since you also needed room for I/O and the BASIC ROM and the !BIOS.
23:20
<@Reiv>
bankswitched?
23:21
<&McMartin>
So, on the C64, for example, normally the BASIC interpreter is a 4K ROM chip that lives at $A000-$BFFF
23:21
<&McMartin>
If you flip a bit in location $0000, which is bankswitch control, you can make $A000-$BFFF instead point to a chunk of RAM.
23:22
<&McMartin>
(The same chunk of RAM every time, mind you; being able to juggle physical memory across various addresses comes later)
23:23
<&McMartin>
It's nice to turn BASIC off, if you're writing in pure machine code or some compiled language with its own runtime, because then you have a contiguous chunk of RAM from $0800 to $CFFF.
23:23
<&McMartin>
50 whole kilobytes!
23:24
<&McMartin>
Bankswitching generally is having a chunk of address space swap between various things depending on some external control.
23:25
<&McMartin>
The NES tended to switch out ROM chips that way on most of its carts; Gradius, for instance, had one bank of graphics for text and one for each level's tileset graphics; it would switch graphics banks twice a frame, alternating between the text one (for drawing the score, etc) and one of the level tilesets (depending on the level).
23:26
<&McMartin>
Without that, the NES only had 32KB of code and 16KB of graphics available, and very few games could fit in that.
23:26
<&McMartin>
Super Mario Brothers only managed it by hiding some code it needed in the graphics code and copying it out to RAM and executing it. -_-
23:26
<&McMartin>
And in the early 1990s in the twilight of the platform, some games managed to hit a full megabyte.
23:26
<&McMartin>
I think Kirby's Adventure was one of them.
23:26 * Reiv scratches his head.
23:27
<~Vornicus>
Kirby's Adventure, Dragon Warrior 4, uh...
23:27
<@Reiv>
Ssso you hit a full megabyte by pulling bits out and swapping in whole new chunks of stuff each cycle?
23:27
<~Vornicus>
Well, also and Not Needing more than one or two chunks at a time.
23:28
<@Reiv>
Where did the rest of this megabyte come from?
23:28
<@Reiv>
Was this "storage capacity is increasing even if the hardware we're running on hasn't" or something
23:28
< RichyB>
Yes. Switching banks doesn't have much latency on those systems, but also you design the game to use its data only piecemeal.
23:29
<&McMartin>
Reiv: When your system is made entirely of RAM, this is called "overlays"
23:29
<@Reiv>
whut
23:29
< RichyB>
In hardware, you're looking at something along the lines of, say: a big bank of ROM with 20 address pins (1MiB), switched in 16kiB banks (14 pins),
23:30
<&McMartin>
RichyB: Also, while it doesn't take much time, you're often under *extreme* time requirements. It takes multiple microseconds to do it and if you don't fit it exactly within an HBLANK you'll get graphical artifacting
23:30
<&McMartin>
HBLANKs are Not Many Microseconds Long.
23:30
< RichyB>
Your CPU is wired up so that at any given point in time, 16kiB of your 64kiB address space maps to these 14 address pins on the ROM, right?
23:31
< RichyB>
There's a hardware register that you can write to somewhere, which is 6 bits long.
23:31
< RichyB>
The contents of that register are presented on the top 6 address lines of the big ROM chip, the ones that you can't control directly.
23:32
< RichyB>
Every time you load a new value into that register, you have switched banks! Subsequent fetches from the ROM address space will find data from the new page.
23:32
< RichyB>
Reiv, does that description of how one might implement bank-switching in hardware work for you?
23:34
<@Reiv>
Iiii seee.
23:34
<@Reiv>
So yeah, it's "There was more storage on the bottom rack than the top one"
23:34
<@Reiv>
And the trick was people got better at fudging the system to use more and more of that rack psuedo-simultaneously?
23:35
<&McMartin>
More that they did it more
23:35
<&McMartin>
The basic trick doesn't change.
23:36
<&McMartin>
On the NES, you got to provide the hardware that does the switching, so you could evolve that as needed.
23:36
<&McMartin>
The C64 didn't have that, since it was a single machine, but you could swap away *everything* including the BIOS.
23:36
<&McMartin>
(Just remember to swap it back in before making any system calls~)
23:42
<@Reiv>
I... see.
23:42
<@Reiv>
And this is no longer done because the amount of memory available is Plenty and the speed of switching would be Abysmal?
23:43
<&McMartin>
Er
23:43
<&McMartin>
That's a large question, actually
23:43
<&McMartin>
(1) We don't do it anymore directly because we can now address more RAM than we can cram into a machine; 64-bit OSes wouldn't need to start doing this until you had more than 16 exabytes of RAM.
23:44
<&McMartin>
(2) There isn't actually a direct mapping of address to Chunk Of RAM anymore; this is what Virtual Memory does. Addresses are part of a process, and the chip usually handles translating a process's address into which bit of RAM to use
23:44
<&McMartin>
(2a) Except it doesn't do that, because accessing RAM is slow compared to CPUs now, so it actually goes through two layers of on-chip memory cache before looking at memory at all
23:45
<&McMartin>
(2b) ... and in a modern OS it may end up having to pull in memory from disk ("swap") to find the thing referenced.
23:45
<&McMartin>
If you hit case 2(b) a lot, the system is said to be "thrashing" and your performance goes to shit, yes
23:45
<&McMartin>
By a factor of about a million; disk accesses take milliseconds, on-chip cache hits take nanoseconds.
23:46 * Reiv pauses, eyes McMartins #1 comment.
23:46
<@Reiv>
Not to fall for the '64kb is all you'll ever need' cliche, but, uh, wow
23:47
<&McMartin>
It was the next most convenient size after 4GB, which got to be Too Small a while ago~
23:47
<@Reiv>
I take it that the whole 'how many bits' thing is going to become pretty much a non-issue until, like, our /children/ are in IT isn't it
23:47
<&McMartin>
And it will start with disk storage, not RAM
23:47
<@Reiv>
Which is interesting given I have been on machines since the days of 8-bit, and tinkering with the hardware since 16-bit (shut up we were poor~)
23:47 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
23:48
<@Reiv>
Oh, yeah. OK. I can see us actually running outta exabytes there.
23:48
<@Reiv>
Though we've long had file systems with bigger address spaces than our OSes haven't we
23:48
<&McMartin>
That is, essentially, what Bankswitching is for.
23:48
<@Reiv>
Unless I've confused how NTFS et al worked on the old 32-bit XP etc
23:48
<&McMartin>
Except instead of "file systems" it's "ROM Chips with the program in"
23:49
<&McMartin>
Yeah, file offsets don't have to fit in a machine word
23:49
<&McMartin>
Pointers, however, generally do
23:49
<@Reiv>
... Oh I /see/ OK I think I get it
23:49
<&McMartin>
And on modern systems the chip designs how memory accesses work so that an address actually goes through a couple layers of translation
23:49
<@Reiv>
But yeah: We've lived through 8-bit to 64 RAM.
23:50
<&McMartin>
So RAM is divided up into 4KB or so chunks and you can map them *arbitrarily* to 32- or 64-bit addresses
23:50
<&McMartin>
When your OS taskswitches, the mapping of addresses to RAM changes, and stuff that Isn't Yours doesn't show up at all, etc.
23:50
<&McMartin>
This is how a wild pointer in one process doesn't trash your OS's core data, etc.
23:50
<@Reiv>
This... isn't actually going to be a Thing any more going forward is it~
23:50
<&McMartin>
Only for emulation and embedded applications
23:51
<&McMartin>
I have no idea whether we'll be in a what's-old-is-new-again state, but if we do it'll be for things like smartwatches
23:52
<@Reiv>
Fair point.
23:52
< RichyB>
McMartin, 3 layers now, L3 cache is pretty common. :)
23:56
<&McMartin>
OK, sure~
23:56
<&McMartin>
I took my OS/arch class in, what, '98~
23:56 thalasleep is now known as Thalass
23:57
<@Tarinaky>
http://developerexcuses.com/
23:57
<@Tarinaky>
"It can't be broken, it passes all unit tests"
--- Log closed Fri Sep 06 00:00:46 2013
code logs -> 2013 -> Thu, 05 Sep 2013< code.20130904.log - code.20130906.log >

[ Latest log file ]