
-----------------------------------
GreenTiger
Tue Apr 27, 2004 11:36 am

Animation At Regular Intervals-Characters and Scrolling Map
-----------------------------------
Alright, guys, I could use some help here.  Anyone who responds gets their name (or email or whatever they want) in the "credits" section of my game.

I'm making a Final Project for CompSci in Turing 3.11.  It's an isometric action RPG, and I need some help with animation stuffs.

Here's some quick info on my project, I'll upload links to my actual source code (so far) when I'm done.  I plan to donate the final project source to the site to be used as a tutorial in a number of things.

Okaydokie - So first off, the map data is imported from a file into a large array.  The map is then displayed based on the "camera" position; which will follow the player as he reaches the edges of the screen.  The characters are actually broken up into limbs; with anywhere from 5-36 'position' sprites for each limb (head, torso, left arm, right arm, left leg, right leg and 'tail') Which should be able to animate seperately from the others.  Finally, magic attacks and weapons (positioned based on the user's positioning) should also animate.

Okay here's the story, I want to get rid of that evil flicker.  I'm guessing it happens because of irregular intervals between redraws, so I thought I should create a stopwatch that would count millseconds and would redraw everytime a certain number of milliseconds went by.

Am I going in the wrong direction with this and everything?  How should I do this?

-----------------------------------
fatboy316
Tue Apr 27, 2004 12:25 pm


-----------------------------------
have u tried setscreen("offscreenonly")

-----------------------------------
Tony
Tue Apr 27, 2004 12:34 pm


-----------------------------------
here's the problem - a timer would not get rid of the flicker, it would just stretch out the time of it... :?

basically the ficker occurs cuz turing draws parts of the screen too slow and when you start drawing the new screen, you still see parts of the old before all of the new graphics appear, and that causes flicker (its really bad if you clear the screen compleatly at first)

Using View.Set("offscreenonly") solves the problem, but it is a v4.x feature. You'd need to update your compiler

-----------------------------------
GreenTiger
Tue Apr 27, 2004 3:51 pm


-----------------------------------
hmm...that could be a problem there...you see, not only do we not have anything above 3.11, but our teacher doesn't want us to use it. (Damn him)

So in Turing 3.11, it is not possible to draw off the screen at all?  Because if it was, I had another idea to fix the problem...basically goes like this;

while it's loading, it creates a single 'floor' of the map at a time, then takes a picture.  With the picture of each floor stored, it simply stacks them on top of one another, then moves them in the x and y position as the player proceeds across.

However, all collision detection would still need the original data in the array, wouldn't it?

Would that work?

-----------------------------------
Tony
Tue Apr 27, 2004 4:04 pm


-----------------------------------
eh, I'm not sure what you're saying...

but if you absolutly "must", you've got to try to draw as little as you can and as fast as you can at each frame to reduce flicker. Such as if it's the map we're talking about, just draw two little squares at a time. Character in new position and position where character was before to clear that.

-----------------------------------
Delta
Tue Apr 27, 2004 4:31 pm


-----------------------------------
Please explain what your trying to do once more...but very clearly.... 
why are you redrawing the landscape over and over again? I see no reason to do this.... maybe your just taking this idea the wrong way.... but ya.. explain more clearly please

-----------------------------------
GreenTiger
Tue Apr 27, 2004 4:41 pm


-----------------------------------
I intend to have maps bigger than the screen;
as the character moves across the map, the map will have to move underneath the character (scroll) so that the character can move with it.  That'll all be done for when the character has been actually pluged into this section (still working on the 'persons' class) but also, the landscape should block the character if he moves behind a hill.  To make sure the character's image doesn't appear behind him, shouldn't the map be redrawn over and over again?  Or is there some tricky way to do this that my teacher hasn't taught yet?

-----------------------------------
Raugrist
Tue Apr 27, 2004 4:49 pm


-----------------------------------
Are you by any chance using processes?

-----------------------------------
Delta
Tue Apr 27, 2004 4:55 pm


-----------------------------------
Ok I have very bad news for you.... that'll never work! well ok it would... but way way too slow especially for only being able to use winOOT. But ya... if you still wanna go with that Idea I suggest shrinking the screen size to like 300 by 200 or something small... and no do not constantly draw the ground... only redraw the ground if the character moves... and only move the ground in the direction of the character... if you are not using sprites I suggest using them too... that way your problem is almost fixed... sprites don't have to be erased.... they can be put on seperate layers also... which is a very good thing... if the player is block from view... well then you should make the ground shorter... or the player taller... don't let him get completely out of view if you can help it... then your set... if I missed something I'm sorry

-----------------------------------
Tony
Tue Apr 27, 2004 4:56 pm


-----------------------------------
the issue here is lack of double buffering in turiing below v4.x :roll: why would you teacher not let you use the newer version of the compiler though?

-----------------------------------
GreenTiger
Tue Apr 27, 2004 4:59 pm


-----------------------------------
I know how to...but I'm not using them just yet.  I'm going to use them for my music/sound effects...maybe the control interface...I don't want to use too many processes if I can help it...my teacher said that if you fork to too many processes, your program could get all forked up.

-----------------------------------
Tony
Tue Apr 27, 2004 5:02 pm


-----------------------------------
you teacher is an idiot, you shouldn't be using processes at all :lol:

-----------------------------------
Raugrist
Tue Apr 27, 2004 5:04 pm


-----------------------------------
...my teacher said that if you fork to too many processes, your program could get all forked up.
Hahaha, that's almost as funny ass the recursion knock knock joke. Anyways, yeah your teacher is right. Processes can really mess you up if you don't use them right (if your drawing in them), but there was some drawcheck procedure that can help you with that if you have to use processes.

I just thought of something. Are you drawing the ENTIRE map each frame? Because if you are, then each tile that is offscreen is still being drawn and will slow things down considerably.

-----------------------------------
Delta
Tue Apr 27, 2004 5:07 pm


-----------------------------------
I suggest using processes... just not too many... Tony is just all wrapped up in Turing.... he isn't thinking too clearly thru the eyes of OOT.... If you can help it sure stay away from them... but they are fun and nice :) ... just don't put too many graphic processes all at once.

-----------------------------------
Tony
Tue Apr 27, 2004 5:09 pm


-----------------------------------
shut up delta, you don't know what you're talking about :lol:

-----------------------------------
Delta
Tue Apr 27, 2004 5:14 pm


-----------------------------------
shut up eh? oh thats it... I'm gonna talk to you on
msn because your just becoming a nucense! ;)

