phpbb bbcode addition for wesnoth maps?

Discussion of all aspects of the website, wiki, and forums, including assistance requests and new ideas for them.

Moderator: Forum Moderators

sparr
Posts: 209
Joined: March 6th, 2006, 5:02 am

phpbb bbcode addition for wesnoth maps?

Post by sparr »

I made a map, and I PM'd someone the "source code" for it (the textual content of the map file) since I didn't want to bother with an attachment for something so simple. It occured to me that it would not be particularly hard to write a phpbb addon to make a bbcode tag for maps. A simple html <table> could be used, along with inline terrain images. It wouldnt have to be as fancy as the real game terrain engine, no tile borders or concave/convex tests, just the base hexagon tiles.

Opinions? Would something like this be useful? You could include a "screenshot" of your map without having to take a picture or upload it, just paste in this:
[map]
aaabbbb
aaabbcc
ddddbbb
[/map]
or whatever the text of your map is.
sparr
Posts: 209
Joined: March 6th, 2006, 5:02 am

Post by sparr »

the result might look something like this attachment, which i produced with some mockup html and a bunch of random tiles from the terrain folder.
Attachments
wtest.png
wtest.png (130.18 KiB) Viewed 9287 times
User avatar
Ken_Oh
Moderator Emeritus
Posts: 2178
Joined: February 6th, 2006, 4:03 am
Location: Baltimore, Maryland, USA

Post by Ken_Oh »

very cool. of course it wouldn't look as good as the maps made by the actual game, but i don't think that's the point.

as is the slogan of open source communities: if it's not that hard, then go ahead and do it.

i'm sure if you do a good job with it, someone will insert the phpbb addon.
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Doing that for 10*10 maps is fine, but when you get much larger the image starts getting pretty large. It would be much better to do a scaled-down version.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
User avatar
Ken_Oh
Moderator Emeritus
Posts: 2178
Joined: February 6th, 2006, 4:03 am
Location: Baltimore, Maryland, USA

Post by Ken_Oh »

He's right. How about if you shrunk the images down by 1/2 or 1/3?
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

The images could automatically be scaled down by any % number with a single CSS declaration, so that wouldn't be a problem.

EDIT: Err, nevermind this. It still wouldn't affect positioning, so the resulting map would be screwed.
sparr
Posts: 209
Joined: March 6th, 2006, 5:02 am

Post by sparr »

I have implemented it in bbcode, with automagic scaling to keep the maps ~720 pixels wide (since i know some people still browse at 800x600). I had to overlap the hexes by 2 pixels horizontally to eliminate artifacts of browser image scaling. At this point its usable, but not perfect. I need to find a way to display player start positions over the images, and I am going to have to build a tropical forest tile since that seems to be missing from the images.

I don't want to link to my local web server here, the traffic would hurt... so heres a screenshot of the post on my forum.
Attachments
[map] bbcode tag in action
[map] bbcode tag in action
wtest.jpg (62.63 KiB) Viewed 9237 times
sparr
Posts: 209
Joined: March 6th, 2006, 5:02 am

Post by sparr »

And, to show off the ugly ass scaling, I give you 4p_Siege_Castles...
Attachments
wtestbig.jpg
wtestbig.jpg (107.13 KiB) Viewed 9220 times
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

That's really neat.
Hope springs eternal.
Wesnoth acronym guide.
sparr
Posts: 209
Joined: March 6th, 2006, 5:02 am

Post by sparr »

ok, i just threw some public-domain-font text on top of the keep tile to represent player start positions. this is the first productive thing ive ever done in php, gonna work on cleaning up the code a little (its only a few dozen lines, mostly the mapletter->imagefilename replacements).
Attachments
player 3 start position
player 3 start position
keep-tile-p3.png (9.34 KiB) Viewed 9202 times
player 10 start position
player 10 start position
keep-tile-p0.png (8.41 KiB) Viewed 9196 times
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Post by Eleazar »

impressive.

the terrain files with "-tile" at the end of the name are designed to show up on the mini-map. If a tile is transparent, many layered or not perfectly hex-shaped there should be a flattened, hex shaped "-tile" file.
If not let me and/or frame know.

I'd also recommend yellow text for the player start position numbers.
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
sparr
Posts: 209
Joined: March 6th, 2006, 5:02 am

Post by sparr »

i redid the player starts, colored text according to the default side colors in the game. the only completly missing tile was for tropical forest, and i addressed that elsewhere, although i used non-"-tile" files for many of them (dirt, etc).
User avatar
Eleazar
Retired Terrain Art Director
Posts: 2481
Joined: July 16th, 2004, 1:47 am
Location: US Midwest
Contact:

Post by Eleazar »

sparr wrote:although i used non-"-tile" files for many of them (dirt, etc).
Yeah, there won't be "-tile" files for single layered terrains, like dirt. But there should be for the forest.
Feel free to PM me if you start a new terrain oriented thread. It's easy for me to miss them among all the other art threads.
-> What i might be working on
Attempting Lucidity
sparr
Posts: 209
Joined: March 6th, 2006, 5:02 am

Post by sparr »

i made a tropical forest tile here http://www.wesnoth.org/forum/viewtopic. ... highlight=

ill do a few more demo screenshots of the "finished" script when i get home this evening. clean up the source a little more, then it will be ready for use if anyone actually wants it.

if anyone has suggestions, speak now or for a few hours hold your peace :)
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Seems to me that the numbers on the keeps need to be brighter. Perhaps make them red.

This is looking really cool. Could there also be a "download" button, so you don't have to attach the map separately? I know nothing abou PHP, this may or may not be possible.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Post Reply