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

Messages - fovmester

#121
I like the first one best! It's much cleaner and simpler. And the lighting's great!
#122
Quote from: Ashen on Thu 27/10/2005 22:20:16

fovmester:
Obvious one, but do you have a GUI at y=220 that might be blocking clicks? I've had that problem with a statusline GUI (mostly transparent, and I forgot it was there), but once I made it non-clickable it was fine.

I thought about that myself, but since I position the status line just below the cursor I didn't think it would be a problem. But now I remembered that I reposition it ABOVE the cursor at y>220 so that the text willremain inside the screen area. What I didn't think of is that the GUI now was covering the cursor and therefore on_mouse_click wasn't called. I changed the GUI to not clickable and now it works!! Thanks Ashen!!
#123
When I click the mouse on the bottom of the screen mouse.y > 220 no action happens. I looked into it and found that on_mouse_click isn't called when mouse.y > 220. My game runs in 640 x 480 resolution. Could that have something to do with it? Is it a bug? I don't think it's my coding (since I don't know how to prevent the engine from calling on_mouse_click whenever the user clicks).
#124
Quote from: Elliott Hird on Wed 26/10/2005 19:03:40
PreloadChunk(int milliseconds, BlockingStyle blocking)

That sounds a bit too low-level for a script language.
#125
What you want to do is to buy a good mic, go to a really quiet place, ( like the country side or a university at night) and do your recordings there. That's the way to get the best results. It takes a bit of time and planning, but it could very well be worth it!
#126
I like that, Prog!  :D
#127
Quote from: Iv4n on Sun 23/10/2005 20:44:39
Yeah, I just wanted to metion the cursor mode issue too and that I like the trees :). Somewhat I don't like much is when Tom meets the evil wizrard. They talk too much! I mean a real evil wizzard shouldn't show all his playing cards, especially at the beginning, right? Maybe this is a way to tell a story, but somehow it's strange and it doesn't fit for me.
Well he doesn't really show ALL his cards. Not many at all in fact.

Spoiler
All he does is demands payment and hints that the woodsfolk can't rely on Nergal to protect them anymore. He doesn't say why or what his plans are. He just states that HE is the new ruler of the forest.
[close]
#128
Quote from: Pablo on Sun 23/10/2005 15:44:06
I didn't like it when the cursor mode automatically changes to walk mode when you click on something, but otherwise it's a very cool interface.

That's a good point. Never thought about how irritating that could be. Especially since you might have to cycle through a lot of cursor modes again and again. I'll think about changing it.

Thanks for the great comments on the face expressions. I'm glad you like it since it has taken quite an effort to do!
#129
Quote from: Ozzie on Sat 22/10/2005 13:23:27
The problem with the trees isn't that they aren't enough detailed, they are, but from the way you draw them they look a bit unnatural, strange. It's not a big thing, they are ok, but it stood out for me. When I think about it, it was only the big tree on the second screen which was so striking in this regard.

The graphics as a whole are more than pleasant enough to not distract from the plot/action, much more, the animations for example of the drummer, flute player and the dancers are extraordinary. Also, you clearly get better the more backgrounds you create. Maybe you just have to find a way to draw some trees better in the future, however, the most important thing is that you finish it. Of course that doesn't mean that you should rush it but on this quality level this will already become one of the best AGS games ever, I guess!  :=

Well, the tree in the junie village is an old old one and therefore I drew it like I did, with a huge trunk and lots of texture. Anyway, I'm glad you like the game so far!

I just wanted to tell you that the out of memory problem has been fixed. It was actually a memory leak in the AGS engine (GUI.SetWidth/SetHeight/SetSize), but CJ has fixed it now. I uploaded a fixed version to the homepage for you that haven't been able to play it because of the memory leak (shouldn't be that many).
#130
Yep! That fixed it! Thanks, CJ! You're the man!
#131
Quote from: Gilbot V7000a on Sat 22/10/2005 11:39:10
Hehe, but since from his codes he's using the "latest stable version" (i.e. V2.7), fixing it would mean he'll need to upgrade to the "not yet stable version" (i.e. V2.71), and he may need to update the string codes for his game to work... unless you compile a service release binary of the V2.7 engine.

Well I was using 2.7 but now I use 2.71, and it compiled well. I think 2.71 is backward compatible!!

