code logs -> 2009 -> Mon, 13 Apr 2009< code.20090412.log - code.20090414.log >
--- Log opened Mon Apr 13 00:00:34 2009
00:00
<@Derakon>
I guess the first step is to pull out the "how to make this feature" logic at the tunnel level, so it's out of the way when I do the rest of it all.
00:04 McMartin [~mcmartin@Nightstar-19418.dsl.pltn13.sbcglobal.net] has quit [Quit: Reboot]
00:09 McMartin [~mcmartin@Nightstar-19418.dsl.pltn13.sbcglobal.net] has joined #code
00:09 mode/#code [+o McMartin] by ChanServ
00:15 AbuDhabi [~farkoff@Nightstar-29113.neoplus.adsl.tpnet.pl] has quit [Quit: Astro Cat will play for you... the Symphony of Space.]
00:37
<@Derakon>
First pass done; the code that plants seeds for the spacefilling algorithm has been moved into separate modules.
00:45
<@Derakon>
...I'll be exposing a lot of the internals of mapgen to modders with this change. O_o
00:45
<@Derakon>
It's gonna have to go undocumented for a while, though. Code like "if map.blocks[x][y] == 0 and y > x * slope + intercept and (x, y-1) in map.deadSeeds and map.deadSeeds[(x, y-1)].node == sector:" is not particularly self-evident.
00:47
<@Derakon>
And modders who don't know what they're doing will probably break everything many, many times. ¬.¬
00:48 * Derakon finishes making feature creation moddable.
00:48
<@Derakon>
treenode.py is down to 568 lines from 797 lines earlier today.
01:26 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has quit [Quit: Rhamphoryncus]
01:44
<@Derakon>
Man, making configuration files into Python scripts that define dicts is easy. Why didn't I start doing this earlier?
01:46
<@McMartin>
Code injection vulnerabilities?~
01:46
<@Derakon>
I don't think it really qualifies as code injection if you're actually modifying the source that gets executed.
01:47
<@Derakon>
But yeah, sandboxing this is pretty much impossible AFAICT.
01:50
<@Vornicus>
Eh. If you're pulling in dicts of plain data, you're probably better off with JSON.
01:51
<@Derakon>
Hm...yeah, I bet there's a JSON library for Python. Good thinking.
01:51
<@Derakon>
Of course, JSON won't cover the dynamically-imported modules for modifying mapgen.
01:52
<@Derakon>
Since those aren't just simple dicts of data.
01:52
<@Vornicus>
true.
01:59
<@Derakon>
I'm not too worried, though, since I won't be allowing modified code to be run on the unregistered version, and if they're modifying the registered version, what do I care?
02:07
<@Derakon>
I need an algorithm that, given a set of ranges along the Y axis, places a dot down on the X-Y plane for each range, such that each dot is inside one of the ranges (1:1 mapping) and each dot is as far from the other dots as possible (or reasonably close, anyway).
02:07
<@Derakon>
Anyone know of something I could adapt to this problem?
02:09
<@Vornicus>
Without a constraint on the X, you can make the distances arbitrarily large.
02:09
<@Derakon>
X and Y are constrained to the range [0, 1].
02:10
<@Vornicus>
Well you could always use a gravity algorithm.
02:10
<@Vornicus>
With repulsion only.
02:11
<@Derakon>
So...just plop them down randomly in their ranges, then run a few hundred cycles of each point repelling the other points (while the points don't leave their ranges)?
02:14
<@Vornicus>
Yep.
02:15
<@Derakon>
It seems like it might be possible to get two points "cornered" close to each other...
02:16
<@Derakon>
...actually, since ranges are just along the Y axis, forget I said anything.
03:04
<@Derakon>
GG Python.
03:04
<@Derakon>
for foo in bar: range = foo['elevationRange']; doSomethingWithRange();
03:04
<@Derakon>
for i in range(0, 100):
03:05
<@Derakon>
TypeError: 'list' object not callable
03:05
<@Derakon>
It's out of scope, dangit!
03:08
<@Vornicus>
No it's not
03:08
<@Derakon>
Sorry, I didn't indicate my indentation properly.
03:08
<@Derakon>
for foo in bar:
03:08
<@Vornicus>
It's still not.
03:08
<@Derakon>
range = foo['elevationRange']
03:08
<@Derakon>
doSomethingWithRange()
03:08
<@Derakon>
for i in range(0, 100):
03:08
<@Vornicus>
Not out of scope.
03:08
<@Derakon>
...what.
03:09
<@Vornicus>
Python has scope according to the most local of the following: function, class, module.
03:09
<@Derakon>
There's no "block" scope?
03:09
<@Vornicus>
Indeed not.
03:09
<@Derakon>
That is...unusual and important.
03:09 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Ping Timeout]
03:09
<@Vornicus>
Nor would you want one in a language where you don't declare variables.
03:10 SmithKurosaki [~jess@Nightstar-26868.acanac.net] has quit [Operation timed out]
03:10
<@Derakon>
Variables are declared by assigning to them.
03:10
<@Vornicus>
Right
03:10
<@Vornicus>
You don't want to have to do this:
03:11
<@Vornicus>
def foo(bar, baz): qux = None if bar: qux = baz.a;; else: qux = something_else;; do_something(qux)
03:12
<@Vornicus>
in Python you don't need the qux = None statement, despite qux not being placed directly in that block.
03:12
<@Derakon>
What's wrong with that?
03:13
<@Vornicus>
The point is that block scoping can give very strange behavior when you don't have to declare variables.
03:13
<@Derakon>
I'd rather have qux = None be a requirement, and then have trying to use qux outside of the wrong block scope cause an error, than accidentally use the wrong qux because I forgot to set up the right one.
03:16
<@Vornicus>
The other problem is you're using a builtin name, which is just bad juju.
03:16
<@Derakon>
Yeah, yeah.
03:17
<@Derakon>
It's such a handy name though!
03:25 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
03:25 mode/#code [+o ToxicFrog] by ChanServ
03:28 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Ping Timeout]
03:28 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Quit: Z?]
03:39 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Quit: <Insert Humorous and/or serious exit message here>]
03:43 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
03:43 mode/#code [+o ToxicFrog] by ChanServ
03:51
<@Derakon>
Aaaaand I just got bitten by a variable staying in scope after I'd thought it had left.
03:53
<@Derakon>
Okay, the reverse-gravity thing seems to work OK...
03:53
<@Derakon>
Preliminary tests with four zones puts them down pretty optimally, anyway.
03:54 * Derakon adds two more zones, discovers that nothing is getting placed in the middle of the domain.
03:56
<@Derakon>
I guess that makes a certain amount of sense, though.
04:28 Tarinaky [~Tarinaky@Nightstar-16638.plus.com] has quit [Client exited]
05:36 SmithKurosaki [~jess@Nightstar-24295.acanac.net] has joined #code
06:02 Syloqs-AFH [Syloq@Admin.Nightstar.Net] has quit [Connection reset by peer]
07:07 Derakon is now known as Derakon[AFK]
07:40 somnolence [~somnolenc@Nightstar-3790.hsd1.ca.comcast.net] has joined #code
08:28 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has joined #code
08:52 AnnoDomini [~farkoff@Nightstar-29113.neoplus.adsl.tpnet.pl] has joined #Code
08:52 mode/#code [+o AnnoDomini] by ChanServ
09:36 Vornicus [Vornicus@Admin.Nightstar.Net] has quit [Quit: ]
09:50 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has quit [Quit: Rhamphoryncus]
11:14 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
11:14 mode/#code [+o Attilla] by ChanServ
11:57 Reiver [~reaverta@Admin.Nightstar.Net] has quit [Quit: Reblooting... wish me luck.]
12:01 Reiver [~reaverta@Admin.Nightstar.Net] has joined #Code
12:01 mode/#code [+o Reiver] by ChanServ
12:07 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
12:07 mode/#code [+o gnolam] by ChanServ
13:34 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Connection reset by peer]
13:34 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
13:34 mode/#code [+o Attilla] by ChanServ
13:36 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Connection reset by peer]
13:37 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
15:51
<@gnolam>
VGUI-y goodness: http://www.cyd.liu.se/~torha229/RadiaX/rad_dorm0002.jpg
15:54
<@gnolam>
(And kids, putting a 40 GBq Cs-137 source in the shower in your apartment is bad, mmkay, so don't try this at home.)
15:59
<@gnolam>
And no, the analog and digital readouts shouldn't match. They work on different integration time steps.
16:04 Syloq [Syloq@Admin.Nightstar.Net] has joined #code
16:05 Syloq is now known as Syloqs-AFH
16:25 Derakon[AFK] is now known as Derakon
16:37 Tarinaky [~Tarinaky@88.83.110.ns-10776] has joined #code
16:53 turkeyy [~turkish@Nightstar-10159.h195-5-116-185.fiber.ee] has joined #code
16:54 Tarinaky [~Tarinaky@88.83.110.ns-10776] has quit [Client exited]
16:56 Tarinaky [~Tarinaky@88.83.110.ns-10776] has joined #code
17:19 * Derakon ponders how to go about placing regions inside of zones (zones being areas like "jungle" or "surface" or "underwater" and regions being more tightly-themed, like "grass" or "beach" or "constructed base").
17:20 simontwo [~simon@Nightstar-28088.diogenes.hacklab.dk] has joined #code
17:20
<@Derakon>
I'd like to be able to control relative region size, I think. But I need to make certain that the regions I select fill the zone.
17:21
< simontwo>
Derakon, is your game starting to span several virtual screens?
17:21
<@Derakon>
I don't understand the question.
17:21
<@Derakon>
The mazes have been bigger than one screen for quite some time now.
17:22
< simontwo>
oh, this isn't your spaceship game?
17:22
<@Derakon>
No.
17:22
< simontwo>
cool.
17:22
< simontwo>
got a screenshot then?
17:22
<@Derakon>
You...haven't been keeping up with this channel, have you? :p
17:23
< simontwo>
no. just came back from vacation. :) it's probably a month ago since I was last here.
17:23
<@Derakon>
http://derakon.dyndns.org/~chriswei/games/jbrl/collision/player10.gif
17:23
<@Derakon>
(4MB GIF)
17:24
< simontwo>
impressive.
17:24
< simontwo>
did you also make the graphics?
17:24
<@Derakon>
Yes.
17:30 turkeyy [~turkish@Nightstar-10159.h195-5-116-185.fiber.ee] has quit [Client exited]
18:36 You're now known as TheWatcher
18:37 somnolence [~somnolenc@Nightstar-3790.hsd1.ca.comcast.net] has quit [Ping Timeout]
18:48 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has joined #code
18:51 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Ping Timeout]
18:52 MyCatVerbs is now known as Tumbleweed
18:53 Tumbleweed is now known as MyCatVerbs
19:11 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
19:11 mode/#code [+o Attilla] by ChanServ
19:59 Derakon [~Derakon@Nightstar-4912.hsd1.ca.comcast.net] has quit [Quit: Leaving]
20:06 AnnoDomini [~farkoff@Nightstar-29113.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
20:07 AnnoDomini [~farkoff@Nightstar-29113.neoplus.adsl.tpnet.pl] has joined #Code
20:07 mode/#code [+o AnnoDomini] by ChanServ
20:15 Derakon [~Derakon@Nightstar-4912.hsd1.ca.comcast.net] has joined #code
20:15 mode/#code [+o Derakon] by ChanServ
21:21
<@AnnoDomini>
How does one declare functions in VHDL?
21:22
<@AnnoDomini>
More to the point, I want to know where in a design file I should put them.
21:32
<@AnnoDomini>
Nevermind, found it.
21:37 You're now known as TheWatcher[T-2]
21:38 You're now known as TheWatcher[zZzZ]
21:40
<@Derakon>
Behold! Is it not a thing of beauty? >.> http://derakon.dyndns.org/~chriswei/games/jbrl/mapgen30a.png
21:41
<@AnnoDomini>
A mother loves her children.
21:41
<@Derakon>
Hee.
21:42
<@Derakon>
I'm placing regions of the map down; green is jungle, red is lava-hotzone, grey is tech-hotzone.
21:46
<@Derakon>
The main issue with this approach is that it tends to make isolated chunks of the less-common regions, whereas I'd prefer a method that makes contiguous, smaller regions.
22:43
< Rhamphoryncus>
.. it looks interesting but I have no idea what you're doing :)
23:12
<@Derakon>
Consider each colored area to be a particular type of terrain.
23:12
<@Derakon>
E.g. dirt and grass, or rock, or metal plating.
23:13
<@Derakon>
The idea is to place these regions down semi-randomly, such that each region is roughly the size dictated in the config file.
23:13
<@Derakon>
The grey region is supposed to be about 25% the size of the red region...which it is, but it's all broken up ATM.
23:17 * Derakon ponders a swapping mechanism.
23:17
<@Derakon>
It should be fairly evident, when you look at it, that those regions are roughly laid out on a grid.
23:18
<@Derakon>
I'm starting from seeds of size 1 and expanding them out to make these regions.
23:18
<@Derakon>
What I could do is find isolated seeds and swap them around so they're next to seeds of like type. But that seems...clunky.
23:19
<@Derakon>
It'd be better to simply lay down all the seeds for a given type at once...but then I have to change my seeding algorithm (which is just doing a "go across and down" rows/columns thing at the moment) to be something much more complicated. :\
23:22 Consul [~consul@Nightstar-26965.dsl.sfldmi.ameritech.net] has quit [Quit: Leaving]
23:46
<@AnnoDomini>
Okay, this is just plain funky. How am I supposed to understand this: "(X1 xor X2) or (X3 xor X4) or (X5 xor X6)" when the result is supposed to be a single bit?
23:47
<@Derakon>
X1 through X6 are presumably all also single bits.
23:47
<@AnnoDomini>
Nope.
23:47
<@AnnoDomini>
They're bit vectors.
23:47
<@AnnoDomini>
Forgot to mention.
23:48
<@Derakon>
Okay, then presumably you take that result, if if it's nonzero, return 1, else return 0.
23:51
<@AnnoDomini>
Hmmm. Thanks.
23:51
<@AnnoDomini>
I'll try that.
23:55 KBot [~karma.bot@Nightstar-29374.neoplus.adsl.tpnet.pl] has joined #Code
23:57 KarmaBot [AnnoDomini@Nightstar-29113.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
23:57 AnnoDomini [~farkoff@Nightstar-29113.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
23:58
<@Derakon>
Perhaps this'll make my current project more evident. Compare http://derakon.dyndns.org/~chriswei/games/jbrl/mapgen30b.png to http://derakon.dyndns.org/~chriswei/games/jbrl/mapgen30c.png
23:58 KBot is now known as KarmaBot
--- Log closed Tue Apr 14 00:00:45 2009
code logs -> 2009 -> Mon, 13 Apr 2009< code.20090412.log - code.20090414.log >