I'm not entirely sure everyone needs to install the entire xna game studio for it. Installing only the redistributable for XNA 3.1 seems to have been sufficient (for me) to allow the assembly to load.
Now for something else, it appears that even if I can start it, the dialog don't appear after I have created it. In fact, no dialog component is, so I wonder what that's all about.
http://dl.dropbox.com/u/2757798/IMG_04122011_012638.png
---
A bug regarding your library feature by the way. Say I take one of your libraries and use, doubleclicking the same library file several times will let it pop up as multiple tabs.
---
If you like, since I did start with working on a dialog designer for you before, I could see if there's something you can use for yours. I'm mainly thinking scaling of dialogs and blendstates for dialog items (lighten, darken, additive etc). There might be some problems though with the latter one, since I was using xna 4.0 and not xna 3.1. But it's your call ofcourse, just letting you know that I have some things that could save you some time :)
Yeah, I changed the target framework to .net 4.0, instead of .net 4.0 client profile.. that is probably what caused that. You should still need xna 3.1 to create dialogs though.
That's rather wierd.. You're sure that is a fresh dialog? I got an error report from you - that you crashed when creating a new dialog, because you didn't have xna 3.0.. you deleted that dialog, right?
Im not sure what you are refering to when you say scaling of dialogs - I don't see a scale property for dialogs or dialog controls. But about blendstates.. I haven't looked much into that. I'm guessing you would just be setting the blend function on the graphics device, but if you got a code that does the job, I wouldn't decline :)
Yeah, it's a fresh dialog. I did get the xna framework 3.1 redistributablable too, so it does load the assembly properly.
One thing I noticed now when trying again (still the same as before, malfunctioning) is that I can see the cursor changing when it hovers over the "dialog", so I know it's there, and I can move it around as well.
Here's some additional info of what I can see:
If I add a title, the text is visible
if I change the border type to HorizontalBorder, the dialog gets visible (but obviously wrongly composed). But no other image type works for me. The same seems to be with items.
The texture browser seems to work fine. It previews the available dds-files, but as before, it doesn't draw if I change to any of them (except with HorizontalBorder).
Suggestions, by the way:
Remove the border option for dialogs specifically. There is no such option for those.
Add image support later for .tga, .jpg .png and .bmp. Kast time I checked, those are possible to use instead of .dds (.dds is well more favorable though).
The scaling was not realted to the dialogs and items themselves having a scaling option, but more for the scaling of the entire designer surface scaling the dialogs and items accordingly, just like starcraft 2 does.
Hmm.... what graphics card do you have? Does it support v3.0 shaders? I had some trouble with too many operations for a v2.0 shader, so I just ramped up the required version.. but I could look into alternatives.
Yeah, adding support for extra image types should be fairly trivial, and I'll remove that useless option.
I already give you the option to set the target screen height, as I do in my video - which affects scale.
Edit:
I'll lower the required pixel shader version from 3.0 to 2.0a.. hope most people can run that.
Yeah, looking at that, I do even have shader model 4.1, so whether your downgrade or not will work, I'm not sure.
The flaw all along could lie in xna incompatibility I suppose.
Looking at msdn, I suppose you use the HiDef profile, if your current shader model is v3.0. Swapping that to reach would set it to shader model 2.0, but I suppose that is what you said you are going to test :>. Though, I have been using the HiDef profile before without problems, so I don't know either.
The reason It looks to me that this is the issue is that all my shaders are for 3.0, except horizontal border, which is 2.0.. I'll release this, and we'll see if it works.
I find it very hard to get a feel for how many people actually use this tool. I don't see any way to see download count or anything - all I really have to go for is this thread.
The editor has come a long way since it was first released, and I will keep developing it as long as I get feedback, but I would be lying if I said I didn't care if anyone use it. After spending so much time on it, it would be nice to know how many people actually find it useful, and to how many it's just another tool floating about.
If you wanna track im sure you know enough to have the editor open a url in the back ground .... the url can just be an online statistics tracker.... like your average.... web site usage tracker...
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Hmm. the front page stuff is really quite old.. I should probably rewrite it.. Right now, I can run statistic tools on downloads/accesses to the ftp server. Since the program checks there for new versions each time it is launched, it's a good source of info for me.
Edit:
Okay, it wasn't on the front page. Still - it's not a problem anymore.
Out of curiosity, why did you pick XNA 3.1 over 4.0? You're using .NET 4.0 anyways. As far as I know, XNA 4.0 has much better support when it comes to fonts, for instance.
Well, the reason is that before xna 4.0 came out, I was working on a space game in xna (kindda like freelancer). When 4.0 came out, I looked into the changes to see if I wanted to port it to 4.0, and decided that I liked the way the coding was done in 3.1 better. So I guess it's just because i'm more used to 3.1 than 4.0. The fonts do annoy me, and I don't know how to fix it, but I'm also not guaranteed that it will look right in 4.0.
There, the new version seems to work much better :).
Another question, why did you decide to use a custom shader/fx for the dialogs? You would be able to basically do the same thing with solely a SpriteBatch. Or perhaps you're using them both combined?
Sorry if I aquestion you too much :P
I'll report back for other bugs/feedback later, if I come across any, as usual.
I am using the spritebatch to draw.. But rather than make multiple draw calls for different regions of the texture, I use the effect file to calculate what texture coordinate to use (for the different image types). First of all, this should be faster, simply because I get fewer draw calls, and I can push some arithmetic to the gpu. The speed gain probably isn't noticeable though, since the scene is so simple. Also, I think this solution is cleaner.. I have fewer variables to keep track of - just tex coord x and y. Otherwise, I would need rotation, source rectangle, destination rectangle and origin.
Some of my draw code:
foreach(Dialogdinitems){//A list of what should be rendered, in the order it should be renderedList<AbstractControl>renders=newList<AbstractControl>();renders.Add(d);//Each dialog has a list of controls, sorted after render priorityrenders.AddRange(d.ChildControls);while(renders.Count>0){AbstractControlitem=renders[0];renders.RemoveAt(0);//A single control might add more controls to render correctly, but theese controls//wont be in the output script. //An example is that the checkbox adds an image if it is set to be checked.renders.InsertRange(0,item.ExtraControlsToRender);if(item.DrawTexture){//Set image typeEffect.CurrentTechnique=Effect.Techniques[Enum.GetName(typeof(ImageType),item.ImageType)];//Clip rectangle used to clip controls when they are dragged outside of their parent dialogSpriteBatch.GraphicsDevice.RenderState.ScissorTestEnable=true;SpriteBatch.GraphicsDevice.ScissorRectangle=item.ClipRect;Texture2Dtexture=item.Texture??defaultTexture;//Buttons/check boxes have both pressed/not pressed images in same textureEffect.Parameters["RenderingButton"].SetValue(itemisButton||itemisCheckBox);Effect.Parameters["Tiled"].SetValue(item.IsTiled);Effect.Parameters["TintColor"].SetValue(item.Color.ToVector4());Effect.Parameters["TextureSize"].SetValue(newVector2(texture.Width,texture.Height));Effect.Parameters["TargetSize"].SetValue(newVector2(item.DrawRect.Width,item.DrawRect.Height));SpriteBatch.Begin(SpriteBlendMode.AlphaBlend,SpriteSortMode.Immediate,SaveStateMode.None);//Todo: Set blend functionEffect.Begin();Effect.CurrentTechnique.Passes[0].Begin();SpriteBatch.Draw(texture,item.DrawRect,null,Color.White);SpriteBatch.End();Effect.CurrentTechnique.Passes[0].End();Effect.End();}//Draw dialog titleif(itemisDialog){Dialogdialog=(Dialog)item;if(!string.IsNullOrEmpty(dialog.Title))DrawString(dialog.Title,dialog.TitleFontRect,dialog.TitleFont,Color.White);}//Draw the control's text if neededif(itemisDialogControl){DialogControlcontrol=(DialogControl)item;if(control.DrawText&&!string.IsNullOrEmpty(control.Text))DrawString(control.Text,control.DrawRect,control.TextStyle,control.TextColor);}}}
In case you're interested.. one of my shaders:
float4HorizontalBorderPS(float2texCoord:TEXCOORD0):COLOR{float2targetCoord=texCoord*TargetSize;float2edgeSize=float2(TextureSize.y,TextureSize.y);if(TargetSize.x<2*edgeSize.x)edgeSize.x=TargetSize.x/2;if(TargetSize.y<2*edgeSize.y)edgeSize.y=TargetSize.y/2;//First, we should check what region we are in.if(targetCoord.x<edgeSize.x){if(targetCoord.y<edgeSize.y){//Top lefttexCoord.x=targetCoord.x/(TextureSize.y*10);texCoord.y=targetCoord.y/TextureSize.y;}elseif(TargetSize.y-targetCoord.y<edgeSize.y){//Bottom lefttexCoord.x=targetCoord.x/(TextureSize.y*10)+0.2;texCoord.y=(targetCoord.y-TargetSize.y+TextureSize.y)/TextureSize.y;}else{//Left bordertexCoord.x=targetCoord.x/(TextureSize.y*10)+0.6;texCoord.y=((targetCoord.y-edgeSize.y)/TextureSize.y)%1;}}elseif(TargetSize.x-targetCoord.x<edgeSize.x){if(targetCoord.y<edgeSize.y){//Top righttexCoord.x=(targetCoord.x-TargetSize.x+TextureSize.y)/(TextureSize.y*10)+0.1;texCoord.y=targetCoord.y/TextureSize.y;}elseif(TargetSize.y-targetCoord.y<edgeSize.y){//Bottom righttexCoord.x=(targetCoord.x-TargetSize.x+TextureSize.y)/(TextureSize.y*10)+0.3;texCoord.y=(targetCoord.y-TargetSize.y+TextureSize.y)/TextureSize.y;}else{//Right bordertexCoord.x=(targetCoord.x-TargetSize.x+TextureSize.y)/(TextureSize.y*10)+0.7;texCoord.y=((targetCoord.y-edgeSize.y)/TextureSize.y)%1;}}else{if(targetCoord.y<edgeSize.y){//Top bordertexCoord.x=((targetCoord.x-edgeSize.x)/(TextureSize.y))%1;texCoord.y=targetCoord.y/TextureSize.y;//Need to rotatefloattemp=texCoord.x;texCoord.x=texCoord.y;texCoord.y=1-temp;//Ajust to regiontexCoord.x=texCoord.x/10+0.4;}elseif(TargetSize.y-targetCoord.y<edgeSize.y){//Bottom bordertexCoord.x=((targetCoord.x-edgeSize.x)/(TextureSize.y))%1;texCoord.y=(targetCoord.y-TargetSize.y+TextureSize.y)/TextureSize.y;//Need to rotatefloattemp=texCoord.x;texCoord.x=texCoord.y;texCoord.y=1-temp;//Ajust to regiontexCoord.x=texCoord.x/10+0.5;}else{//Middle filltexCoord.x=(((targetCoord.x-edgeSize.x)/TextureSize.y)%1)/10+0.8;texCoord.y=((targetCoord.y-edgeSize.y)/TextureSize.y)%1;}}if(RenderingButton)texCoord.y/=2;float4color=tex2D(ScreenS,texCoord);returncolor*TintColor;}
Ah, I see :) , not that I think using Draw multiply times to compose the dialog or item is going to yield any huge performance difference (since, (depending on mode ofcourse) a draw call is effectivily between a spritebatch draw and a spritebatch end, hence it still is the same amount of draw calls as yours), yours seem very convenient. Oh yeah, though, like you said, the arithmetic is on the gpu, so that is nicer.
Regarding the blendmodes, I looked up the compatibility with xna 3.1. Looks like you'll have to do much more things more manually using the RenderState class, rather than the BlendStates already easily supported for 4.0.
I just have to set GraphicsDevice.RenderState.SourceBlend, GraphicsDevice.RenderState.DestinationBlend and GraphicsDevice.RenderState.BlendFunction to the right stuff.. There are some examples here http://forums.create.msdn.com/forums/p/75039/457237.aspx
It's not that much work.
Edit:
About multiple draw calls.. I read somewhere a while ago that for rendering the same thing many times, there is some way to get away with one draw call by sending an array of world matrices to directx, if I remember correctly. This was motivated by that this would be a lot cheaper than calling draw many times.
But it doesn't matter in this case. Performance is not an issue.
If you are talking about my ftp server..
I rent a virtual server at https://www.hosteurope.de/
And use the installed Microsoft IIS ftp server. For the error reports and libraries, I wrote my own server side program.
I just have to set GraphicsDevice.RenderState.SourceBlend, GraphicsDevice.RenderState.DestinationBlend and GraphicsDevice.RenderState.BlendFunction to the right stuff.. There are some examples here http://forums.create.msdn.com/forums/p/75039/457237.aspx
It's not that much work.
Haha yeah, I know that article, I've been using it myself. It's still only valid for XNA 4.0. Point was anyway, that in 3.1 you'll have so many more things to set, if you compare the versions. Be prepared that they might not work right from the start though (I had troubles with some of them), but oh well.
Edit: I have a request by the way. It would be very very convenient if you added the option to test the map even though starcraft is already running. There is a restart argument as far as I know, which you can send to the game. As such, it allows you to test the map much faster since reloading will take much lesser time, for the compensation of memory usage.
I got blending working for all but subtract, which for some reason acts up and gives me a purple image, regardless of source or destination colors. For the others, it was just those 3 properties.
I have tried again and again to make it load the map without having to restart it. If you know how, I would love to know.
That's very interesting, the only one I seem to have had problems with, is Darken (for some reason I got the alpha wrong)
Taken pretty much directly from that thread, here's what I had for mine:
// There are blendstates (blend modes)publicstaticclassBlendStateExtra{publicstaticBlendStateSubtract=newBlendState{ColorSourceBlend=Blend.SourceAlpha,ColorDestinationBlend=Blend.One,ColorBlendFunction=BlendFunction.ReverseSubtract,AlphaSourceBlend=Blend.SourceAlpha,AlphaDestinationBlend=Blend.One,AlphaBlendFunction=BlendFunction.ReverseSubtract};publicstaticBlendStateMultiply=newBlendState{ColorSourceBlend=Blend.DestinationColor,ColorDestinationBlend=Blend.InverseSourceAlpha,ColorBlendFunction=BlendFunction.Add,AlphaSourceBlend=Blend.SourceAlpha,AlphaDestinationBlend=Blend.InverseSourceAlpha};publicstaticBlendStateScreen=newBlendState{ColorSourceBlend=Blend.InverseDestinationColor,ColorDestinationBlend=Blend.InverseSourceAlpha,ColorBlendFunction=BlendFunction.Add,AlphaSourceBlend=Blend.SourceAlpha,AlphaDestinationBlend=Blend.InverseSourceAlpha};// Darken seems to fail and draw black where it's supposingly transparancy.publicstaticBlendStateDarken=newBlendState{ColorSourceBlend=Blend.One,ColorDestinationBlend=Blend.One,ColorBlendFunction=BlendFunction.Min,AlphaSourceBlend=Blend.SourceAlpha,AlphaDestinationBlend=Blend.InverseSourceAlpha,};publicstaticBlendStateLighten=newBlendState{ColorSourceBlend=Blend.One,ColorDestinationBlend=Blend.One,ColorBlendFunction=BlendFunction.Max,AlphaSourceBlend=Blend.SourceAlpha,AlphaDestinationBlend=Blend.InverseSourceAlpha};}
As for restarting the map, Mindy (MindWorX) told me that they made it in the sparsile project, but he never told me exactly how. Try to contact him (and I could also let him know to respond in this thread) to find out.
I also got an error as i tried to start the editor after I reinstalled it. But Windows 7 gave me a solution : Microsoft .NET Framework 4 (Webinstaller)
and it works just fine. Thanks for the patch ;)
@SBeier: Go
I'm not entirely sure everyone needs to install the entire xna game studio for it. Installing only the redistributable for XNA 3.1 seems to have been sufficient (for me) to allow the assembly to load.
Now for something else, it appears that even if I can start it, the dialog don't appear after I have created it. In fact, no dialog component is, so I wonder what that's all about. http://dl.dropbox.com/u/2757798/IMG_04122011_012638.png
---
A bug regarding your library feature by the way. Say I take one of your libraries and use, doubleclicking the same library file several times will let it pop up as multiple tabs.
---
If you like, since I did start with working on a dialog designer for you before, I could see if there's something you can use for yours. I'm mainly thinking scaling of dialogs and blendstates for dialog items (lighten, darken, additive etc). There might be some problems though with the latter one, since I was using xna 4.0 and not xna 3.1. But it's your call ofcourse, just letting you know that I have some things that could save you some time :)
@Kroemel: Go
Yeah, I changed the target framework to .net 4.0, instead of .net 4.0 client profile.. that is probably what caused that. You should still need xna 3.1 to create dialogs though.
@Mexaprone: Go
That's rather wierd.. You're sure that is a fresh dialog? I got an error report from you - that you crashed when creating a new dialog, because you didn't have xna 3.0.. you deleted that dialog, right?
Im not sure what you are refering to when you say scaling of dialogs - I don't see a scale property for dialogs or dialog controls. But about blendstates.. I haven't looked much into that. I'm guessing you would just be setting the blend function on the graphics device, but if you got a code that does the job, I wouldn't decline :)
Yeah, it's a fresh dialog. I did get the xna framework 3.1 redistributablable too, so it does load the assembly properly.
One thing I noticed now when trying again (still the same as before, malfunctioning) is that I can see the cursor changing when it hovers over the "dialog", so I know it's there, and I can move it around as well.
Here's some additional info of what I can see:
Suggestions, by the way:
The scaling was not realted to the dialogs and items themselves having a scaling option, but more for the scaling of the entire designer surface scaling the dialogs and items accordingly, just like starcraft 2 does.
Hmm.... what graphics card do you have? Does it support v3.0 shaders? I had some trouble with too many operations for a v2.0 shader, so I just ramped up the required version.. but I could look into alternatives.
Yeah, adding support for extra image types should be fairly trivial, and I'll remove that useless option.
I already give you the option to set the target screen height, as I do in my video - which affects scale.
Edit:
I'll lower the required pixel shader version from 3.0 to 2.0a.. hope most people can run that.
I should be very much able to run 3.0 shaders. Despire it being abit over 2 years old by now, it does have directx 10.1 support. http://www.amd.com/us/products/notebook/graphics/ati-mobility-hd-4000/hd-4600/Pages/hd-4600-specs.aspx
Yeah, looking at that, I do even have shader model 4.1, so whether your downgrade or not will work, I'm not sure. The flaw all along could lie in xna incompatibility I suppose.
Looking at msdn, I suppose you use the HiDef profile, if your current shader model is v3.0. Swapping that to reach would set it to shader model 2.0, but I suppose that is what you said you are going to test :>. Though, I have been using the HiDef profile before without problems, so I don't know either.Edit: Does not seem to exist for XNA 3.1
The reason It looks to me that this is the issue is that all my shaders are for 3.0, except horizontal border, which is 2.0.. I'll release this, and we'll see if it works.
If you wanna track im sure you know enough to have the editor open a url in the back ground .... the url can just be an online statistics tracker.... like your average.... web site usage tracker...
Hmm. the front page stuff is really quite old.. I should probably rewrite it.. Right now, I can run statistic tools on downloads/accesses to the ftp server. Since the program checks there for new versions each time it is launched, it's a good source of info for me.
Edit:
Okay, it wasn't on the front page. Still - it's not a problem anymore.
Out of curiosity, why did you pick XNA 3.1 over 4.0? You're using .NET 4.0 anyways. As far as I know, XNA 4.0 has much better support when it comes to fonts, for instance.
Well, the reason is that before xna 4.0 came out, I was working on a space game in xna (kindda like freelancer). When 4.0 came out, I looked into the changes to see if I wanted to port it to 4.0, and decided that I liked the way the coding was done in 3.1 better. So I guess it's just because i'm more used to 3.1 than 4.0. The fonts do annoy me, and I don't know how to fix it, but I'm also not guaranteed that it will look right in 4.0.
@SBeier: Go
There, the new version seems to work much better :). Another question, why did you decide to use a custom shader/fx for the dialogs? You would be able to basically do the same thing with solely a SpriteBatch. Or perhaps you're using them both combined? Sorry if I aquestion you too much :P
I'll report back for other bugs/feedback later, if I come across any, as usual.
I am using the spritebatch to draw.. But rather than make multiple draw calls for different regions of the texture, I use the effect file to calculate what texture coordinate to use (for the different image types). First of all, this should be faster, simply because I get fewer draw calls, and I can push some arithmetic to the gpu. The speed gain probably isn't noticeable though, since the scene is so simple. Also, I think this solution is cleaner.. I have fewer variables to keep track of - just tex coord x and y. Otherwise, I would need rotation, source rectangle, destination rectangle and origin.
Some of my draw code:
In case you're interested.. one of my shaders:
Ah, I see :) , not that I think using Draw multiply times to compose the dialog or item is going to yield any huge performance difference (since, (depending on mode ofcourse) a draw call is effectivily between a spritebatch draw and a spritebatch end, hence it still is the same amount of draw calls as yours), yours seem very convenient. Oh yeah, though, like you said, the arithmetic is on the gpu, so that is nicer.
Regarding the blendmodes, I looked up the compatibility with xna 3.1. Looks like you'll have to do much more things more manually using the RenderState class, rather than the BlendStates already easily supported for 4.0.
I just have to set GraphicsDevice.RenderState.SourceBlend, GraphicsDevice.RenderState.DestinationBlend and GraphicsDevice.RenderState.BlendFunction to the right stuff.. There are some examples here http://forums.create.msdn.com/forums/p/75039/457237.aspx
It's not that much work.
Edit:
About multiple draw calls.. I read somewhere a while ago that for rendering the same thing many times, there is some way to get away with one draw call by sending an array of world matrices to directx, if I remember correctly. This was motivated by that this would be a lot cheaper than calling draw many times.
But it doesn't matter in this case. Performance is not an issue.
What do you use to host these files?
If you are talking about my ftp server..
I rent a virtual server at https://www.hosteurope.de/
And use the installed Microsoft IIS ftp server. For the error reports and libraries, I wrote my own server side program.
Haha yeah, I know that article, I've been using it myself. It's still only valid for XNA 4.0. Point was anyway, that in 3.1 you'll have so many more things to set, if you compare the versions. Be prepared that they might not work right from the start though (I had troubles with some of them), but oh well.
Edit: I have a request by the way. It would be very very convenient if you added the option to test the map even though starcraft is already running. There is a restart argument as far as I know, which you can send to the game. As such, it allows you to test the map much faster since reloading will take much lesser time, for the compensation of memory usage.
I got blending working for all but subtract, which for some reason acts up and gives me a purple image, regardless of source or destination colors. For the others, it was just those 3 properties.
I have tried again and again to make it load the map without having to restart it. If you know how, I would love to know.
That's very interesting, the only one I seem to have had problems with, is Darken (for some reason I got the alpha wrong)
Taken pretty much directly from that thread, here's what I had for mine:
But unfortunantly it requires XNA 4.0, and also the "Reach"´graphics profile only available there as well. The rest of the blendfunctions (alpha, additive) was already included in XNA 4.0 as static blend states ( http://www.innovativegames.net/blog/blog/2010/07/13/xna-4-0-blend-states/ )
-------
As for restarting the map, Mindy (MindWorX) told me that they made it in the sparsile project, but he never told me exactly how. Try to contact him (and I could also let him know to respond in this thread) to find out.