Great that you found it, CJ!
#132
I'm overwhelmed!!  :D

Thank you so much!

About the trees, I'm thinking about putting a lot of thick moss on them to make the forest seem more ancient. But at this point that is a lot of moss to draw, so I have to think about if it's really worth it first.
#133
I think SteveMcCrea has found our memory leak!! When I commented out the status line code (shown below) the memory usage was constant, but uncommenting it again made it increase gradually. I can't see WHERE in the code the problem is though. The code is taken from repeatedly_execute.

To understand the code you should know that I use some properties "Look at", "Use", "Pick up" and "Talk to" to get the text that will be shown for a certain command over a certain hotspot/object/character.

Ex: Talk to food -> Eat food
      Use tree -> Climb tree

And I differ between character/living objects and non living things when using the "Use inv"-command

Ex: Use herbs with Gorbye -> Give herbs to Gorbye

I hope someone can see what's the problem with this code!!!




Code: ags
		
                        string objectText;
			string commandText;
			
			int default = 1; //no inv,ch,hot or obj
			if (Mouse.Mode==eModeWalkto) {
				StrCopy(commandText, "Walk to");
				default = 0;
			}
				
			if (Mouse.Mode==eModeUseinv) {
			  string invName;
			  InventoryItem *in = cTom.ActiveInventory;
			  if (in!=null) {
					in.GetName(invName);
			  	StrCopy(commandText, "Use ");
					StrCat(commandText, invName);
					StrCat(commandText, " with");
					default = 0;
				} else StrCopy(commandText, "Use");			
			}
	
			int x = mouse.x;


			int y = mouse.y;
			Hotspot *hot = Hotspot.GetAtScreenXY(x, y);
			Object *obj = Object.GetAtScreenXY(x,y);
			Character *ch = Character.GetAtScreenXY(x, y);
			InventoryItem *inv = InventoryItem.GetAtScreenXY(x,y);
			
			
			if (inv != null) { //if clicking on inventory item don't show char,obj or hotspot text
			  obj = null; ch = null;
			  }
			if (obj!=null && ch!=null) {//making sure the object or the char in front gets handled
				if (obj.Y > ch.y) ch = null;
				else obj = null;
			}
			
			string buffer;
			if (inv != null) {
				default = 0;
				inv.GetName(objectText);				
				if (Mouse.Mode==eModeLookat) {				  
					inv.GetPropertyText("Look at", buffer);
					StrCopy(commandText, buffer);
				} else if (Mouse.Mode==eModeInteract) {				  
					inv.GetPropertyText("Use", buffer);
					StrCopy(commandText, buffer);
				} else if (Mouse.Mode==eModeTalkto) {				  
					inv.GetPropertyText("Talk to", buffer);
					StrCopy(commandText, buffer);
				} else if (Mouse.Mode==eModePickup) {				  
					inv.GetPropertyText("Pick up", buffer);
					StrCopy(commandText, buffer);
				}				
			} else if (hot != hotspot[0]) {
			  default = 0;
				hot.GetName(objectText);				
				if (Mouse.Mode==eModeLookat) {				  
					hot.GetPropertyText("Look at", buffer); //gets the appropriate text for the look-command
					StrCopy(commandText, buffer);
				} else if (Mouse.Mode==eModeInteract) {				  
					hot.GetPropertyText("Use", buffer);//gets the appropriate text for the use-command
					StrCopy(commandText, buffer);
				} else if (Mouse.Mode==eModeTalkto) { //gets the appropriate text for the talk to-command
					hot.GetPropertyText("Talk to", buffer);
					StrCopy(commandText, buffer);
				} else if (Mouse.Mode==eModePickup) {	//gets the appropriate text for the pickup-command
					hot.GetPropertyText("Pick up", buffer);
					StrCopy(commandText, buffer);
				}				
			} else if (obj != null) {
			  default = 0;
				obj.GetName(objectText);
				if (Mouse.Mode==eModeUseinv && obj.GetProperty("noWalkView")==1) { 
					//this is a hack to differ between living 
					//and not living objects: GetProperty("noWalkView")==1 for living things
					string invName;
					InventoryItem *in = cTom.ActiveInventory;
					if (in!=null) {
						in.GetName(invName);
						StrCopy(commandText, "Give ");
						StrCat(commandText, invName);
						StrCat(commandText, " to");
					default = 0;
					} else {
						ch.GetPropertyText("Use", buffer);
						StrCopy(commandText, buffer);
					}	
				} else if (Mouse.Mode==eModeLookat) {				  
					obj.GetPropertyText("Look at", buffer);
					StrCopy(commandText, buffer);
				} else if (Mouse.Mode==eModeInteract) {				  
					obj.GetPropertyText("Use", buffer);
					StrCopy(commandText, buffer);
				} else if (Mouse.Mode==eModeTalkto) {				  
					obj.GetPropertyText("Talk to", buffer);
					StrCopy(commandText, buffer);
				} else if (Mouse.Mode==eModePickup) {				  
					obj.GetPropertyText("Pick up", buffer);
					StrCopy(commandText, buffer);
				}
			} else if (ch != null) {
			  default = 0;
			  StrCopy(objectText,ch.Name);
			  
				if (Mouse.Mode==eModeUseinv) {
					string invName;
					InventoryItem *in = cTom.ActiveInventory;
					if (in!=null) {
						in.GetName(invName);
						StrCopy(commandText, "Give ");
						StrCat(commandText, invName);
						StrCat(commandText, " to");
					default = 0;
					} else {
						ch.GetPropertyText("Use", buffer);
						StrCopy(commandText, buffer);
					}	
				} else if (Mouse.Mode==eModeLookat) {				  
					ch.GetPropertyText("Look at", buffer);
					StrCopy(commandText, buffer);
				} else if (Mouse.Mode==eModeInteract) {				  
					ch.GetPropertyText("Use", buffer);
					StrCopy(commandText, buffer);
				} else if (Mouse.Mode==eModeTalkto) {				  
					ch.GetPropertyText("Talk to", buffer);
					StrCopy(commandText, buffer);
				} else if (Mouse.Mode==eModePickup) {				  
					ch.GetPropertyText("Pick up", buffer);
					StrCopy(commandText, buffer);
				}
			} else StrCopy(objectText,"");
			
			if (default==1) { //not over anything special
			  if (Mouse.Mode == eModeLookat) 
					StrCopy(commandText, "Look at");
				else if (Mouse.Mode == eModeTalkto) 
					StrCopy(commandText, "Talk to");
				else if (Mouse.Mode == eModePickup) 
					StrCopy(commandText, "Pick up");
			  else if (Mouse.Mode == eModeInteract) 
					StrCopy(commandText, "Use");
			}
			
			string text;
			StrCopy(text, commandText);
			StrCat(text, " ");
			StrCat(text, objectText);
			
			if (player.Room == 0) StrCopy(text, ""); //in titlescreen
			//display text
			gLabel.Controls[0].AsLabel.SetText(text);
			  
		
   
