• 0

    posted a message on Galaxy++ editor

    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.

    Posted in: Third Party Tools
  • 0

    posted a message on Dialog Drag and Drop designer

    What do you mean by for later callback? It is not possible to generate the visual designer based on code, and I don't plan to implement it at this time.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Galaxy++ editor

    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.

    Posted in: Third Party Tools
  • 0

    posted a message on Galaxy++ editor

    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.

    Posted in: Third Party Tools
  • 0

    posted a message on Galaxy++ editor

    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 (Dialog d in items)
    {
        //A list of what should be rendered, in the order it should be rendered
        List<AbstractControl> renders = new List<AbstractControl>();
        renders.Add(d);
        //Each dialog has a list of controls, sorted after render priority
        renders.AddRange(d.ChildControls);
        while (renders.Count > 0)
        {
            AbstractControl item = 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 type
                Effect.CurrentTechnique = Effect.Techniques[Enum.GetName(typeof (ImageType), item.ImageType)];
                //Clip rectangle used to clip controls when they are dragged outside of their parent dialog
                SpriteBatch.GraphicsDevice.RenderState.ScissorTestEnable = true;
                SpriteBatch.GraphicsDevice.ScissorRectangle = item.ClipRect;
                Texture2D texture = item.Texture ?? defaultTexture;
                //Buttons/check boxes have both pressed/not pressed images in same texture
                Effect.Parameters["RenderingButton"].SetValue(item is Button || item is CheckBox);
                Effect.Parameters["Tiled"].SetValue(item.IsTiled);
                Effect.Parameters["TintColor"].SetValue(item.Color.ToVector4());
                Effect.Parameters["TextureSize"].SetValue(new Vector2(texture.Width, texture.Height));
                Effect.Parameters["TargetSize"].SetValue(new Vector2(item.DrawRect.Width, item.DrawRect.Height));
                SpriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate, SaveStateMode.None);
                //Todo: Set blend function
                Effect.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 title
            if (item is Dialog)
            {
                Dialog dialog = (Dialog) item;
                if (!string.IsNullOrEmpty(dialog.Title))
                    DrawString(dialog.Title, dialog.TitleFontRect, dialog.TitleFont, Color.White);
            }
            //Draw the control's text if needed
            if (item is DialogControl)
            {
                DialogControl control = (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:

    float4 HorizontalBorderPS(float2 texCoord: TEXCOORD0) : COLOR
    {
    	float2 targetCoord = texCoord * TargetSize;
    	float2 edgeSize = 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 left
    			texCoord.x = targetCoord.x/(TextureSize.y*10);
    			texCoord.y = targetCoord.y/TextureSize.y;
    		}
    		else if (TargetSize.y - targetCoord.y < edgeSize.y)
    		{
    			//Bottom left
    			texCoord.x = targetCoord.x/(TextureSize.y*10) + 0.2;
    			texCoord.y = (targetCoord.y - TargetSize.y + TextureSize.y)/TextureSize.y;
    		}
    		else
    		{
    			//Left border
    			texCoord.x = targetCoord.x/(TextureSize.y*10) + 0.6;
    			texCoord.y = ((targetCoord.y - edgeSize.y)/TextureSize.y)%1;
    		}
    	}
    	else if (TargetSize.x - targetCoord.x < edgeSize.x)
    	{
    		if (targetCoord.y < edgeSize.y)
    		{
    			//Top right
    			texCoord.x = (targetCoord.x - TargetSize.x + TextureSize.y)/(TextureSize.y*10) + 0.1;
    			texCoord.y = targetCoord.y/TextureSize.y;
    		}
    		else if (TargetSize.y - targetCoord.y < edgeSize.y)
    		{
    			//Bottom right
    			texCoord.x = (targetCoord.x - TargetSize.x + TextureSize.y)/(TextureSize.y*10) + 0.3;
    			texCoord.y = (targetCoord.y - TargetSize.y + TextureSize.y)/TextureSize.y;
    		}
    		else
    		{
    			//Right border
    			texCoord.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 border
    			texCoord.x = ((targetCoord.x - edgeSize.x)/(TextureSize.y))%1;
    			texCoord.y = targetCoord.y/TextureSize.y;
    			//Need to rotate
    			float temp = texCoord.x;
    			texCoord.x = texCoord.y;
    			texCoord.y = 1 - temp;
    			//Ajust to region
    			texCoord.x = texCoord.x/10 + 0.4;
    		}
    		else if (TargetSize.y - targetCoord.y < edgeSize.y)
    		{
    			//Bottom border
    			texCoord.x = ((targetCoord.x - edgeSize.x)/(TextureSize.y))%1;
    			texCoord.y = (targetCoord.y - TargetSize.y + TextureSize.y)/TextureSize.y;
    			//Need to rotate
    			float temp = texCoord.x;
    			texCoord.x = texCoord.y;
    			texCoord.y = 1 - temp;
    			//Ajust to region
    			texCoord.x = texCoord.x/10 + 0.5;
    		}
    		else
    		{
    			//Middle fill
    			texCoord.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;
    	float4 color = tex2D(ScreenS, texCoord);
        return color * TintColor;    
    }
    
    Posted in: Third Party Tools
  • 0

    posted a message on Dialog Drag and Drop designer

    Your source says the uncompressed size. I doubt it's just the mapscript.galaxy file.. could just make that include a humongous script file, which would be a pretty easy workaround. Still.. it seems like kind of a silly limit.. Add Shakespeare's collected works in a comment, and you hit it with no code at all..

    Posted in: Galaxy Scripting
  • 0

    posted a message on Dialog Drag and Drop designer

    @SouLCarveRR: Go

    I can make the background be loaded from an image in the folder instead.

    Hmm. I haven't experienced issues with the resizing. Is it because the boxes are too small? Do anyone else have this issue? Do you have exact steps to replicate the problem on a fresh dialog?

    This might be counter intuitive, but when you place dialog items, you should hold the mouse down and drag them out to the desired size..
    In a future version, I might set a default size if this is not done.

    The other dialogs are attached to the main dialog, or whatever dialog you set to be their parent. In the output, you might see

    Dialogs_Newdialog_array[currentStruct].dialog2 = DialogCreate(156, 122, c_anchorTopLeft, 24, -2, false);
    DialogSetPositionRelative(Dialogs_Newdialog_array[currentStruct].dialog2, c_anchorTopLeft, Dialogs_Newdialog_array[currentStruct].dialog1, c_anchorTopRight, 24, -2);
    

    When you add a child dialog.

    You can do image processing just with the cpu, yes. But since the whole point of a graphics card is image processing, it has a lot of tools for it which you would have to write for the cpu yourself. And doing it with the gpu gives you a performance boost.

    @FuzzYD: Go

    Okay.. any idea how many lines we are talking about?

    @Kalekin: Go

    I quite like the idea of putting it in layout files, since it feels like that's where it belongs. I haven't toyed around with them much though.. Can you set values pr player and pr race? Are there anything you can do there, but not in script? Anyway, as for now, I will keep rolling with script, but once I get bugs and features sorted, I might look into it.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Galaxy++ editor

    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.

    Posted in: Third Party Tools
  • 0

    posted a message on Dialog Drag and Drop designer

    @SouLCarveRR: Go

    Okay.. that's the directory.. Just delete it.. Ill fix the updater for next version.

    @Kalekin: Go

    No. I couldn't find out where/if the stuff like buttons, checkboxes etc are defined in layout files, so it just mimics what it looks like in game. As for the output, that is galaxy script

    @SouLCarveRR: Go

    If you import the custom images to your map, you should be able to select them from the list.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Galaxy++ editor

    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.

    Posted in: Third Party Tools
  • 0

    posted a message on Dialog Drag and Drop designer

    I uploaded a new version.

    Anyway, the background image is not the issue - added that because it's more interesting to look at than a flat color.. And in game, you would have a similar background.

    From what mexa told me, it sounds to me like its an issue with shader versions.. but both yours and mexa's card should have no trouble with pixel shaders v 3.0....

    Posted in: Galaxy Scripting
  • 0

    posted a message on Dialog Drag and Drop designer

    As a AAA game company would say, "We are aware of this issue, and are currently working on a solution" :) I'll upload a new version momentarily.

    Just out of curiosity.. what graphics card do you have?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Galaxy++ editor

    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.

    Posted in: Third Party Tools
  • 0

    posted a message on Dialog Drag and Drop designer

    I put a refference to it in the top post ;)

    You will find the latest version here
    ftp://46.163.69.112/Releases/

    Posted in: Galaxy Scripting
  • 0

    posted a message on Galaxy++ editor

    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.

    Posted in: Third Party Tools
  • To post a comment, please or register a new account.