View previous topic - View next topic |
Author |
Message |
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Mon Mar 21, 2005 8:12 pm Post subject: Experimenting with stuff |
[quote] |
|
Just thought I would share what I'm working on. :)
I'm working on writing a php program that will tie into a javascript page, to createtile-based worlds.
incase someone would like to check it out.
http://ccps.rpgdx.net/experimenting/
This isn't usable in it's current form, but it is getting there. _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
|
Nephilim Mage
Joined: 20 Jun 2002 Posts: 414
|
Posted: Tue Mar 22, 2005 12:00 am Post subject: |
[quote] |
|
Nice.
You could even use GD to do the compositing of the tiles server-side. _________________ Visit the Sacraments web site to play the game and read articles about its development.
|
|
Back to top |
|
|
Bjorn Demon Hunter
Joined: 29 May 2002 Posts: 1425 Location: Germany
|
Posted: Tue Mar 22, 2005 12:35 am Post subject: |
[quote] |
|
Ok, interesting. Something that occured to me is that in your browser you get animated tiles basically for free. :-)
Just an idea. You could set the size on the table cells and put the images as background. That way you could use "runlength encoding" (column spans) to reduce the amount of HTML overhead, especially for larger maps.
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Tue Mar 22, 2005 1:34 am Post subject: |
[quote] |
|
Bjørn wrote: |
Just an idea. You could set the size on the table cells and put the images as background. That way you could use "runlength encoding" (column spans) to reduce the amount of HTML overhead, especially for larger maps. |
? I don't know what you mean. :(
could you explain a little more?
[edit]nevermind, I get it now, but that wouldn't be good.[/edit] _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
Last edited by DeveloperX on Tue Mar 22, 2005 3:31 am; edited 1 time in total
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Tue Mar 22, 2005 1:36 am Post subject: |
[quote] |
|
Nephilim wrote: | Nice.
You could even use GD to do the compositing of the tiles server-side. |
I'm thinking about doing that for 'layered' maps. :) _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
|
LeoDraco Demon Hunter
Joined: 24 Jun 2003 Posts: 584 Location: Riverside, South Cali
|
Posted: Tue Mar 22, 2005 2:25 am Post subject: |
[quote] |
|
DeveloperX wrote: | Bjørn wrote: |
Just an idea. You could set the size on the table cells and put the images as background. That way you could use "runlength encoding" (column spans) to reduce the amount of HTML overhead, especially for larger maps. |
? I don't know what you mean. :(
could you explain a little more? |
I think Bjorn (may have) meant something like:
Code: | <style type="text/javascript">
td {
width: 32px;
height: 32px;
}
td.foo {
background-image: url( "foo.png" );
}
</style>
<table>
<tr><td class="foo" colspan="4"><!-- I span 4 columns --></td></tr>
</table> |
(edit: but, that's only based on his usage of "column spans", heh.) _________________ "...LeoDraco is a pompus git..." -- Mandrake
Last edited by LeoDraco on Tue Mar 22, 2005 3:50 am; edited 1 time in total
|
|
Back to top |
|
|
Nephilim Mage
Joined: 20 Jun 2002 Posts: 414
|
Posted: Tue Mar 22, 2005 2:38 am Post subject: |
[quote] |
|
The "runlength encoding" scheme is a good one if you're only displaying, but if you want the map to be clickable at some point in the future, you probably don't want to be doing that, since it makes it more difficult to capture clicks in any straightforward and abstractable way (since clicks don't register on background images).
Perhaps a better approach to compression would be to use Javascript to render the tilemap on the fly. A Javascript function could write out the HTML for the table cells at run-time, keyed off of a dense string. (This sort of technique was often used to compress web pages in the 5k competition.)
Just out of curiosity, what's the ultimate goal for this? A game? A mapping utility of some sort? _________________ Visit the Sacraments web site to play the game and read articles about its development.
|
|
Back to top |
|
|
DeveloperX 202192397
Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Tue Mar 22, 2005 3:29 am Post subject: |
[quote] |
|
Nephilim wrote: | The "runlength encoding" scheme is a good one if you're only displaying, but if you want the map to be clickable at some point in the future, you probably don't want to be doing that, since it makes it more difficult to capture clicks in any straightforward and abstractable way (since clicks don't register on background images).
|
That is why I didn't do that to begin with, not being able to click individual tiles easily.
Nephilim wrote: |
Perhaps a better approach to compression would be to use Javascript to render the tilemap on the fly. A Javascript function could write out the HTML for the table cells at run-time, keyed off of a dense string. (This sort of technique was often used to compress web pages in the 5k competition.)
|
Theres an idea I didn't think of! I'll try it out.
Nephilim wrote: |
Just out of curiosity, what's the ultimate goal for this? A game? A mapping utility of some sort? |
Both.
First, an online map editor, second rendering game maps in the browser. (LordGalbalan and I are working on a game using PHP & DHTML)
Anyway, once I figure this stuff out, I will create another version that allows map file templates, so that it can create maps for just about any tile-based engine. :)
That, my friend, is my ultimate goal. _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
|
LeoDraco Demon Hunter
Joined: 24 Jun 2003 Posts: 584 Location: Riverside, South Cali
|
Posted: Tue Mar 22, 2005 3:56 am Post subject: |
[quote] |
|
DeveloperX wrote: | Nephilim wrote: | The "runlength encoding" scheme is a good one if you're only displaying, but if you want the map to be clickable at some point in the future, you probably don't want to be doing that, since it makes it more difficult to capture clicks in any straightforward and abstractable way (since clicks don't register on background images).
|
That is why I didn't do that to begin with, not being able to click individual tiles easily. |
Most browsers these days do register mouse events on arbitrary elements. There is no reason why you couldn't trap a mouse event on a td-cell. Even if you weren't cutting down the actual table sizes, you could still use background-images for the td's. _________________ "...LeoDraco is a pompus git..." -- Mandrake
|
|
Back to top |
|
|
Nephilim Mage
Joined: 20 Jun 2002 Posts: 414
|
Posted: Wed Mar 23, 2005 5:33 am Post subject: |
[quote] |
|
LeoDraco wrote: | Most browsers these days do register mouse events on arbitrary elements. There is no reason why you couldn't trap a mouse event on a td-cell. |
Wow, you're right. Cool. And it's even standards-compliant. Thanks for pointing that out. _________________ Visit the Sacraments web site to play the game and read articles about its development.
|
|
Back to top |
|
|