ID:176715
 
So now I am looking to make a window that opens when your character examines an active object in my game, usually from a single click or a key macro. I want this to be a fairly universal window, but not neccessarily a HUD. I had talked before about making a forced page come up in the browser, and that was my original idea, but I wanted to get some opinions before cotinuing. This window would be a window displaying information for whatever was selected by the client. For example, if you were selecting a chest, there would be a page in th browser window pop up with a chest icon in the corner, text saying what it was, then text saying how to use it. However, if you then selected a monster, it would refresh with the monsters information, but the page layout would be similar. I would also like this to reflect HP of a monster as it dwindles in a battle, so I assumed there would be a refresh of the window automatically to occur every 3-5 seconds, or everytime the monster was examined again, however, it would only occur on monsters - well mobs in general. Am I asking for trouble by putting this into a webpage that's forced into the browser? I assume this might cause horrific lag problems. I also wouldn't mind having a floating window with a bmp image I could place in it(if that's even possible in BYOND). Any ideas are happily appreciated. As always :-D

Thanks!
Hepitank
I think it's a great idea. I intend to use something similar in my own RPG.

Keep the HTML as simple as possible to cut down on bandwidth usage. I recommend using a separate style sheet file and including it in the resources, so it only has to be downloaded once by each client. It will keep your formatting consistent and reduce file sizes.

You should also forget about the auto-update. Most of the time, you will just be transmitting the same page over and over and wasting badwidth. Instead, I'd keep a list of players viewing the atom and send them each an update whenever something changes significantly. Ideally, you would want it to update only once per tick (or a longer time cycle if you choose) with the most recent version.

As a side effect of this system, players could shut the browser window to clear screen space and it would automatically pop up when the atom they are viewing changes in some way. Players won't need to constantly watch the window to see if something changes.
Hepitank wrote:
So now I am looking to make a window that opens when your character examines an active object in my game, usually from a single click or a key macro. I want this to be a fairly universal window, but not neccessarily a HUD. I had talked before about making a forced page come up in the browser, and that was my original idea, but I wanted to get some opinions before cotinuing. This window would be a window displaying information for whatever was selected by the client. For example, if you were selecting a chest, there would be a page in th browser window pop up with a chest icon in the corner, text saying what it was, then text saying how to use it. However, if you then selected a monster, it would refresh with the monsters information, but the page layout would be similar.

If you check out my Dream Tutor column (in the BYONDscape archives) on using the mini-browser, that'll give you a good idea for how to get started on that page layout. There's an example on how to automatically send an atom's icon along with a short help blurb, and that sounds a lot like what you're going for.

My thought is that every atom should have its own proc for contributing to the contents of that window. (Also it should have one for a list of resource files to send via browse_rsc() when the window first opens, including the icon and the style sheet, plus any other icons it needs for special displays.) Override the proc so that chests display their contents, monsters display HP, etc.

I would also like this to reflect HP of a monster as it dwindles in a battle, so I assumed there would be a refresh of the window automatically to occur every 3-5 seconds, or everytime the monster was examined again, however, it would only occur on monsters - well mobs in general. Am I asking for trouble by putting this into a webpage that's forced into the browser?

As Shadowdarke mentioned, you shouldn't have to do a refresh that often--only as circumstances demand. I believe there may be a way of keeping track that the pop-up has closed, so you should theoretically be able to know at all times who's got which windows open if you keep track carefully. (In battle this is a lot easier to keep track of.)

I assume this might cause horrific lag problems. I also wouldn't mind having a floating window with a bmp image I could place in it(if that's even possible in BYOND). Any ideas are happily appreciated. As always :-D

Go with .png instead. It's smaller and thus more bandwidth-friendly, plus it supports transparency.

Lummox JR