Older Contests
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP ContestsOlder Contests

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 19th, 2002, 06:29 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
maze output

so, now that the contest is over, what kind of output did everyone have?

I used the GD library to make a picture, and some simple logic to find out which letters were walls, and which were items.

How difficult did you find this?

Reply With Quote
  #2  
Old June 19th, 2002, 06:52 AM
Brian Brian is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Spokane, WA
Posts: 7 Brian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: maze output

We went for a 3D look to our output. GD to render the picture(s). Used multi-dimensional arrays to figure out what all the spaces around the current tile were in order to figure out how to shade the borders to give the 3d look. basically it came down to a 3X3 grid. numbers 1, 2, 4, 8, 16, 32, 64 and 128 used to figure out which tiles surroundinding current where paths and which were walls. So if the array contained the number 66 then the tiles above and below current were paths, all others were walls.

A sample of our output is at http://bs-linux.com/maze/

We've actually decided to go a step further now that the contest is over and turn this into a game (role playing perhaps). Idea being you can only see the 8 tiles surrounding where you currently stand and you click (uses image mapping maybe or perhaps just straight php haven't decided) forward/back/sideways a tile at a tile to reveal new areas of the maze where you might encounter monsters, treasures, goals etc. etc. etc. Would have liked to have done this for the contest but it would have fallen outside the specs considering that paths were only the letter 'b' and we would require more chars to represent the various goals/monsters/treasures/etc.

Reply With Quote
  #3  
Old June 19th, 2002, 07:50 AM
jakestone jakestone is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 6 jakestone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Brian's maze output

Looks very nice.

I saw some conversation going on earlier in the forum about determining if eveything was a "wall" or if there might be objects in the maze too. Had you come up with something to handle that? All I see in your output is walls.

The reason I'm asking is because I just have this really evil picture in my head that one of the mazes will be a Pac-Man type of maze with characters representing the dots, power-ups, 4 ghosts and Pac-Man himself.

Reply With Quote
  #4  
Old June 19th, 2002, 08:08 AM
Brian Brian is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Spokane, WA
Posts: 7 Brian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: maze output

we haven't made decisions on that yet but plan to revise the spec to allow for other chars to represent certain other goals/prizes/etc. Right now there is the * special char which we felt represented the start and/or end of maze. A-Z already used for walls so that leaves plenty of other chars like # or $ to represent the monsters or treasures or whatever. So no, we haven't decided on those things yet but plan on coming up with a revised spec then implementing it into our current code. This means that our maze parser could take any input file (that meets the spec) and output a maze. I think a pacman type game would be totally possible with our revised spec.

Reply With Quote
  #5  
Old June 19th, 2002, 08:49 AM
iordy iordy is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: .au
Posts: 7 iordy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Borders?

My output is almost the same as yours brian.

(screenshot to come)

But I used an overlaping trick so that I didn't need to figure out anything other than wall or not wall.

Reply With Quote
  #6  
Old June 19th, 2002, 09:08 AM
Brian Brian is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Spokane, WA
Posts: 7 Brian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: maze output

would love to see that screenshot, so please do post it... Or a direct link to the php code (which is what I posted)....

Reply With Quote
  #7  
Old June 19th, 2002, 11:57 AM
tbb tbb is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 9 tbb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: maze output

My truly lame entry can be found at http://tombuck.info/mazes/createmaze.php

For some reason it doesn't appear to be working too well on the version of PHP that's running on my server, but you get the gist of the lameness.

Reply With Quote
  #8  
Old June 19th, 2002, 12:23 PM
xs0 xs0 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Ljubljana, Slovenia
Posts: 760 xs0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: maze output


Reply With Quote
  #9  
Old June 19th, 2002, 01:29 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: maze output

Wow.. what kind of library or class have you used for making that crazy graphics!?!

Reply With Quote
  #10  
Old June 19th, 2002, 02:22 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: maze output

My favorite is definately the xs0 one, mine used no GD, but only a few set images. An example of my output is: http://www.genesisministries.net/php/maze2/createmaze.php

Reply With Quote
  #11  
Old June 19th, 2002, 02:36 PM
xs0 xs0 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Ljubljana, Slovenia
Posts: 760 xs0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: RE: maze output

Quote:
Wow.. what kind of library or class have you used for making that crazy graphics!?!


No class/library (except, of course, GD), I coded it all from scratch...

Reply With Quote
  #12  
Old June 19th, 2002, 03:17 PM
mikesgt2 mikesgt2 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 21 mikesgt2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: maze output

That is truly amazing... so did you use no other input files at all?

I don't have my version online but mine basically generates the maze in 3d by using trigonometry to rotate all the points around an origion and then squashing it so it looks 3d... i thought i had done well but it looks like i have lost... lol

Reply With Quote
  #13  
Old June 19th, 2002, 03:33 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: maze output

>No class/library (except, of >course, GD), I coded it all >from scratch...

but u've made some function to do all those graphics, don't think to release that functions in public?

Reply With Quote
  #14  
Old June 19th, 2002, 03:52 PM
xs0 xs0 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Ljubljana, Slovenia
Posts: 760 xs0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: RE: maze output

Quote:
but u've made some function to do all those graphics, don't think to release that functions in public?


well, the code would not really be usable as functions - it's highly specific to the contest problem (e.g. formulas are all as simplified as possible, for speeding up the calculations, so they don't apply to any other case).

anyway, it's just some basic 3d graphics stuff:

- there are four primitives used - spheres, cylinders, planes and crosses (for *)
- for each, I calculated normals for each pixel, then applied some lightning to it (see http://www.cs.sunysb.edu/~mueller/t...se564/illum.pdf for the formulas I used)
- transparency is done by using Snell's law
- for each pixel that is drawn, its shadow is also drawn; shadow intensity is completely fake, I just wanted it to look like everything was lens

Each tile was split into 4 parts, and for each, the shape to be used was determined (it depends on which of the 8 surrounding tiles is the same letter as the one in question). Asterisks (*) are a special case.

The only other thing that's there is detection, whether the current tile is exactly the same as a tile that was rendered previously - in that case it is just copied (via GD's imagecopy())

The rest is just choosing parameters, parsing the maze and saving results.

Reply With Quote
  #15  
Old June 19th, 2002, 04:21 PM
latos latos is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UK
Posts: 6 latos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: maze output

IORDY - As your host didn't have GD 2.0 I put your code on my server. http://www.mdlnet.net/iordy/createmaze.php

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP ContestsOlder Contests > maze output


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |