A few small changes.

News and announcements about the website and forum.
User avatar
Gumboots
CEO
Posts: 4816
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: A few small changes. Unread post

Cool. I'll do it that way then. :) The nifty thing here is that although the markup is a standard HMTL table you can turn them into something loose and funky by declaring them as something else in the CSS. These are setup up with the rows declared as display: flex; so switching the order of the cells is as easy as changing one number for each class. I literally just changed 3 to 4 for the download cell class, and 4 to 3 for the details. On smaller screens I'll either set them to flex-wrap: wrap; or display: grid; to double stack the cells neatly. Modern CSS can do a lot of handy tricks.
Hawk wrote: Tue Sep 22, 2020 9:37 amJust curious, what's the plus sign for after the briefing/readme?
Just an indicator that there is something available on the same page. It's fairly common to have an up/down arrow or +/- sign for collapsible content. It changes to a minus sign when the briefing is open. A down arrow has sort of become a convention for download icons, so I went with +/-.

Edit: Menu links on old map pages shouldn't 404 now.
User avatar
Gumboots
CEO
Posts: 4816
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: A few small changes. Unread post

Meh. Ditched the + signs. Have kept the down arrows on the download links though.

Anyway, test pages are looking good. Next step is to do a hybrid page, with some briefings called by the old javascript and some called by the next text file include. Reason being that then I can use that example to do all existing archive pages and get them running with the new look, then sort out briefing conversions from images to text as time and energy permit.

Once everything is converted, the javascript and the additional temporary CSS can be dropped. Then it'll all be clean and shiny. (0!!0)

Edit: Aha! I just figured out something handy. In all .gmp files the briefing text is always preceded by these four bytes, with the briefing starting directly after the last 00:

Code: Select all

c9 32 00 00
What's more, the start of the briefing is the first search hit on that combination of bytes. You don't even need to sort through instances of that hit. This means there's no need to load anything in the game to get all the briefings as .txt files. They can be grabbed straight from the .gmp with no trouble at all. They copy/paste perfectly into a .txt file, with correct lines breaks, etc already in place. This is much faster and easier than constantly going though the scenario selection. I should be able to do a stack of them in next to no time. ::!**!
User avatar
Gumboots
CEO
Posts: 4816
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: A few small changes. Unread post

Well hey, grabbing the stuff straight from the .gmp doth totally rock. I now have the Africa test page up and running with all content completely functional. Took hardly any time at all. I've checked it for all images, briefings and readme's and it's all good to go.

Hawk & Badger - RT3 Maps of Africa
Edit: Changed link, due to "test page" now becoming the permanent live page. :)

And the new way of handling briefings and readme's (all text) is so fast and smooth compared to the old javascript and .png images. No waiting around while a weird thing wobbles on the screen. You just click, and it's there in front of you. (0!!0)

Edit: While I think of it, the South America test page is currently mocked up with a proposal for handling of multi-page map regions (ie: Europe has 3 pages and North America has 5). The links don't go anywhere, but are just to demonstrate the idea: simple numbers for each page in that region, with the current page number larger and bold (and not linked), and with clear tooltips on the other four (active) numbers/links.

This is tidy, and saves having yet another menu bar, and I think it's functional enough to keep just about anyone happy.
User avatar
Hawk
The Big Dawg
Posts: 6503
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Re: A few small changes. Unread post

WOW! !*00*! That grabbing the briefing from the gmp is an amazing find. Man, I wish we had known that a long time ago.
Good find Gumboots. (0!!0) !!howdy!! :salute:

The site is moving right along, and in the right direction too. :mrgreen:
Hawk
User avatar
Gumboots
CEO
Posts: 4816
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: A few small changes. Unread post

I did find a couple of traps for young players with the text files. First one is you can't use < or > in the briefing or readme text, because the browser interprets those as html tags. This tends to bork odd things you don't want borked, so a quick search/find/replace on those is necessary.

Second one is the files have to be encoded as utf-8 to keep HTML validators happy with an HTML5 doctype, but that's easy (Notepad++ does utf-8 conversion of any text).

Last one is that due to the way the pre tag container is handled by the browser, you need to save the text files with one blank line at the start and at the end. Otherwise it shoves the text on those lines around and it looks a bit weird. Apart from those few caveats there are no other problems, as far as I can tell. Well, apart from some people saving their briefings in the .gmp with bonkers amounts of blank lines, but you just delete the excess ones. !*th_up*!
User avatar
Gumboots
CEO
Posts: 4816
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: A few small changes. Unread post

Hawk wrote: Fri Nov 08, 2019 1:16 pm I think the side links are more effective now. Folks can see them and know to use them without them being to outstanding.
Looks good.

Are you planning on adding them to the other styles?
FYI, I just added them. Finally got around to it. They're all done (ie: on all styles) by the same extension that does the top menu. That thing will end up running the whole forum if I'm not careful. :lol:

Edit: New Africa page is live, with all content. This is actually the test page, renamed to take it's rightful place after being tested.

