Level Viewer/ Map Creator (Python)

Tools, Editors and other programs around SMC.

Moderator: SMC Team

Level Viewer/ Map Creator (Python)

Postby BowserJr » 07 Jul 2010 17:20

Inspired a bit by this: viewtopic.php?f=8&t=1541 and probably some other things, I've written a Python script to read levels and draw them from in-game images to make one huge image.

Example huge images (actually, these are hugely resized, the originals are ~8500x1500, but I don't know where to host them. Right-click > View image to make them slightly bigger. Make your own to see them full-sized. :P):
Image
Level 1
Image
Winter Wonderland

You'll need Python (http://www.python.org/) and PIL (http://www.pythonware.com/products/pil/) to run these.

The code is X11/MIT licensed, which is GPL compatible, but more permissive. The GPL is longer than the source code, so there didn't seem to be much point using it.

Hopefully people will be able to do fun stuff with these images.

Read the README for information on how to set up and run.

Tested in Windows XP and Linux on Python 2.6. I'd like people to test on other OSes to confirm it still works.

If it's taking a long time to generate an image, check the terminal output. It's probably camera limit related (rendering the gradients takes ages for large levels). Hopefully this will encourage people to make sane camera limits.

If a level doesn't look right, or doesn't render at all, please report it here with terminal output and the level file.

Enjoy.
Attachments
lvlview.zip
Code
(9.45 KiB) Downloaded 276 times
"Plants need to have water poured on them because they have no hands to hold glasses of water."
User avatar
BowserJr
SMC Team
SMC Team
 
Posts: 1543
Joined: 05 Feb 2007 14:07
Location: London, UK

Re: Level Viewer/ Map Creator (Python)

Postby Luigifan » 08 Jul 2010 11:02

It does only the background :arrow:

lvl_2_sub_1.png
lvl_2_sub_1.png (11 KiB) Viewed 8213 times
:(

Tested in Win 7 :]]
Im From Germany so my English is not very good : )
User avatar
Luigifan
Eato
Eato
 
Posts: 53
Joined: 24 Jun 2009 15:31
Location: Deutschland

Re: Level Viewer/ Map Creator (Python)

Postby BowserJr » 08 Jul 2010 13:08

Probably the smcdir in config.xml is wrong. It should be the directory containing the pixmaps folder, not the actual pixmaps folder. 8)
"Plants need to have water poured on them because they have no hands to hold glasses of water."
User avatar
BowserJr
SMC Team
SMC Team
 
Posts: 1543
Joined: 05 Feb 2007 14:07
Location: London, UK

Re: Level Viewer/ Map Creator (Python)

Postby Luiji » 08 Jul 2010 15:04

Awesome program. This would be an interesting addition to a dynamic level host.
Custom Built IBM-Compatible (Arch Linux w/ KDE)
Dell Vostro (Windows 7)
Dell Inspiron 1440 (Windows Server 2003, Debian w/ KDE)
Dell Inspiron 11z (Linux Mint)
Luiji
MVP
MVP
 
Posts: 2703
Joined: 14 Jan 2010 23:20
Location: The Mushroom Kyngdom

Re: Level Viewer/ Map Creator (Python)

Postby mrvertigo27 » 08 Jul 2010 15:10

great addition to a comprehensive level guide! what i dont like about it is it might give away secrets if run on some levels.
I'm A YouTube Gaming Commentator https://www.youtube.com/user/Spitfire25565
User avatar
mrvertigo27
SMC Team
SMC Team
 
Posts: 2316
Joined: 20 Aug 2009 16:10
Location: the state of insanity

Re: Level Viewer/ Map Creator (Python)

Postby Luigifan » 08 Jul 2010 17:44

Oh thank you :!: :!:
Its the data folder i need to choose :s-a: :]]
:lshroom: Now it works :lshroom:
Im From Germany so my English is not very good : )
User avatar
Luigifan
Eato
Eato
 
Posts: 53
Joined: 24 Jun 2009 15:31
Location: Deutschland

Re: Level Viewer/ Map Creator (Python)

Postby FluXy » 19 Aug 2010 08:31

Cool :)

Now where are the walkthrough's with complete level images ? :nutcase:
If i didn't read your post but it was important you can send me a PM.
Any Donation will help this project!
User avatar
FluXy
Admin
Admin
 
Posts: 2857
Joined: 04 May 2004 19:44
Location: Germany

Re: Level Viewer/ Map Creator (Python)

Postby mrvertigo27 » 19 Aug 2010 14:56

this would also be cool for putting levels on coffee mugs as long as the image is allowed to wrap around the mug...
I'm A YouTube Gaming Commentator https://www.youtube.com/user/Spitfire25565
User avatar
mrvertigo27
SMC Team
SMC Team
 
Posts: 2316
Joined: 20 Aug 2009 16:10
Location: the state of insanity

Re: Level Viewer/ Map Creator (Python)

Postby Luiji » 19 Aug 2010 17:09

A coffee mug with our levels on it?! AWESOME.
Custom Built IBM-Compatible (Arch Linux w/ KDE)
Dell Vostro (Windows 7)
Dell Inspiron 1440 (Windows Server 2003, Debian w/ KDE)
Dell Inspiron 11z (Linux Mint)
Luiji
MVP
MVP
 
Posts: 2703
Joined: 14 Jan 2010 23:20
Location: The Mushroom Kyngdom

Re: Level Viewer/ Map Creator (Python)

Postby hutty » 24 Aug 2010 21:04

I want one with level 2 !!!!!
Please note I am a very busy person and may disappear for months at times....
If I vanished and you want something I was working on completed..... just PM me
PM reaches my email and that will shove SMC up in my priority.
current Project -- Dandelions

1 cloud world Awaiting restart
2 fallground Awaiting restart
3 overworld green Awaiting restart
4 crystal world Awaiting restart
User avatar
hutty
Static Saw
Static Saw
 
Posts: 203
Joined: 06 Apr 2010 13:52

Re: Level Viewer/ Map Creator (Python)

Postby smc_gamer » 24 Aug 2010 21:26

lvl_2 map is made. :)
It's a bit big, though (1,525 KB).

Oh, and the folder containing pixmaps in Windows is C:\Program Files\Secret Maryo Chronicles\data. It's the first path in config.xml
Attachments
lvl_2.zip
lvl_2 Map
(1.49 MiB) Downloaded 250 times
smc_gamer
Blog | "If good things lasted forever, would we appreciate how precious they are?" -Hobbes
User avatar
smc_gamer
Static Saw
Static Saw
 
Posts: 245
Joined: 15 Aug 2010 13:49
Location: United States

Re: Level Viewer/ Map Creator (Python)

Postby rinscewind » 12 Sep 2010 19:06

Is there any reason that Python 3 can't be used? 2.6.6 final is listed at the link you posted, but 3.2 alpha 2 is available as well. I don't write scripts, etc, but sometimes new versions are a bit different from older ones and so problems can arise in trying to run apps/scripts/etc.

I guess I should rephrase the question to 'What is the difference, if any, between using 2.6.6 final and the new 3s for your level imager?'.
Never judge a man until you have walked a mile in his shoes. Then go ahead ... you will be a mile away, and will also have his shoes.
User avatar
rinscewind
Turtle Shell green
Turtle Shell green
 
Posts: 34
Joined: 30 Sep 2008 07:31

Re: Level Viewer/ Map Creator (Python)

Postby BowserJr » 12 Sep 2010 20:54

Python 3 isn't final yet. Most Linux distros still use 2.6 as the default. There are a few API differences, and 2.6 is what I am more familiar with. I haven't really studied 3, and I don't think it has any advantages for a project like this. 2.6 is just what I did my testing on, so I didn't fancy coding for 3 as well.

One thing I do want to do is to rewrite the code to throw exceptions on failure instead of just printing to terminal, but I'll need some time, and I don't have a lot right now.
"Plants need to have water poured on them because they have no hands to hold glasses of water."
User avatar
BowserJr
SMC Team
SMC Team
 
Posts: 1543
Joined: 05 Feb 2007 14:07
Location: London, UK

Re: Level Viewer/ Map Creator (Python)

Postby Luiji » 13 Sep 2010 19:32

2to3.py, which comes with Python 3, will upgrade your code to Python 3 quite well.
Custom Built IBM-Compatible (Arch Linux w/ KDE)
Dell Vostro (Windows 7)
Dell Inspiron 1440 (Windows Server 2003, Debian w/ KDE)
Dell Inspiron 11z (Linux Mint)
Luiji
MVP
MVP
 
Posts: 2703
Joined: 14 Jan 2010 23:20
Location: The Mushroom Kyngdom

Re: Level Viewer/ Map Creator (Python)

Postby rinscewind » 14 Sep 2010 00:58

Thanks
Never judge a man until you have walked a mile in his shoes. Then go ahead ... you will be a mile away, and will also have his shoes.
User avatar
rinscewind
Turtle Shell green
Turtle Shell green
 
Posts: 34
Joined: 30 Sep 2008 07:31


Return to Add-Ons and 3rd Party things

Who is online

Users browsing this forum: No registered users and 1 guest

cron