working on visual mode

This commit is contained in:
codeimp 2008-12-01 06:51:00 +00:00
parent e68c6d234b
commit 69376ee5e0
8 changed files with 101 additions and 32 deletions

View file

@ -1,4 +1,8 @@
===========================================================================================
CORE DOOM BUILDER IDEAS
===========================================================================================
[15:49] <SoM> if you split a linedef with a vertex, there should be an option that will align the second half of the split
[15:49] <SoM> so like, if I have a line that is 128 units long
[15:49] <SoM> and I split them in half
@ -8,7 +12,6 @@
[15:51] <SoM> I've been doing a lot of detailing that would be made a lot easier with a feature like this
[15:52] <CodeImp> i dont even think that should be an option, but normal behaviour
===========================================================================================
Draw association on top of highlight so that a highligted sector referring to it's own
@ -17,18 +20,6 @@ should be drawn underneath the highlight or the highlight would be invisible.
===========================================================================================
The idea is actual extremely simple; having a tool to freely select things, verticies, lines, sectors, etc in a fashion other than being limited by an expanding rectangle select shape or by selecting one by one would be very nice indeed.
Actually I got the idea from GIMP (though just about all basic image editors have something similar). I think something like this could really speed up the selecting process, especially when your working with lots of things or verticies, etc. Being limited to just a square selecting box in some situations can be annoying.
Stemming from the same concept is FreeDraw, which I think is also a pretty simple idea as well (though I don't know if it would be harder to implement or not). Again, the idea came through me by a combination of image editing and doing lots and lots of tedious rock-type structures in maps. In particular, I was working on a very large cave-type map which required lots and lots of jutting and curvy wall structures. Of course this requires lots of repetitive line drawing; before you know it you've spent two hours on what is basically just a bunch of squiggly lines and curves. The idea with FreeDraw is to help cut down the time that's needed on doing structures likes this by merely drawing out a path for Doom Builder 2 to follow and draw the lines by. Think of MSPaint's pencil tool integrated into Doom Builder in a sense; you would select FreeDraw and then draw a square shape with it. Afterward you hit enter (or something similar to this to let DB2 know that your done drawing in FreeDraw mode) and it will create the linedefs. Of course the concept as it was described above could be a little problematic since tight curves and such might end up drawing waaay more lines than you really want in the end. So to add to that, I think a custom parameter box (much like what is used when you curve a linedef) would be in order to set some boundaries on how DB2 interprets and then draws the linedefs. Something along the lines of how strictly you want it to interpret the FreeDrawn line, much like how many verticies are used when curving a linedef. Of course I think something like FreeDraw would be very useful for even normal sector drawing, especially if the parameters by which DB2 reads the lines are fairly specific. It could greatly increase the speed at which structures are drawn, espeically large and complex ones.
===========================================================================================
Plugin that adds a key to toggle between 3D mode and the previous mode. Some people may want that behaviour back. When in 3D mode, the plugin should cancel any mode switches (but preferrably any action) that uses the WASD keys and give a seperate key (preferrably the same as 3D mode) to return to the previous mode.
===========================================================================================
Option to only remove upper/lower textures when neither side of the line has a tag when drawing/merging.
Option to never remove any upper/lower textures when drawing/merging.
@ -38,13 +29,16 @@ A feature that might be definitely of use in 3D Mode: "Drag Texture Offset", mea
===========================================================================================
This is just a little idea that I had for DB2 that I think would make mapping easier... (at least for me!!)
Say for example I have just selected 12 sectors to try out a particular ceiling flat on those sectors. Then I go into 3D mode to see how that texture looks. Say if I don't like that texture, I either have to go around in 3D mode and change the flat one sector at a time, or go back into normal mode and reselect all 12 sectors and change the flat like that.
My idea was this. Once you have selected the group of sectors you wish to change, you could hit ctrl-1 and DB could "remember" that group of sectors, so that if you hit the "1" key, it would instantly reselect all 12 sectors.
It is exactly like creating a group of soldiers/tanks/guns/archers in most RTS games. Ctrl-1 creates the specified group, 1 reselects the desired units.
ctrl-2 could be a bunch of linedefs that all needed offsetting, go into 3D mode, see that they needed to be offset by a different amount, go back into lines mode, reselect the entire group and try again.
I think the ability to quickly reselect groups of lines/sectors would be a huge benefit when choosing or offsetting textures, changing ceiling/floor heights etc etc.
You could have ctrl groups in sectors, lines, vertices and even things mode.
So in a Hexen-format map, the default activation for a linedef special is "player walks over". Could DB2 be made smart enough to instead use "player presses use" for default activation method when the line is impassible?
===========================================================================================
DOOM BUILDER PLUGIN IDEAS
===========================================================================================
Plugin that adds a key to toggle between 3D mode and the previous mode. Some people may want that behaviour back. When in 3D mode, the plugin should cancel any mode switches (but preferrably any action) that uses the WASD keys and give a seperate key (preferrably the same as 3D mode) to return to the previous mode.
===========================================================================================
@ -54,11 +48,20 @@ Map statistics plugin
===========================================================================================
So in a Hexen-format map, the default activation for a linedef special is "player walks over". Could DB2 be made smart enough to instead use "player presses use" for default activation method when the line is impassible?
===========================================================================================
Plugin to make a quick sector draw (square/circle) by drawing a single line
===========================================================================================
Plugin to rotating Things by clicking on the editor. For example, you select your Things, then you simply click in the direction you want them to be faced, and they will turn. Also add an option to have them either turn all in the same direction, or all point toward the mouse cursor. (For example, if I put enemies in a circle formation and I want them to all point toward the center of the circle.)
===========================================================================================
Sound Tracer Plugin. A plugin that simulates a noise in a sector, and the editor shows to which sectors the sound goes and highlight all the things that would hear the noise (especially non-deaf monsters).
===========================================================================================
The idea is actual extremely simple; having a tool to freely select things, verticies, lines, sectors, etc in a fashion other than being limited by an expanding rectangle select shape or by selecting one by one would be very nice indeed.
Actually I got the idea from GIMP (though just about all basic image editors have something similar). I think something like this could really speed up the selecting process, especially when your working with lots of things or verticies, etc. Being limited to just a square selecting box in some situations can be annoying.
Stemming from the same concept is FreeDraw, which I think is also a pretty simple idea as well (though I don't know if it would be harder to implement or not). Again, the idea came through me by a combination of image editing and doing lots and lots of tedious rock-type structures in maps. In particular, I was working on a very large cave-type map which required lots and lots of jutting and curvy wall structures. Of course this requires lots of repetitive line drawing; before you know it you've spent two hours on what is basically just a bunch of squiggly lines and curves. The idea with FreeDraw is to help cut down the time that's needed on doing structures likes this by merely drawing out a path for Doom Builder 2 to follow and draw the lines by. Think of MSPaint's pencil tool integrated into Doom Builder in a sense; you would select FreeDraw and then draw a square shape with it. Afterward you hit enter (or something similar to this to let DB2 know that your done drawing in FreeDraw mode) and it will create the linedefs. Of course the concept as it was described above could be a little problematic since tight curves and such might end up drawing waaay more lines than you really want in the end. So to add to that, I think a custom parameter box (much like what is used when you curve a linedef) would be in order to set some boundaries on how DB2 interprets and then draws the linedefs. Something along the lines of how strictly you want it to interpret the FreeDrawn line, much like how many verticies are used when curving a linedef. Of course I think something like FreeDraw would be very useful for even normal sector drawing, especially if the parameters by which DB2 reads the lines are fairly specific. It could greatly increase the speed at which structures are drawn, espeically large and complex ones.

View file

@ -655,6 +655,7 @@
<Compile Include="Rendering\RenderPasses.cs" />
<Compile Include="VisualModes\Clipper.cs" />
<Compile Include="VisualModes\VisualBlockEntry.cs" />
<Compile Include="VisualModes\VisualPickResult.cs" />
<Compile Include="VisualModes\VisualSidedef.cs" />
<None Include="Resources\Script2.png" />
<None Include="Resources\ScriptCompile.png" />

View file

@ -100,8 +100,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Begin with geometry
renderer.StartGeometry();
// This renders all visible sectors
base.OnRedrawDisplay();
// This adds all visible geometry for rendering
AddGeometry();
// Done rendering geometry
renderer.FinishGeometry();

View file

@ -54,6 +54,6 @@ namespace CodeImp.DoomBuilder.Rendering
void FinishGeometry();
// Rendering methods
void RenderGeometry(VisualGeometry g);
void AddGeometry(VisualGeometry g);
}
}

View file

@ -346,7 +346,7 @@ namespace CodeImp.DoomBuilder.Rendering
#region ================== Geometry
// This collects a visual sector's geometry for rendering
public void RenderGeometry(VisualGeometry g)
public void AddGeometry(VisualGeometry g)
{
// Must have a texture!
if(g.Texture != null)

View file

@ -197,7 +197,7 @@ namespace CodeImp.DoomBuilder.VisualModes
int dirx, diry;
// Estimate number of blocks we will go through and create list
int entriescount = (Vector2D.ManhattanDistance(v1, v2) * 2.0f) / BLOCK_SIZE;
int entriescount = (int)(Vector2D.ManhattanDistance(v1, v2) * 2.0f) / BLOCK_SIZE;
List<VisualBlockEntry> entries = new List<VisualBlockEntry>(entriescount);
// Find start and end block

View file

@ -446,15 +446,33 @@ namespace CodeImp.DoomBuilder.VisualModes
}
#endregion
#region ================== Object Picking
// This picks an object from the scene
public VisualPickResult PickObject(Vector3D from, Vector3D to)
{
VisualPickResult result = new VisualPickResult();
// Pick geometry
List<VisualBlockEntry> blocks = blockmap.GetLineBlocks(from, to);
// TODO
// Done
return result;
}
#endregion
#region ================== Rendering
// Call this to simply render all visible sectors
public override void OnRedrawDisplay()
protected virtual void AddGeometry()
{
// Render all visible sectors
foreach(VisualGeometry g in visiblegeometry)
renderer.RenderGeometry(g);
renderer.AddGeometry(g);
}
#endregion

View file

@ -0,0 +1,47 @@
#region ================== Copyright (c) 2007 Pascal vd Heiden
/*
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
* This program is released under GNU General Public License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#endregion
#region ================== Namespaces
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Reflection;
using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.Actions;
using CodeImp.DoomBuilder.Geometry;
using System.Drawing;
using SlimDX;
using CodeImp.DoomBuilder.Editing;
#endregion
namespace CodeImp.DoomBuilder.VisualModes
{
public struct VisualPickResult
{
// Members
public VisualGeometry geometry;
public Vector3D hitpos;
}
}