Previous Africa page (with wobbly javascript and .png's) has been deprecated. Asia next. !*th_up*!

Edit: Asia page is now updated and fully functional.
User avatar
Gumboots
CEO
Posts: 4816
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: A few small changes. Unread post

Australasia page is done too: http://hawkdawg.com/rrt/rrt3/rrt3_australasia.php

Just for the heck of it I decided to run a speed test, comparing the old North America archives page (still running original code) with the new Asia page. I chose these two because they have the same number of maps on them.

Results are here for the old North America page: https://www.webpagetest.org/result/2009 ... 390a1f82f/

and here for the new Asia page: https://www.webpagetest.org/result/2009 ... 90a7afa31/

The new Asia page is roughly 50% faster to load on first view (ie: nothing cached). Which is kinda cool, but from looking at the waterfall I can tell the test must be running on a 768px tall monitor (because the thumbnails are set to loading=lazy, and only the ones for Mongolia and Baghdad Railway are being loaded, so the rest must be off screen). This gives a bit of an unfair advantage compared to the same test on something like my 2560x1440 screen, which would have more maps visible so would load more thumbnails.

That would still bring the new page in faster than the old one, but then to be really fair you could also set the thumbs on the old page to lazy loading too, which would mean the vast majority of them weren't loaded on first view. If the old page had lazy loading on the thumbnails, and the tests were run on a 2560x1440, the load times for both pages would be about the same. But then there is far less waiting time and additional bandwidth (ie: nothing) when calling up briefing and readme content on the new page. :)
User avatar
Gumboots
CEO
Posts: 4816
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: A few small changes. Unread post

Just thought of something: there's no real need to even get the introduction text and thumbnail by loading things into the game. The intro text is right at the start of the .gmp. You don't even need to go looking for it. So there's no real reason why that couldn't be made part of the briefing .txt files. Instead of just the briefing, you'd have Intro + Briefing. Easy.

The map thumbnail can also be extracted from the .gmp at its native 256x256 resolution.

Jim found out where it was hiding (see this post) and I've done a test by copying the relevant bytes from an example .gmp (I used Orient Express Warna) and saving them as a .jpg.

jpg_extraction_test.jpg
jpg_extraction_test.jpg (13.38 KiB) Viewed 106574 times

Hey presto, one thumbnail. About 13kB, which I assume would be the same for any map. This could then be used on the main archives pages, and inside the briefing pop-ups, and would load even faster than the images that are being used now. No photoshoppery required at all. The whole thing can be done straight from the .gmp. !*th_up*!

Edit: Ok, I'm sold on this idea. I had a bit of a play with it, and I think it works really well.

Test case is here: http://hawkdawg.com/rrt/rrt3/rrt3_asia.php#orientwarna2

Which is basically a duplicate of the standard entry for Orient Express Warna, but with the map name, the introduction text and the thumbnail in a separate container above the actual briefing. This looks cleaner to me, with the intro being easier to read as text rather than as part of the old preview image, and the thumbnail being less obtrusive than the old preview image.

It also means the one image does all language versions of any map, so fewer images needed on the server and less chance of mixing them up. The thumbs straight from the .gmp are also only about 1/3 the byte count of the old preview images. This has all got to be good. (0!!0)
User avatar
Gumboots
CEO
Posts: 4816
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: A few small changes. Unread post

Test
Does it work?

Try another one.
Yay!

And again...
So...

New one...
User avatar
Gumboots
CEO
Posts: 4816
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: A few small changes. Unread post

Ok, I got fed up with the old style hr tags. My 2c is that it's a nuisance having to enter a color for hr's. They should be handled by the style's CSS, so they just do their thing and look good without anyone having to bother messing with them.

So, I've edited the hr BBC tag in admin so that it no longer cares if you enter a color between the opening and closing tags. You can enter one, if you just do so out of habit, but it will be ignored. You can also not bother, and just click the select for the hr, and it will sort itself out for you.

Sooner or later I will get around to snazzing them up for each particular style, but at the moment they just get generic styling which looks ok on all styles we currently run.
User avatar
Hawk
The Big Dawg
Posts: 6503
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Re: A few small changes. Unread post

OK! Let's see.

Check!!!
Check 2!!!!

Nice!!! !*th_up*!


(0!!0)

Could you make it a bolder line maybe?
Hawk
User avatar
Gumboots
CEO
Posts: 4816
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: A few small changes. Unread post

Yeah, sure.
Is bolder now. (0!!0)

Edit: I just realised something. With this site reorganisation going on I don't really want the "Buttonmenu" extension in its current format. The Buttonmenu extension has good ACP options for n00bs, but all the top menu links on this site are public (ie: no permissions to worry about) so for someone who can write and shuffle HTML links easily it's generally more trouble than it's worth. I can change things faster just by working with raw HTML and ftp'ing the edited file into place.

What I really want is to strip it down so it includes a basic HTML file that contains the code for the actual menu as implemented. That means I can then call that file as the forum top menu, and as the website top menu. They have the same content anyway, so using one file makes more sense. Easier updates. !*th_up*!

Related to this: I think I'll remove the archives menus, etc from the old pages until things are all updated. IOW, if you're on the old North America archives pages and want to get to Other Lands, you'd go to the top menu instead. Again, this is just less crap to chase while updating everything. Once all old pages are updated they'll have the usual (secondary) menu back in place.
User avatar
Hawk
The Big Dawg
Posts: 6503
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Re: A few small changes. Unread post

Excellent! I like that bolder look. It makes it just slightly different than the hr above the sig. :salute:
Hawk
User avatar
Gumboots
CEO
Posts: 4816
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: A few small changes. Unread post

Had an idea. If I'm messing with BBCodes I could easily whip one up that does the same job as the ELONW extension. All it would need is something like this:

Code: Select all

[xurl={Link goes here}]{Other stuff goes here}[/xurl]
Which would render the markup as:

Code: Select all

<a href="Link" target="_blank" rel="noopener noreferrer">Other stuff</a>
And would go in the custom BBCodes as "xurl".

NB: The rel attributes are a precaution against XSS attacks (see About rel=noopener and Target="_blank").

I'm not sure offhand if the current extension includes those precautions (Edit: Just checked, and it sort of does, partially).
User avatar
Hawk
The Big Dawg
Posts: 6503
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Re: A few small changes. Unread post

I had to jump in the ACP to see what ELONW was. I forgot. ^**lylgh

That's a good idea though.
Hawk
User avatar
Gumboots
CEO
Posts: 4816
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: A few small changes. Unread post

Got the Africa page revamped (again *!*!*! ) - Railroad Tycoon 3 Maps of Africa

It now calls thumbnails which are generated straight from the .gmp bytes, and has the introduction text next to the thumbnail when the briefing is opened, with the briefing itself being below that.

I like this setup. It echoes the game screens pretty well, and is lighter on images than the previous way of doing it. Smaller images, and no need for more than one to handle multiple language versions of any map. Generating the thumbs is a piece of cake. So all the map archive pages will be getting done like this. !*th_up*!

Found out something while doing them. You can actually get a higher quality thumbnail, at hardly any extra cost in bytes, by grabbing the TGA map texture and scaling that down to thumbnail size before saving it as a JPG. Only catch is that it won't have cities or rivers (or small lakes) marked on it, because it only outputs whatever you actually put on the texture. Adding those in is a hassle, so generally not worth it, but it's pretty clear the game is massively screwing with thumbnail quality when it doesn't really have to. They're hardly any bytes anyway, in the scheme of things, so there's no real need for them to be reduced in quality to that extent.
User avatar
Hawk
The Big Dawg
Posts: 6503
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Re: A few small changes. Unread post

Lookin' pretty spiffy. !*th_up*!
Hawk
User avatar
Gumboots
CEO
Posts: 4816
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: A few small changes. Unread post

Got bored with that Button Menu extension. Good idea in theory, but the re-ordering of buttons or sub-items doesn't work, so every time you want to change things it becomes a drama. You have to create new buttons and sub-menus, and edit old ones, to get things shuffled around.

So I ripped the guts out of it and just pasted in the raw HTML from the web site menu. Works brilliantly. Easy to change now. Faster than logging into the ACP and finding the extension interface, let alone having to actually use it. :P

Anyway: menu has been changed to reflect how I think most people use the site. RT2 interest is minimal, and nobody really cares about RT1, so those have been shuffled off to the middle.

RT3 stuff is now near the front, just after the Website home page. The old RT3 map archive page has been deprecated. All the RT3 basics (map index, patches, etc) are now on the RT3 main page.

Trainmaster is also linked from the RT3 main page. There's not much TM content (only 10 maps) and nobody seems to be making more, so I think everything TM-related can go on one TM page. Keep things nice and simple. (0!!0)
User avatar
RulerofRails
CEO
Posts: 2063
Joined: Sun Dec 08, 2013 1:26 am

Re: A few small changes. Unread post

Hurrah, nice progress. Keep it up. :salute:

Seeing there are so few TM maps, I did a rework on Warrington Wire as a standalone map, maybe that can go in the TM section?
viewtopic.php?f=72&t=4021#p41791

This map is in the campaign files. Maybe it could be updated there. Although it's unlikely the campaign will ever be finished. I knew that these campaign files are large, I don't know why. But it's partly why I went with making this scenario stand-alone. For me, it's the best one in the campaign.
User avatar
Gumboots
CEO
Posts: 4816
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: A few small changes. Unread post

Ok, I'll add it when I get onto the TM page. !*th_up*!

If anyone thinks of any useful tweaks to the map archive pages, feel free to suggest them. Things like links to forum threads which aren't shown, any broken links in the forum you come across, etc, etc. With all the rearranging there are sure to be some broken links strewn around the place, and fixing them won't be hard if I know where they are.

Oh yeah: all the new map pages have a unique ID for every map, so you will be able to link straight to any one from the forum.

For example: http://hawkdawg.com/rrt/rrt3/rrt3_europ ... glacierexp links to The Glacier Express.

Europe_page_3_markup.jpg
Post Reply