|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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.
|
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
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)....
|
|
#7
|
|||
|
|||
|
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. |
|
#8
|
|||
|
|||
|
RE: maze output
|
|
#9
|
|||
|
|||
|
RE: maze output
Wow.. what kind of library or class have you used for making that crazy graphics!?!
|
|
#10
|
|||
|
|||
|
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
|
|
#11
|
|||
|
|||
|
RE: RE: maze output
Quote:
No class/library (except, of course, GD), I coded it all from scratch... |
|
#12
|
|||
|
|||
|
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 |
|
#13
|
|||
|
|||
|
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? |
|
#14
|
|||
|
|||
|
RE: RE: maze output
Quote:
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. |
|
#15
|
|||
|
|||
|
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
|
![]() |
| Viewing: Codewalkers Forums > PHP Contests > Older Contests > maze output |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|