Author Topic: Resetting Walk Cel to 0 and other questions.  (Read 4576 times)

0 Members and 1 Guest are viewing this topic.

Offline Scavenger

Resetting Walk Cel to 0 and other questions.
« on: April 16, 2011, 08:24:29 PM »
Recently, I have developed a great interest in creating a game in the SCI engine. I love how it looks and sounds (and it has the exclusive honor of being the only game engine capable of full EGA graphics you can develop for), and I really want the engine to flourish.

Unfortunately, I'm not much of a programmer. I'm an animator by trade, and every programming language I know is C-like (mel scripting, AGS-code), so this new engine (and the scattered documentation) is rather intimidating. The art is the easiest part for me, and the programming the hardest. Could anyone kindly help me with my novice questions?

1) Resetting the Walk Loop to Cel 0 when Not Moving
Something that really bugs me about the way SCI handles walking is that it doesn't reset the loop when you stop, leaving EGO to stand around with his leg in the air. This is acceptable for roughly realistic walk cycles, but for more exaggerated, cartoony ones, it'd look odd:

I don't think having his hair suddenly stick in place would be very appealing somehow.

I imagine you'd have to put it inside a doit method, checking if EGO's view is currently a walk, and if EGO is stopped, set the cel number to 0. But do you put it inside a script of it's own? A main script? A room script? What if I want to extend this functionality to all actors?

2) A Question of Memory
How many props can reasonably be in an SCI screen before it goes belly-up? I've heard a lot of people worrying about heap space. Only thing is, I have quite detailed rooms, like so:
Click here
Would having that many props in one room crash the engine? Would baking the sprites onto the background (via judicious use of AddToPic) ease the load on the engine?

3) Persistant Parser

Say I want to have a persistant GUI in my game, that served as the Parser, a quick Inventory button, and a few bits of flair. How easy would it be to have a persistant parser (like AGI) on the screen all the time, and would it interfere with the rest of the engine's workings?


I'm really sorry for inundating you guys with my questions. I'm really enthused that there are still people working on engines like these, and I so wanted to join in on the game making front. :)



Offline MusicallyInspired

Re: Resetting Walk Cel to 0 and other questions.
« Reply #1 on: April 16, 2011, 08:40:37 PM »
Regarding Cel resetting. Sierra games approached this by making a completely different View resource altogether with a standing frame for each loop. I use this method in my KQ2SCI project. I think most of the information people helped me with on how to implement it was lost on the Mega-Tokyo forums. But I can share the code that I ended up implementing that works wonders. I don't have time to post it right now, but I'll come back with it later.

As for any other help regarding SCI programming, have you checked out the SCI Programming Wiki that Collector put together? There is extensive information on the engine, classes, etc and also tutorials written by many of us as well for how to accomplish certain tasks.

SCI Programming Wiki

Also, that's a great animation! Many of us aren't that skilled in the animation department so it's nice to have an artist/animator in the community. :)

For the memory question. Are all of those props animated? Or do they move at all? If not maybe you'd want to think about just drawing them directly into the background itself. I'm not sure if it's too much for heap space concerns or not. I've never run into a heap space error before but I don't have as many props in a room as that either. Someone else better learned in heap space management could probably better help here.

The parser question: there must be some way this could be possible but I wouldn't know where to begin. The way the tutorial game is set up is to have it pop up as you type. But it must certainly be possible to alter that somehow. Though, I would imagine it'd involve some alterations in the core scripts and classes to implement it in the way you want. The SCI engine is a very versatile engine and is capable of almost anything you can think of. It's just got to be programmed that way. Like I said, currently the tutorial game is set up in a specific way to mimic Sierra's style (which I think is based on LSL2 if I'm not mistaken?), but as long as you know what you're doing and how the code works I'm sure you can alter many things like that. Some things are unchangeable and hard-coded into the kernel, but I don't think the implementation of the parser is one of them....though, I could be wrong. KQ1SCI puts the parser window on the top of the screen as opposed to the bottom. I've been trying to figure out how to recreate this and haven't succeeded. Another thing I can't figure out is how to properly border text windows with Views on the outside instead of on the inside, like the current method employs (which is kind of a hack). So certain things might be hardcoded to operate in a specific way.

In short, I'm not sure. lol
« Last Edit: April 16, 2011, 08:50:01 PM by MusicallyInspired »
Brass Lantern Prop Competition

Offline Scavenger

Re: Resetting Walk Cel to 0 and other questions.
« Reply #2 on: April 16, 2011, 09:56:32 PM »
Wow, what a prompt response! I wasn't expecting it.

I'd love to see your code for how you got around the sticking walk frames. :) I can wait for it.

I've had a few looks through the Wiki, there's lots of stuff there I would use once the time comes. I don't think I understand all of it, but if I put my mind to it I'm sure I'll be able to muddle through.

In terms of the props, probably only one or two would animate.

And thanks for liking my animation! :) I love doing low-res stuff. It's my bread and butter to do so much with so little. Any time there's restrictions to work around, even better. It really gets the creative juices flowing.

I think I know how to make fully animated cutscenes, too, but the even timing for animations SCI uses is throwing me off. If I grab hold of the timing myself in script, I should be able to produce something really nice. I'm looking forward to working with this engine! :D

Offline gumby

Re: Resetting Walk Cel to 0 and other questions.
« Reply #3 on: April 17, 2011, 05:44:04 PM »
I'm curious, when you say 'persistent parser', are you referring to a point-and-click interface (a set of on-screen buttons)?  Or do you mean like having a text box that is always 'open' that you can type commands into?

Actually re-reading your post it looks like both.  Do you have a mock-up or screenshot of what you are thinking of?

For the inventory/buttons/flair you should check out Cloudee's point-and-click tutorial.  As for the parser-input, I'm interested in what can be done, my current project requires something similar (and would be more than happy to assist).
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Scavenger

Re: Resetting Walk Cel to 0 and other questions.
« Reply #4 on: April 17, 2011, 06:39:11 PM »
Yeah, I wanted the text parser to always be on screen. The pop up one jars a little too much for the kind of game I wanna make.

Here is a mockup

The inventory button just is a shortcut for the inv command (gives a list of items) and the flair at the side shows the protagonist. It might change expressions once in a while to give clues (don't fall off a cliff, now I am not in grave danger anymore). The layout isn't final, just something to demonstrate. I might move the inventory button to be an item that the flair at the side is holding, once you pick up a certain item.

I'll have a look at those tutorials again, see what I can glean from it :)

Offline Cloudee1

Re: Resetting Walk Cel to 0 and other questions.
« Reply #5 on: April 17, 2011, 07:11:23 PM »
Ok, here is how I handle the null motion situation (ego standing still).
I'm sure there are better ways to do it, but here goes...

In the main script, I have 3 variables, one remembers the ego's current view, one remembers the ego's corresponding stop view, and the third I use to determine which character version (outfit) is supposed to be used.

Code: [Select]
    gEgoView // ego's current view number
    gEgoStoppedView
    gEgoMode = 0

Also, in the main script, at the beginning of the doit method, I have added in the command that actually swaps out the images.

Code: [Select]
  (if(send gEgo:isStopped)          // changes ego to standing still view
     (send gEgo:view(gEgoStoppedView) loop(send gEgo:loop) cel(0))
  )
  (else
     (send gEgo:view(gEgoView))// changes ego back to walking view
    )

and lastly, just to make sure that the mainscript is dealing with the right sets of variables, I have included this little snippet in each of the roomscritsinit methods, just to make sure everything is set up at the room entrance. This may not be necesary, but it I'm used to it, so I expect to see it. soo...

Code: [Select]
 
(switch(gEgoMode)   // used to verify what ego loops should be used
    (case 0   = gEgoView 0  = gEgoStoppedView 100)
    (case 1   = gEgoView 1  = gEgoStoppedView 101)
    (default  = gEgoView 0  = gEgoStoppedView 100)
  ) // end switch

and unless I am mistaken, that should get you a stopped version of your ego that replaces the walking view of the ego whenever they stop walking. I went with the seperate view like Brandon mentioned for a couple of reasons, I had intentions of adding in a standing still too long animation that would play, but never got around to that. and also because theoretically cel 0 isn't any better than cel 5 as far as picking it to stop on as it is a part of the walking animation too.

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

As far as your memory concerns go, it's more what you do with it than how many are there. looking at your sceen shot, most of those items will be mostly static and the ones that do have animation won't necesarily have a lot of scriptwork behind them. Let's just hold off for now and take the heap trouble questions when you actually have some, knock on wood you won't.

and welcome!
« Last Edit: April 17, 2011, 07:20:11 PM by Cloudee1 »
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: Resetting Walk Cel to 0 and other questions.
« Reply #6 on: April 17, 2011, 10:02:51 PM »
I love the mockup ;D
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: Resetting Walk Cel to 0 and other questions.
« Reply #7 on: April 18, 2011, 04:51:44 AM »
More reminiscent of the LA interface than Sierra's.
KQII Remake Pic

Offline gumby

Re: Resetting Walk Cel to 0 and other questions.
« Reply #8 on: May 08, 2011, 03:34:03 PM »
Working on an implementation of the 'persistent parser' piece of the UI.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Cloudee1

Re: Resetting Walk Cel to 0 and other questions.
« Reply #9 on: May 08, 2011, 06:25:50 PM »
It seems to me that display would be your friend
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: Resetting Walk Cel to 0 and other questions.
« Reply #10 on: May 08, 2011, 10:41:11 PM »
Yeah.  I've found out that updating the entire display (using the save/restore pixels technique documented in the thread here: http://sciprogramming.com/community/index.php/topic,229.0.html) every time a key is pressed (instead of just displaying a new character) creates a nasty flicker effect.  It'll need reworking but... got backspace & enter keys working.  Parser is hooked in.  For my needs, I can't use print statements though, just more display calls.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Cloudee1

Re: Resetting Walk Cel to 0 and other questions.
« Reply #11 on: May 09, 2011, 02:18:26 AM »
If you are displaying to a constant colored backgrond, might I suggest using the background and width arguments to just display over the old displays rather than restoring... if your displaying to a solid colored area, that should take care of your flicker. out of curiosity, if you hit alt m, whats your heap at?
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: Resetting Walk Cel to 0 and other questions.
« Reply #12 on: May 09, 2011, 08:06:51 AM »
So you mean don't re-apply the underlying saved pixels and applying the new?  I see.  Instead of using the transparent background, simply use black.  But this will only work with a single-color background, no multi-color - which works fine for me at this point.

Not sure about heap - will check that later.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Cloudee1

Re: Resetting Walk Cel to 0 and other questions.
« Reply #13 on: May 09, 2011, 11:09:58 AM »
Just for readability, I would think you need the solid bground. How has graph been working out for you, I seem to have more trouble than less. Can't seem to draw a line with it.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: Resetting Walk Cel to 0 and other questions.
« Reply #14 on: May 09, 2011, 12:34:52 PM »
Haven't gotten to use graph yet.  Actually, I'm implementing the 'persistent parser' at this point as a full screen UI for text-only games.  So instead of using print() & the standard text-input box - all input/output is 'stacked' on-screen (top-down).

So I gotta figure out what to do when the text contents no longer will fit on the screen & lop off the top lines.  Thinking about forced \n chars & counting them to determine how many lines I have.  Don't think I'll be implementing vertical scrolling though.

Anyway, anything I come up with should work (with minor modifications) for how the problem was originally posed.  Probably by just adjusting the number of lines supported (one) & change the top/left coords of the display to near the bottom of the screen.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition


SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.098 seconds with 23 queries.