Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Gurok

#41
Can we have a Skype contact details field added to the forum profile page? I use Skype almost exclusively these days and would like to list my Skype username.

Not sure about this, but we might be able to remove the Windows Live Messenger contact field too. I heard it was being phased out, but I can still sign in (though I never see anyone online anymore).
#42
Hello,

I've been tinkering around with the AGS source for the last week or so. I'm mostly concentrating on some bugs that affect me, but I think they'll also benefit the community at large. Under Crimson Wizard's advice, I've also started back/forward/sideporting some of the changes in the Draconian edition to a format suitable for mainline AGS. Here are some things I am going to try to get into AGS 3.3.1. I'd like your feedback, comments, criticism, etc. I would appreciate code reviews, but I'd also just like general advice like "that's not important" or "we wouldn't want x option to work that way". I may change the target version for these, rethink them a bit or just scrap them completely.


Vsync for Direct3D
https://github.com/gurok/ags/compare/vsync

This is something that Alan v.Drake implemented in his fork, but it was hard coded. The real problem with Direct3D and vsync is that it needs to be initialised before the game starts. Here's what I did to solve the problem:
There's now a new option in winsetup.exe called "vertical sync".
If it's checked, the game starts with vertical sync turned ON.
In DirectX 5 mode, the game can still toggle this setting with System.VSync.
In DirectX 9 mode, the System.VSync property becomes read-only.


Code Regions
https://github.com/gurok/ags/compare/code_regions

This is another thing I grabbed from Alan v.Drake's work. He added some directives to allow you to wrap sections of code arbitrarily, e.g.

#region
if(something)
{
...
}
#endregion

You could then fold the code to show or hide these regions. Useful for large, hard-to-maintain global scripts.


Software Sprite Scaling
https://github.com/gurok/ags/compare/software_sprite_scaling

This was a common complaint when I was reading through a thread by Dave Gilbert about releasing commercial games with AGS. In Direct3D mode, the sprite scaling uses the screen's resolution and not the game's. Nothing breaks immersion like pixels of different sizes. I thought about fixing the Direct3D implementation. The thing is, by the time sprites end up at the Direct3D, we have next to no information about what their "real" size should be. It turns out the code path for software rendering of sprites is still available to Direct3D, it's just not being used. This patch provides a new option in General Settings called:

Force software scaling and flipping

When set to true, it will tell AGS to use software scaling, regardless of whether Direct3D's "superior" hardware accelerated scaling is available.


For, Break, Continue
https://github.com/gurok/ags/compare/for_break_continue

This would be the first baby step towards making AGS a more C-like language. I read a thread a while ago where CJ mentioned that for() and do and things like that were just duplications of while(). I don't agree that we should be limited to only using while statements. There's something to be said for the readability that comes with a standard set of control statements. That's why I'm proposing three new commands:

for([initialisation]; [check]; [increment])
{
    ...
}

continue;

break;

This would be the first step toward a more expressive AGS scripting language. I know there have been efforts to introduce LUA in the past, but this is something that can work immediately. In the future, I would plan to introduce more statements, like switch() and do, as well as struct parameter passing.

Technically speaking, the jumps for all of these commands already existed in the AGS code. There's a slight modification (some two phase parsing) needed to parse the increment of a for loop, but nothing more than what happens when calculating the jump for a while loop. I also refactored the parsing of assignments (first part of a for loop) to allow for this change.

This is a change that I think would need some serious testing. Everything it generates is stuff other commands generate (JZ, JMP, MOV, LITTOREG, etc.), but it's possible to seriously screw up a compile if some of the code is wrong. The good news is, if there are bugs, you can just remove the for, continue and break statements from your code and everything should function as before.

In terms of efficiency, continue is very efficient if it eliminates a check e.g. if(continue == true). Break involves the same number of jumps as a normal loop termination. There was no way to eliminate the second jump required. The for loop should be about as efficient was writing out a similar while loop by hand, e.g. x = 0; while(x < 10) { ... x++; }.


Portrait Positioning
https://github.com/gurok/ags/compare/portrait_positioning

Here is my unanswered thread about this problem:

http://www.adventuregamestudio.co.uk/forums/index.php?topic=49927.0

The positions for character portraits are sticky because AGS has no idea of who was talking before the current character once the speaking character has actually changed. My solution was to implement a two object "stack" of actively speaking characters. That way, if a character speaks, moves and speaks again, AGS still knows to whom that character was speaking and can use the relative position of the character to determine which side the portrait should be on.

If the speaking character is the first character to speak when entering a room, AGS takes a guess at which character they're speaking to by grabbing the first character it can find. I thought this could be a bit smarter, so I made it assume the character speaking was talking to the player first (if applicable), then try any random other character in the room.

This is a bit of a personal bugbear as X-based positioning for character portraits is unusable for me right now.


Text Window GUI Padding
https://github.com/gurok/ags/compare/text_window_gui_padding

This is one of the first things I proposed to CW and it's looking like 3.3.1 will be the release this makes it into.

It's very simple. Currently, text window GUIs put an amount of padding around the text in them. It turns out that this padding was a hard coded 3 pixels. This change adds a new property called "Padding" to text window GUIs and allows you to adjust this value (default is 3). I can't believe there haven't been any other complaints about this. It basically makes it impossible to make tight speech windows.