-----------------------------------
GreenTiger
Tue Apr 27, 2004 5:21 pm


-----------------------------------
Now, now.  No flaming.  (Never thought I'd have to say that to another Mod)

Anyways, no, I'm not using any graphical processes...and yes, I would be drawing the tiles offscreen as well...but I havn't made my maps that big yet...and it still flickers too much for my liking.

I guess if my teacher forces me to use 3.11, tho, maybe that's the best I can do...

Maybe I could use that arguement to coerce him into helping me... :twisted:

Alright, I could still use some help...is there any way to get music to loop *perfectly* ? I got my delay between each song down to like a half a second or so...but... that's still some dead time.

-----------------------------------
Dan
Tue Apr 27, 2004 5:27 pm


-----------------------------------
i have not been flowing this topic long but have to checked to see if ur musick files have any dead time at the being or end? b/c that whould do it.

-----------------------------------
Delta
Tue Apr 27, 2004 5:31 pm


-----------------------------------
who cares about a lil dead spot... it doesn't matter... just think if you did what I told you to do in the longer post I wrote ... then you wouldn't have these problems as much... but whatever... don't listen to me I don't know anything ;)

-----------------------------------
GreenTiger
Tue Apr 27, 2004 5:31 pm


-----------------------------------
That was THE first thing I checked...(actually, maybe the second)...but yeah, I made sure there was like no dead time...it happens for both wave and midi files.

-----------------------------------
Delta
Tue Apr 27, 2004 5:35 pm


-----------------------------------
I dunno about you guys... but ya... I don't have any music :S

-----------------------------------
GreenTiger
Tue Apr 27, 2004 5:37 pm


-----------------------------------
lol, Didn't mean that.  Trust me when I say I'm taking EVERY single one of your ideas into consideration.

Thing is, this was like in a seperate program I was using to test the looping of music...so like nothing else was running...

but I guess you're right, for a school project (even if it is a final) some dead time shouldn't matter much.

I'm the only one using isometric views anyway...that should be enough

-----------------------------------
Tony
Tue Apr 27, 2004 6:27 pm


-----------------------------------
what if you wrote it in v3.1 for your teacher to read the code but then add in double buffering(litteray 2 lines of code) and compile that in v4.x for the demonstration purposes just to get rid of flicker? :think:

-----------------------------------
GreenTiger
Wed Apr 28, 2004 7:47 am


-----------------------------------
Perfect.  