-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
game and editor should use the same draw_terrain() function. #561
Comments
We can use this to implement #562 rendering a smaller window in a dialogxml to preview a selected location. We could also use this to render a preview of where a party's position is in a save file (I want to make an in-game save file browser). |
This isn't a bad idea. There are tons of differences though, so it would probably take a lot of work to actually get the game's draw_terrain into a state where it can also be used in the editor without losing anything. Thus, I have a few more to add to your list:
In the game, if I recall correctly, there are at least 2 possible answers – in town the edge tile is duplicated to infinity, and in combat only blackness is rendered beyond the edge (although, combat arenas are surrounded by the "pit" terrain, so that might reduce to duplicating the edge… but I think it would be better if we can stop using terrain 90 as a magic "edge of combat barrier"… unless I already did away with that? I can't remember). I'm not sure what happens outdoors in-game, but in the editor I believe the current answer is "add one strip of the adjacent section". Also, the editor lets the background bleed through for out-of-bounds, rather than filling with black (you can see this best by zooming out). The scenario editor has four different zoom levels… and one of those zoom levels is identical to the in-game automap if I recall correctly, so couldn't we also merge in automap rendering here? That adds a few more things to consider:
By the way, the game and the scenario editor don't quite agree what a "monster" or "item" actually is. That is to say, they each have separate structures representing a "monster" and an "item". So we'd need to account for that too. And looking at the drawing code in boe.graphics.cpp, I can find even more considerations:
Some of these may not be relevant to terrain though. I'm not sure.
Isn't this better phrased as two separate elements?
Note: there are at least 3 different types of area rectangles: town boundary, named areas, and saved item areas. I don't think the scenario editor shows the 3rd type in any way at the moment, but it would be nice to be able to visualize them as well. As for small icons, they come from a variety of sources, so using them might require passing in a list of icon locations (but it could automatically add in ones that come directly from the terrain definition, either automatically based on the terrain's properties or because the terrain explicitly requested a specific icon).
That would be awesome – the open-source Blades of Avernum editor added this feature, so it'd be great to see it in Blades of Exile too. (Which reminds me, I hope he releases Blades of Avernum as open-source soon too…)
Hmm, I don't think the animated terrain uses anything like a timer object, but I don't really remember how it works. I do know that we support animated terrain in the dialogs now, though. And it definitely wouldn't hurt to support it in the editor too, either as an option or only when WYSIWYG mode is enabled. (Actually, I guess "preview" mode is a better way to say it.) So then there's yet another option for the list:
Not animating terrain would also mean the magic barrier doesn't get animated, of course. Even though it's not technically a terrain.
Hmm, we could, though I was planning to make that much simpler and only show the base terrain layer (or rather, it's not really showing the map at all, just a 2D grid of icons of the same type). I'm not sure how much point there is in showing the monsters in such a picker? |
Wait, how do I use them? This isn't obvious to me in the UI and I want to use them. |
In the terrain palette, the icon in the second row from the top and second column from the right. Clicking that button cycles between the levels. |
I've seen a lot of weird visual bugs in the scenario editor when rendering the terrain view. We ought not to try to catalog, debug, and fix all these in
scen.graphics.cpp
, when there is already a more working implementation of terrain rendering in the code-base atboe.graphics.cpp
.I think the additional things the scenario editor renders on the terrain view should be added to the
boe.graphics.cpp
function implementation as optional code paths. This function should be moved to a shared source file, and maybe should be given a structure that contains its various options because there are many relevant ones.For instance:
By making control of these parameters granular, we can do cool things in the scenario editor such as an LED enabling a WYSIWYG view of the lighting in a dungeon.
If the game's
draw_terrain()
function is entangled with anything that won't compile in the scenario editor (I'm thinking that animated terrain probably uses timer objects and things that are only declared in the game source files) we could use compiler flags to skip those parts when the editor is the build target.#ifndef SCENEDIT
or something.The text was updated successfully, but these errors were encountered: