View Full Version : Random cave maps
Curufea
Aug 24th, '08, 09:41 PM
.
Ragnarok
Aug 24th, '08, 10:14 PM
Awesome resource! I'd rep you but the rep machine isn't letting me...
Curufea
Aug 24th, '08, 11:28 PM
I want to convert it into a PHP program so it generates a random map of a given size on demand, but wanted to get it working first so my first choice was excel :)
mayapuppies
Aug 25th, '08, 09:32 AM
Awesome resource! I'd rep you but the rep machine isn't letting me...
I got 'em for ya
Really good stuff here.
JohnTaber
Aug 25th, '08, 10:14 AM
Really awesome...can't believe they are randomly generated! NICE! :D
Curufea
Aug 25th, '08, 01:25 PM
I may expand it to other tilesets as well. I need to fix the "dead end" tiles - the outer line doesn't quite match with the Skeleton Key Games original tiles.
It isn't path finding, it's tile matching.
Curufea
Aug 25th, '08, 10:09 PM
Okay, I've written a PHP version that generates a new random map everytime you refresh the screen-
Curufea's Random Cave Map Generator (http://www.curufea.com/games/roguelike/map.php)
JohnTaber
Aug 26th, '08, 07:52 AM
Bookmarked. Awesome. :)
Maur
Aug 26th, '08, 09:42 AM
Okay, I've written a PHP version that generates a new random map everytime you refresh the screen-
Curufea's Random Cave Map Generator (http://www.curufea.com/games/roguelike/map.php)
That is very neat. How do you have the map tiles stored so the program knows which edges work with which other edges? Can it do arrangements other than 10x10?
Curufea
Aug 26th, '08, 03:00 PM
Yes.
I have a text file listing what the tiles' filenames are, and what their edge connections are. My thinking on this is that if I add other tiles sets, I can modify the text file to include them, or use more than one file.
There are 28 different types of edges for these tiles.
I'll be adding a form so you can change the dimensions of the map.
Now done. You can do size 1-50 maps. Any larger and you tend to run into server calculation time limits. Although it may be possible if I lower the random choosing loop. I'll experiment.
Eric, Omnirex
Aug 26th, '08, 04:24 PM
Okay, I've written a PHP version that generates a new random map everytime you refresh the screen-
Curufea's Random Cave Map Generator (http://www.curufea.com/games/roguelike/map.php)
:hail: :hail: :hail: :hail: :hail:
That is the most bestest gizmo EVAR!
:hail: :hail: :hail: :hail: :hail:
BTW, what size the grid supposed to be?
Curufea
Aug 26th, '08, 04:31 PM
The original tiles in the Skeleton Key Games sets are 6 squares wide and high, one tile per page and are of print quality. They are meant for 25mm figures - each square being one inch in size. This scales to one square = around 6 feet or approximately 2 metres.
If someone wishes to supply tiles with a hex grid, I can use them as well.
On a further note, I won't be providing better quality/resolution versions of these tiles - even these thumbnail size images are pushing the boundaries of fair use and copyright. I assuage my conscience by providing alternate text that describes which tile and which set you can get it from :)
mayapuppies
Aug 27th, '08, 04:06 AM
So awesome
Curufea
Aug 28th, '08, 06:35 PM
Now with a floating text box so you can label the map. I need to work on a way to have several boxes though :)
(if anyone comes across some javascript code that does multiple boxes, please let me know - it'll save me time).
Eric, Omnirex
Aug 28th, '08, 08:49 PM
:thumbup: The text boxes are icing on the cake. :thumbup:
Maelstrom
Aug 28th, '08, 09:06 PM
Can you post your Excel spreadsheet? I'd love to see how it was coded.
Curufea
Aug 28th, '08, 09:18 PM
Here you go-
29291
The tile stats are listed on sheet 1. The guts of the map are shown on sheet 2 as well as the button to generate the map, and the button to fill in the edges (hit ALT+F11 to see the VBA macro). Sheet 3 has the HTML I cut & pasted to form maps 2-9. Sheet 4 is used to create the text files I use for the PHP version.
On a side note - you can put maps on your own pages without needing to copy the images, by taking the final HTML and inserting a base HREF tag to point to my website.
Curufea
Aug 30th, '08, 03:55 PM
Now working on a random spaceship creator :)
Maelstrom
Aug 30th, '08, 08:50 PM
Here you go-
29291
The tile stats are listed on sheet 1. The guts of the map are shown on sheet 2 as well as the button to generate the map, and the button to fill in the edges (hit ALT+F11 to see the VBA macro). Sheet 3 has the HTML I cut & pasted to form maps 2-9. Sheet 4 is used to create the text files I use for the PHP version.
On a side note - you can put maps on your own pages without needing to copy the images, by taking the final HTML and inserting a base HREF tag to point to my website.
Thank you!
Looking forward to the random starship generator.
Blue Jogger
Aug 30th, '08, 10:48 PM
Ok, I got this, for multiple dragging things. This uses images, I'll see if I can craft a better one that's more suitable for text boxes (using SPAN instead of images).
<html>
<head>
<style>
img
{
position:absolute;
}
</style>
<script type="text/javascript">
document.onmousedown=coordinates;
document.onmouseup=mouseup;
function coordinates(e)
{
if (e == null) { e = window.event;}
var sender = (typeof( window.event ) != "undefined" ) ? e.srcElement : e.target;
if (sender.id=="moveMe")
{
mouseover=true;
pleft=parseInt(movMeId.style.left);
ptop=parseInt(movMeId.style.top);
xcoor=e.clientX;
ycoor=e.clientY;
document.onmousemove=moveImage;
return false;
}
else if (sender.id=="moveMe2")
{
mouseover=true;
pleft=parseInt(movMeId2.style.left);
ptop=parseInt(movMeId2.style.top);
xcoor=e.clientX;
ycoor=e.clientY;
document.onmousemove=moveImage2;
return false;
}
else { return false; }
}
function moveImage(e)
{
if (e == null) { e = window.event;}
movMeId.style.left=pleft+e.clientX-xcoor+"px";
movMeId.style.top=ptop+e.clientY-ycoor+"px";
return false;
}
function moveImage2(e)
{
if (e == null) { e = window.event;}
movMeId2.style.left=pleft+e.clientX-xcoor+"px";
movMeId2.style.top=ptop+e.clientY-ycoor+"px";
return false;
}
function mouseup(e)
{
document.onmousemove=null;
}
</script>
</head>
<body>
<img id="moveMe" src="smiley.gif" width="32" height="32" />
<img id="moveMe2" src="smiley.gif" width="32" height="32" />
<p>Drag and drop the image</p>
<script type="text/javascript">
//The movable image
movMeId=document.getElementById("moveMe");
//image starting location
movMeId.style.top="75px";
movMeId.style.left="75px";
movMeId2=document.getElementById("moveMe2");
//image starting location
movMeId2.style.top="75px";
movMeId2.style.left="125px";
</script>
</body>
</html>
Curufea
Aug 30th, '08, 11:53 PM
Nice - There needs to be a way to set the text and how many there should be.
If I have a form where the user specifies how many text boxes they want, it will add another stage to the process because I then have to generate a form for all the text boxes...
Hmm..
How about a large text box, and every line that some enters (separated by a carriage return) generates another moveable text box? That way you can enter text, and specify how many there should be at the same time.
Powered by vBulletin® Version 4.2.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.