Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Animation At Regular Intervals-Characters and Scrolling Map
Index -> Programming, Turing -> Turing Help
Goto page 1, 2, 3, 4  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
GreenTiger




PostPosted: Tue Apr 27, 2004 11:36 am   Post subject: 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?
Sponsor
Sponsor
Sponsor
sponsor
fatboy316




PostPosted: Tue Apr 27, 2004 12:25 pm   Post subject: (No subject)

have u tried setscreen("offscreenonly")
Tony




PostPosted: Tue Apr 27, 2004 12:34 pm   Post subject: (No subject)

here's the problem - a timer would not get rid of the flicker, it would just stretch out the time of it... Confused

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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
GreenTiger




PostPosted: Tue Apr 27, 2004 3:51 pm   Post subject: (No subject)

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?



iso.zip
 Description:

Download
 Filename:  iso.zip
 Filesize:  38.63 KB
 Downloaded:  212 Time(s)

Tony




PostPosted: Tue Apr 27, 2004 4:04 pm   Post subject: (No subject)

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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Delta




PostPosted: Tue Apr 27, 2004 4:31 pm   Post subject: (No subject)

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




PostPosted: Tue Apr 27, 2004 4:41 pm   Post subject: (No subject)

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




PostPosted: Tue Apr 27, 2004 4:49 pm   Post subject: (No subject)

Are you by any chance using processes?
Sponsor
Sponsor
Sponsor
sponsor
Delta




PostPosted: Tue Apr 27, 2004 4:55 pm   Post subject: (No subject)

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




PostPosted: Tue Apr 27, 2004 4:56 pm   Post subject: (No subject)

the issue here is lack of double buffering in turiing below v4.x Rolling Eyes why would you teacher not let you use the newer version of the compiler though?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
GreenTiger




PostPosted: Tue Apr 27, 2004 4:59 pm   Post subject: (No subject)

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




PostPosted: Tue Apr 27, 2004 5:02 pm   Post subject: (No subject)

you teacher is an idiot, you shouldn't be using processes at all Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Raugrist




PostPosted: Tue Apr 27, 2004 5:04 pm   Post subject: (No subject)

GreenTiger wrote:
...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




PostPosted: Tue Apr 27, 2004 5:07 pm   Post subject: (No subject)

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 Smile ... just don't put too many graphic processes all at once.
Tony




PostPosted: Tue Apr 27, 2004 5:09 pm   Post subject: (No subject)

shut up delta, you don't know what you're talking about Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 4  [ 48 Posts ]
Goto page 1, 2, 3, 4  Next
Jump to:   


Style:  
Search: