Graal Forums  

Go Back   Graal Forums > Development Forums > Level Design
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-05-2011, 01:56 AM
jacob_bald6225 jacob_bald6225 is offline
Doctor Who?
jacob_bald6225's Avatar
Join Date: Feb 2002
Posts: 851
jacob_bald6225 is a splendid one to beholdjacob_bald6225 is a splendid one to beholdjacob_bald6225 is a splendid one to beholdjacob_bald6225 is a splendid one to behold
Png2nw

So I worked out how to take a png and turn it into a playable level. I figured I would share.

I took this level(I don't think Bartholomew will mind-- I doubt he even has this level anymore):
http://forums.graalonline.com/forums...ad.php?t=75934

And produce a level(attached)!

Notice how the npcs that were in the screenshot lay down the corner of a block, so this isn't really feasible with a level that has lighting effects or tons of npcs.

Not much else here-- just figured I'd share what I've been working on.


If you have a level that you want recovered from a screenshot throw it in here and ill have a run at it.
Attached Thumbnails
Click image for larger version

Name:	FFFAF.png
Views:	249
Size:	218.1 KB
ID:	52359  
Attached Files
File Type: nw Bartholomew.nw (9.1 KB, 92 views)
__________________
Reply With Quote
  #2  
Old 02-05-2011, 02:40 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Good work. Now release the source.
Reply With Quote
  #3  
Old 02-28-2011, 03:03 AM
Darugo Darugo is offline
hi
Darugo's Avatar
Join Date: May 2007
Posts: 63
Darugo is an unknown quantity at this point
That's awesome Have you tried inputting a screenshot of something that doesn't have a actual tileset?
Reply With Quote
  #4  
Old 02-28-2011, 08:06 AM
Luda Luda is offline
Registered User
Join Date: Aug 2005
Location: Canada
Posts: 2,069
Luda has much to be proud ofLuda has much to be proud ofLuda has much to be proud ofLuda has much to be proud ofLuda has much to be proud ofLuda has much to be proud of
Send a message via AIM to Luda
Pretty cool
Reply With Quote
  #5  
Old 02-28-2011, 10:13 AM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 19,993
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
Send a message via AIM to Crono
wait i just realized it said png2nw and not nw2png, is this for real?
__________________
Reply With Quote
  #6  
Old 02-28-2011, 10:25 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by Crono View Post
wait i just realized it said png2nw and not nw2png, is this for real?
This, because if so I see MAAAANY good things (plausibly bad things about this) as well.
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #7  
Old 02-28-2011, 10:37 AM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 19,993
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
Send a message via AIM to Crono
Quote:
Originally Posted by Fulg0reSama View Post
This, because if so I see MAAAANY good things (plausibly bad things about this) as well.
nothing bad could possibly come of this
__________________
Reply With Quote
  #8  
Old 02-28-2011, 11:24 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by Crono View Post
nothing bad could possibly come of this
Think a little hard on the base concept of this and you may see something.
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #9  
Old 02-28-2011, 12:17 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 19,993
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
Send a message via AIM to Crono
Quote:
Originally Posted by Fulg0reSama View Post
Think a little hard on the base concept of this and you may see something.
I already know what you were implying but that's not a problem.
__________________
Reply With Quote
  #10  
Old 02-28-2011, 12:55 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
You used to be able to hit alt + 5 to save an online level. Level stealing wouldn't be a problem.
__________________
Reply With Quote
  #11  
Old 02-28-2011, 06:50 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Brilliant concept ! Have you thought about making a map image converter?
__________________
V$:CONFL16T
Reply With Quote
  #12  
Old 02-28-2011, 07:21 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by WanDaMan View Post
Brilliant concept ! Have you thought about making a map image converter?
Probably impossible. Maps lose data from being shrunken down.
Reply With Quote
  #13  
Old 03-03-2011, 05:35 AM
jacob_bald6225 jacob_bald6225 is offline
Doctor Who?
jacob_bald6225's Avatar
Join Date: Feb 2002
Posts: 851
jacob_bald6225 is a splendid one to beholdjacob_bald6225 is a splendid one to beholdjacob_bald6225 is a splendid one to beholdjacob_bald6225 is a splendid one to behold
Quote:
Originally Posted by DustyPorViva View Post
Probably impossible. Maps lose data from being shrunken down.
Yeah-- I can't think of any way to take a map image and turn it in to levels.

For example -- if two tiles shared the same pixels just arranged in a different fashion(a mirrored version of the same tile like roof corners) it'd be impossible to differentiate.



Quote:
Originally Posted by Darugo View Post
That's awesome Have you tried inputting a screenshot of something that doesn't have a actual tileset?
Like something that I don't have the tileset for... or like a photograph?
__________________

Last edited by jacob_bald6225; 03-03-2011 at 05:46 AM..
Reply With Quote
  #14  
Old 03-03-2011, 06:42 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
How is this possible? How do you define the actual tile orgins since not all screenshots are aligned? What is the average time it takes to compile a image to level? Say a 640x480 png for example.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #15  
Old 03-03-2011, 02:47 PM
jacob_bald6225 jacob_bald6225 is offline
Doctor Who?
jacob_bald6225's Avatar
Join Date: Feb 2002
Posts: 851
jacob_bald6225 is a splendid one to beholdjacob_bald6225 is a splendid one to beholdjacob_bald6225 is a splendid one to beholdjacob_bald6225 is a splendid one to behold
Quote:
Originally Posted by MrOmega View Post
How is this possible? How do you define the actual tile orgins since not all screenshots are aligned? What is the average time it takes to compile a image to level? Say a 640x480 png for example.
It probably isn't the most efficient technique but here is the gist:

Scan the tileset: Scan each pixel and put the RGB in to a string:

So RGB(0,0)+RGB(0,1).....+RGB(16,16). Since each tile is 16x16 pixels.

After the tileset is scanned it saves the information to the computer so you don't have to rescan for each level.

Then it loops through and checks each pixel of each tile in the screenshot(which is aligned and 1024x1024 pixels). If it matches a tile it adds that tile to a "recently used" array of tiles which get priority checking(so you don't have to loop back through the entire set of tiles after it gets cooking).

Each tile is synced up with the tile hex value(like "AE", or "/3". When it finds the tile it plops down the hex value in the level string. Right now it doesn't save files but outputs them as plaintext which you can copy paste in to a graal file and save with a text editor to get your level.

If the tile is unknown it puts a blackness tile so you can easily tell which tiles are missing.


All in all if the tileset is already scanned IIRC(it has been a few weeks since I generated a level from this). It pumps out the plaintext level in like (EDIT) 50 seconds which I have recorded in a video.

(Does this even make sense to anyone else?)

tl;dr:
1. Tileset scanned-->in order of the corresponding tile hex values.
2. Level is scanned tile by tile and plops out the hex value of the tileset tile that it matches.
3. Plaintext level is made and copy pasted in to a .nw with a text editor.


Again, this is probably not the best way to do this-- but it works.

(EDIT)Main problem here is I have it set up to do multiple levels in a row and as there are more tiles added to the priority list it begins to slow down-- I have a video of generating 6 levels in a row in 6:35 seconds.
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:46 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.