Re: [pygame] map format

2006-12-20 Thread Greg Ewing
Chris Smith wrote: Not that I enjoy being a chinese grammer nazi, but of course there are 3 unicode characters needed for 'hill' - xiao, shan and po. Bugger. Well, I suppose that means that your smallest hill will just have to be 3 hexes wide. -- Greg

Re: [pygame] map format

2006-12-20 Thread Chris Smith
On 12/19/06, Greg Ewing <[EMAIL PROTECTED]> wrote: Farai Aschwanden wrote: > I wanted to use such a system too, but 2 points stopped me using it: > 1. Its restricted to the charset (well 256 chars is quite a lot) Unicode! Then you can use the Chinese characters for water, grass, hill, etc. Muc

Re: [pygame] map format

2006-12-19 Thread Greg Ewing
Farai Aschwanden wrote: I wanted to use such a system too, but 2 points stopped me using it: 1. Its restricted to the charset (well 256 chars is quite a lot) Unicode! Then you can use the Chinese characters for water, grass, hill, etc. Much more readable. :-) -- Greg Ewing, Computer Science D

Re: [pygame] map format

2006-12-19 Thread Farai Aschwanden
Am 19.12.2006 um 20:13 schrieb Marius Gedminas: On Tue, Dec 19, 2006 at 06:59:21PM +0100, Farai Aschwanden wrote: I wanted to use such a system too, but 2 points stopped me using it: 1. Its restricted to the charset (well 256 chars is quite a lot) You could use pairs of characters. Or tripl

Re: [pygame] map format

2006-12-19 Thread Marius Gedminas
On Tue, Dec 19, 2006 at 06:59:21PM +0100, Farai Aschwanden wrote: > I wanted to use such a system too, but 2 points stopped me using it: > 1. Its restricted to the charset (well 256 chars is quite a lot) You could use pairs of characters. Or triplets, or whatever. > 2. Interprete char signs that

Re: [pygame] map format

2006-12-19 Thread Farai Aschwanden
Hmmm, just checking the manual of marshal, looks like a Python wrapper with some restriction: - Details of the format are undocumented on purpose; it may change between Python versions (although it rarely does) - This is not a general ``persistence'' module. ->... For persistence use the pic

Re: [pygame] map format

2006-12-19 Thread Farai Aschwanden
I wanted to use such a system too, but 2 points stopped me using it: 1. Its restricted to the charset (well 256 chars is quite a lot) 2. Interprete char signs that way can be expensive: if "$" then print image x if "*" then print image y if Am 19.12.2006 um 03:47 schrieb Jasper: I use a ma

Re: [pygame] map format

2006-12-19 Thread Jakub Piotr Cłapa
Jasper wrote: Arg! I hate thunderbird. Paste is as quotation (Ctrl-Shift-V or Cmd-Shift-V) and remove the "> "s. I can't guarantee efficiency though. ;] -- regards, Jakub Piotr Cłapa

Re: [pygame] map format

2006-12-18 Thread Greg Ewing
Richard Jones wrote: Consider reducing your data down to Python builtin types (list, dict, etc.) and use the marshal module instead. It's faster and has none of the potential hassles of pickling. Although be warned that the marshal format is not guaranteed to remain the same across Python ver

Re: [pygame] map format

2006-12-18 Thread Jasper
Arg! I hate thunderbird. To avoid further screw-ups, I've just posted the source for the larger map here (which is actually a .py file): http://brass-golem.com/wp-content/uploads/2006/12/showmap.txt Ignore the comments about kludges... -Jasper Jasper wrote: G, my code got it's line break

Re: [pygame] map format

2006-12-18 Thread Jasper
G, my code got it's line breaks mangled. Try #2: symbolToTerrain = { '_' : Plains, '@' : Fertile, '+' : Desert, '^' : Mountains, '*' : Hills, '$' : Forest, '%' : Water, '~' : River, '&' : WideRiver, '=' : Roads, '#' : Bridge, '!' : Cliff, } carteString =

Re: [pygame] map format

2006-12-18 Thread Jasper
I use a map serialization format like this (works best with a fixed width font): carteString = '''\ 0 1 2 3 4 5 . . . . . . . . . . . . . . . . . . _ . . . _ . . . _ . 3 . . . . .

Re: [pygame] map format

2006-12-18 Thread Richard Jones
On Tuesday 19 December 2006 04:41, spotter . wrote: > On 12/18/06, Chris Smith <[EMAIL PROTECTED]> wrote: > > I generally make the map file as simple to read and change in a text > > editor as I can. This generally makes the python code to parse the file a > > bit more complex, but since this is do

Re: [pygame] map format

2006-12-18 Thread spotter .
On 12/18/06, Chris Smith <[EMAIL PROTECTED]> wrote: I generally make the map file as simple to read and change in a text editor as I can. This generally makes the python code to parse the file a bit more complex, but since this is done only once at start-up I don't notice any speed issues. Anoth

Re: [pygame] map format

2006-12-18 Thread Chris Smith
I generally make the map file as simple to read and change in a text editor as I can. This generally makes the python code to parse the file a bit more complex, but since this is done only once at start-up I don't notice any speed issues. Another way of doing it is to write a simple map loader th

Re: [pygame] map format

2006-12-17 Thread spotter .
Thanks, I just wanted to make it fast because if I start loading the map at the beginning, it might seem to take a while before the game starts due to parsing and caching. Probably just my computer though, its a bit low on ram :( On 12/17/06, Ethan Glasser-Camp <[EMAIL PROTECTED]> wrote: spotter

Re: [pygame] map format

2006-12-17 Thread spotter .
Ah, thanks for that, I forgot about how python handles leading zeros. I dont want to place any sort of restriction on the meta information incase I have to add more stuff later on, this way it will scale and simply work. On 12/17/06, Farai Aschwanden <[EMAIL PROTECTED]> wrote: Looks ok to me. On

Re: [pygame] map format

2006-12-17 Thread Farai Aschwanden
Looks ok to me. One thing to mention: If you use 001 and 002, etc. it will be turned to 1 and 2 if you read them in (Python treats them as number). So you can safe space using direct number w/o leading zeros. About the metafile. If you can define this in one line why not adding it to the firs

Re: [pygame] map format

2006-12-16 Thread Phil Hassey
I just use .tga files -- and surface.get_at() and surface.set_at(). You get limited to 256 tiles and 4 layers, but I've yet to have that be a problem. Quite adequate for any "small game" -- and it's simple. If you need to upgrade later, you can always change to a text based format that supports

Re: [pygame] map format

2006-12-16 Thread Ethan Glasser-Camp
spotter . wrote: > Hey everybody, > > I am in the process of trying to make a file format for maps. > > The meta file will have the info like name, author, date, version, and > the width and height. > > The other file will have the actual map data in it. This method will be > slower, > since

[pygame] map format

2006-12-16 Thread spotter .
Hey everybody, I am in the process of trying to make a file format for maps. I am doing this right now with this: <10,5> # the width and height <1> # layers 000,001,002,001,002,002,001,000,001,002, 000,001.002,002,002,002,001,000,001,002, 000,001