#134
Because I use the width to determine where it is on the screen, and stop it from getting outside the screen. I'm not sure but I think the game would crash if the GUI would be drawn outside the screen? Or is that just if its coordinates are outside the screen? Because if that is the case, then you are right: I don't need to change the width. I can just use the text width to make sure that THE TEXT never leaves the screen.

I will try to comment out things and see if it helps, but that will take some time so I won't be able to do it today.
#135
QuoteMy gut feeling would be that I would suspect this code most. I'm not sure why resizing a GUI to the text it contains would be necessary, unless the GUI provides a border or backgroudn to the text. Maybe there's a memory leak in the GUI resizing code in AGS: does the GUI have a BG image that gets clipped? Mayeb the dynamic sprite I guess that is created for the clipped background doesn't get cleared up  properly, or something? The declaring of the pointers shouldn't matter as they just create another reference to an existing object...

The GUI has no borders and no background image so I don't think there's any Dynamic Sprite being created. I show the status bar next to the cursor so I need to control the size so that the text is always on one line.

I didn't show you that I also reposition the statusbar-GUI every loop so that it always stays next to the cursor. I use gLabel.SetPosition for this.

About the module. Nice change!!
#136
I started my game and let it run in a room with some animating objects.  I didn't move anything or do anything in the game. I just let it be.
After about half an hour I the game crashed and I got this error message:


---------------------------
Adventure Game Studio
---------------------------
An internal error has occured. Please note down the following information.
If the problem persists, contact Chris Jones.
(ACI version 2.71.886)

Error: Out of memory: failed to allocate 32204 bytes (at PP=334)

---------------------------


I've got 750MB RAM so it's not the computer that's the problem. Somewhere there must be some kind of memory leak. Either in the engine or caused by my code.

I looked into what I was doing every loop and found these things that could maybe be a problem:
Code: ags

Hotspot *hot = Hotspot.GetAtScreenXY(x, y);
Object *obj = Object.GetAtScreenXY(x,y);
Character *ch = Character.GetAtScreenXY(x, y);
InventoryItem *inv = InventoryItem.GetAtScreenXY(x,y);


I do this in repeatedly_execute to see what the mouse cursor is currently over. I then check which of these pointers are not null and change the status field accordingly.

NOTE: I just realized that this code would be much simpler if there was a common base class that Hotspot, Object, Character and InventoryItem were derived from.


In repeatedly_execute_always I do this:

Code: ags

string buffer;
 Overhp.GetText(buffer);
 int width = GetTextWidth(buffer, Overhp.Font);
 if (width>=0 && width<320) {
	Overhp.Width = width + 1;
	gLabel.Width = width + 1;
 }


which changes the width of the statusline (Overhp) to match the text in it.

I also have a module which has a repeatedly_execute_always function:

Code: ags

#define SPEED 4
#define CONSTANT 0
#define STD_SPEED 2

struct FaderGui {
  short fading; 
  int speed;
	// fading:
	// less than CONSTANT = fade out, 
	// equal to CONSTANT = don't fade
	// larger than CONSTANT = fade in
};

FaderGui guis[AGS_MAX_GUIS];


static function GUIFader::fadeInGUI(int guiNbr,int speed) {
		guis[guiNbr].fading = 1;		
		guis[guiNbr].speed = speed;
}

static function GUIFader::fadeOutGUI(int guiNbr,int speed) {
		guis[guiNbr].fading = -1;		
		guis[guiNbr].speed = speed;		
}



function repeatedly_execute_always() {
	int nbrOfGuis = GetGameParameter(GP_NUMGUIS, 0, 0, 0);
	int count = 0;
	while (count < nbrOfGuis) {
			GUI *theGUI = gui[count];
			int trans = theGUI.Transparency;
			
			if (guis[count].fading > CONSTANT) {
				//fade in
				
				trans-=guis[count].speed;
				if (trans<=0) { 
					trans = 0;
					guis[count].fading = CONSTANT;
				}
				theGUI.Transparency=trans;
				
			} else if (guis[count].fading < CONSTANT) {
				//fade out
				trans+=guis[count].speed;
				if (trans>=100) { 
					trans = 100;
					guis[count].fading = CONSTANT;
				}
				theGUI.Transparency=trans;
			} 
			
			count++;		
	}
}



This module can fade a gui in or out without blocking. I use this for fading in the Inventory Screen when the mouse cursor is in y = 0...20 pixels.


This is what I could find in my code that could have caused this error. I hope you find the problem without to much work, CJ!!
#137
So you put boxers on him?  ;D

Go for nbr 2, it's the best.

There's something that disturbs me about the dog though. It's that his front legs are not fixed to the ground. They're gliding backwards as he barks.
#138
Nice!! I was thinking of putting something like this in my game. Using a GUI like this seems like a good idea. Might want to put in an option to turn the effect off, though (for those with low-end computers).
#139
I have a problem with my game running out of memory after playing for some time. I am using quite a few repeatedly_execute_always functions and therefore I was wondering if there is any risk of AGS running out of memory when one is constantly polling in these functions. To examplify:

Code: ags

function repeatedly_execute_always() {
      if (mouse.y < 20) gGUI.Enable();
      else gGUI.Disable();
}


This code will poll the engine 40 times per second for the y-coord of the mouse and call either Disable or Enable 40 times per second? Is this a reasonable way to program or will it suck mem?
#140
I had that problem just one time when I tested the game. I thought it had to do with me constantly turning on a GUI in repeatedly_execute_always, but I fixed that before I released the demo. And I haven't had the problem after that one time. But it's certainly disturbing to hear that there still might be a problem. I'll look into it right away!!
SMF spam blocked by CleanTalk