Game crashes if player has diagonal loops

Started by , Sun 23/10/2005 03:15:23

Previous topic - Next topic

BlankMan

My player character seems to walk around fine if only loops 0-3 (down, up, right, left) are active.  If I add in the diagonal loops, however, the game won't start (i.e. the screen goes black, the program does not respond to the abort key, and I have to use CTRL-ALT-DEL to kill it).  Then (once I kill it) AGS gives me an error message saying that if this sort of thing continues, I should post a message in the technical forum. So here I am.

It doesn't matter if the "diagnonal loops" box in the character pane is clicked off or not.  Also, I am filling in each of the four diagonal loops with just as many sprites as the other views.

I did check the manual and search the forum for solutions to this problem.  So be kind if this has already been covered somewhere.

RickJ

Quote
... the game won't start (i.e. the screen goes black, the program does not respond to the abort key ...
When the game starts and feore the first screen is painted,  the functions game_start() in the global script and the "room_?() // BEFORED FADE IN INTERACTION"  in the first room's script are executed.   Take a look ay the code in these functions; truy commenting out stuff to see if it makes a difference.   

Also you could try starting over with a blank game to see if you can get the diagonal loops working.  Perhaps you will be able to discover what happened to this one and repair it or find some more info about the problem to post here. 

Perhaps some else has had a similar problem and can be more helpful. Good luck and let us know how it turns out.

BlankMan

I probably should've mentioned in my original post that importing the character into a blank game didn't help -- it crashes the blank game too.  There's no script under the game_start function in the global script.  Also the room script is empty.

One thing that I've noticed is that if I delete all of the frames from the diagonal loops except for the first frame (the standing frame), the game will run. When the character turns and those diagonal frames are displayed, the diagonal standing sprites are displayed as much smaller than the others. So then I thought that I had made a mistake and imported the images at different resolutions and the diagonal sprites were much smaller than the horizontal and vertical ones. But when I exported the sprites to take a look at how big or small they were, they were approx. the same size.

Any thoughts anyone?

Thanks, RickJ, for answering my post so quickly.


RickJ

Are yoou importing a .cha file then ?   Maybe there is a problem with the file.  What happens if you re-create the characters view?

BlankMan

I built the character from scratch and then tried importing him into a blank game (for diagnostic purposes).  The problem was there before I imported him.

I may as well try rebuilding him in a blank game, though.

By the way, the compiled game is weighing in at 125 MB. I find this very strange, since  right now it only consists of 1 room, 1 character, no objects, no animations, no script.

No chance this is some glitch in 2.7 is there?

thanks for your help.


RickJ

QuoteBy the way, the compiled game is weighing in at 125 MB ...
It should be more like 1.25 MB even at high res and color. 

How big are your sprites and  have you set the game's resolution and color depth accordingly?

BlankMan

The game is working now.  I started from scratch and did a number of things differently, so I'm not sure what fixed the problem. I re-installed AGS 2.7 (probably overkill). I un-clicked the "import for 640x400" box (my game is 640x480, 32-bit color), and I cropped the sprites symmetrically this time. Cropping the sprites got the size of the game down to 3.5 MB. 

The character has always been huge, whether I import the sprites with or without the "import for 640x400" box checked. I don't understand why this is. He fits pretty well (takes up approx. 2/3rds the height) in the 640x480 images I'm importing him from, but once he's in the game, only half of his body fits on the screen. I've been using the room scaling feature, which is fine, but I'm wondering if I'm going to run into problems because my character is so huge at 100% scaling.

Anyway, thanks for your help.

RickJ

Quote
The character has always been huge, whether I import the sprites with or without the "import for 640x400" box checked. I don't understand why this is.
I have found that the "import for 640x400" box needs to be checked before the file is selected.  Otherwise it has no effect.  But yeah, you will want to solve this before you get very far into your game.

Pumaman

Quote from: BlankMan on Sun 23/10/2005 17:31:19
He fits pretty well (takes up approx. 2/3rds the height) in the 640x480 images I'm importing him from, but once he's in the game, only half of his body fits on the screen.

Bear in mind that your game resolution is 640x480, so do you really want a character that is 2/3 the height of the screen? You need to make sure, when drawing characters, to make sure that you draw them at a suitable size (something like 30x70 would be an example), not full-screen-sized.

Also, if you don't check the "IMport for 640x400" box before importing, the images will be double the size that they should be.

Gilbert

Actually I'm a bit curious, if it's a good idea to add an option to the right-click menu of the sprite manager, where you can toggle the "hi-res" property of that sprite after it's been imported.

BlankMan

I hope I'm not being VERY dense about this. But I still have a few questions.

1. The "Import for 640x400" box comes checked as a default (at least for me it did). So do I have to uncheck it and recheck it to get it to work? It seemed to have no effect on the size of my character.  He was huge (approx. 2x the screen height, not 2/3rds) when I imported him with the box checked and he was huge after I unchecked it.  So what exactly do I have to do to that box?
2. My thinking when I imported the character at 2/3 the screen height was that I might want him to appear this large at some point in the game -- along the lines of the hallway scene toward the end of space quest 3.  I thought that importing him at his largest would be better than scaling him up -- since I would lose detail if I scaled him up. A 70x30 pixel character seems pretty small for 640x480 game. Please tell me why this is all wrong.

Thanks, guys.

Gilbert

Just make sure the option is checked when the sprite is being imported, you can't change anything after it's been imported into the game, unless you re-import it.

RickJ

Quote
2. My thinking when I imported the character at 2/3 the screen height was that I might want him to appear this large at some point in the game -- along the lines of the hallway scene toward the end of space quest 3.  I thought that importing him at his largest would be better than scaling him up -- since I would lose detail if I scaled him up. A 70x30 pixel character seems pretty small for 640x480 game. Please tell me why this is all wrong.
There is no right answer as this pretty much depends on personal preference.  I am of the same mind as you are about this.  My reasoning is as follows:

  • Characters scale down much better than they scale up.   

  • A room inside a house or building represents the typical "closeup" or max scaling situation.

  • Such rooms are typically 8-12ft tall. 

  • So if you had (400 pixels / 10ft) the scaling would be 40 px/ft. 

  • A character that is 6ft tall would be drawn 240px tall. 

  • Characters are scaled down appropiately in larger rooms. 

    In your case it sounds like your scaling is more like 50px/ft.  A 6ft character would be drawn 300px tall in this case which is closer to 2/3 of the screen height than my example.

    It's for certain there other opinions about this as numerous as there are game designers.  This is just my take on the subject.  Hope it is helpful.

SMF spam blocked by CleanTalk