--

I'm currently focused on porting the stuff from Alan v.Drake that's still relevant. I might add to this discussion when I've got a list of the new scripting commands he added. Some of them will need to be discussed. People tell me to check the bug tracker. I've had a look there, but I also need to pick and choose things I can actually do. A lot of those tasks seem enormous and I'm only just finding my feet in the AGS source.


P.S. CW, is this the sort of discussion you were after?
#43
Hello,

I'm having trouble with the "BasedOnCharacterPosition" setting of "Sierra-style portrait location" in the general settings area of my AGS game. I'm using AGS version 3.3.0 (RC1). I actually made a test game to demonstrate the problem because my game is quite complex and I'm not sure what the problem is.

I've set up a blue version of Roger that the player can talk to. If the player talks from the right side of the character, the blue Roger's speech is displayed on the left and then remains on the left for the rest of the game. Even if the player subsequently moves to the left of blue Roger, blue Roger continues to talk from the left of the screen. This is what I mean by "sticky". I have found that adding a line of dialogue from another character fixes the problem, but any conversation I have with just one line of dialogue seems to suffer from the same issue (until a multi-character dialogue gets run).

Why is this happening? Can I fix it or work around it?

Here is my test game. It's just a new, basic game with a duped Roger sprite, a new char and a few new views to support the settings I've chosen. All you need to do is talk to blue Roger, then move to the left of blue Roger and talk to him again to see the magic happen.

Test game
#44
When I tell AGS to use a custom Text Window GUI for speech via:

Code: ags

game.speech_text_gui = gSpeech.ID;


The speech window has 3 pixels of padding on all edges. Is there a way to remove or adjust this padding?

Note: I'm not using any images for the borders. Just a background colour for the GUI and there's clearly 3 pixels of background colour surrounding the block of text. I am using AGS 3.3.0 Beta 12.
#45
Hello,

If I press a key on the keyboard while my player character is moving, the character stops moving. Is there any way to prevent this?
#46
Hello,

I am trying to draw this simple graphic onto a GUI:



It's a partially transparent smiley face. The actual graphic is 16x16, but I've resized it for readability.

My game is a 32-bit colour game. I used the default game and made a new GUI called gTest. I imported the sprite and used its alpha channel. I changed Roger's interact function to:

Code: ags

DynamicSprite *mySprite;

function cEgo_Interact()
{
	DrawingSurface *out;

	if(mySprite != null)
		mySprite.Delete();
	mySprite = DynamicSprite.Create(16, 16, true);
	out = mySprite.GetDrawingSurface();
	out.DrawImage(0, 0, 6);
	out.Release();
	gTest.BackgroundGraphic = mySprite.Graphic;
	gTest.Width = 16;
	gTest.Height = 16;
	gTest.X = 50;
	gTest.Y = 50;
	gTest.Visible = true;
}


Here is what I see when I interact with Roger:



Transparent pixels where semi-opaque ones should be and opaque pixels remain where transparent ones are.

I've read some of the articles about AGS and blending and I appreciate that things are a little wonky when it comes to transparency in AGS. I'm not asking AGS to blend the sprite here. I just want it to set the alpha to a non-zero value for semi-transparent areas. Here's what I'd expect to see instead:



I would then be able to happily turn off the border/background and have a semi-transparent GUI.

I have tried playing around with various parameters to the functions. About the only thing that seems to make a difference is toggling transparency on the surface. If I set it to false, I get the classic purple blending going on:



I guess this proves that AGS is seeing my image has non-zero alpha in those areas, but not much else.

Please help me figure this out, guys. What do I need to do to draw this correctly on a DynamicSprite? If you want to try to replicate this, here's what I did:

1. Create a new default game
2. Set the colour depth to 32-bit
3. Add a new GUI called gTest
4. Import this sprite (here's the exact sprite: ) as sprite number 6
5. Replace Roger's interaction with the code above
6. Run the game and interact with Roger

Note: I am running 3.3.0 Beta 12.
#47
Hello,

I'm using AnimateOnlyOnHotspots combined with a single frame view to make my cursor glow when the user mouses over a hotspot, character or object. Is there a nice way to make my cursor glow when the user mouses over an inventory item too?
#48
Critics' Lounge / New Character for C & C
Wed 19/05/2004 00:36:32
Hi.

I've been working on a character for an adventure game I'm creating for quite some time now, and I'd like some comments and criticism on him. Please keep in mind that the character will have two 'costumes' in the game, and this is the first, simpler, plainer costume of the two.

Here he is:

And a bigger one for the pixelly pedantic:


His name is Thod. And he's actually gone through quite an evolution, and began life as a sketch:


Which I then traced over and altered using Paint Shop Pro...


And finally touched up and shaded using the various Paint Shop Pro tools, as you can see above. I've been a bit undecided along the way about how his feet/shoes should look.

I've done some animations of him in the past, using the sketches, but I need to transfer him to pixelated (pixel-shaded?) form before I can get him looking any good in a game.

And after this costume has been given a roasting, I'll hopefully be coming back with properly shaded and coloured versions of him in this costume:
SMF spam blocked by CleanTalk