Welcome, Guest. Please login or register.

Author Topic: Help. sprites are making me mad.  (Read 5630 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show all replies
    • http://totalchaoseng.dbv.pl/news.php
Re: Help. sprites are making me mad.
« on: March 17, 2012, 03:55:32 AM »
Quote from: bbond007;684091
Some searching led me to the fact that it is a hardware limitation caused by my overscan settings being set to max.
Rule #1: Never use any overscan at all, and definitely not max.
Overscan dramatically slows down the Amiga.  And it eats sprites.
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show all replies
    • http://totalchaoseng.dbv.pl/news.php
Re: Help. sprites are making me mad.
« Reply #1 on: March 17, 2012, 04:06:49 AM »
Quote from: bbond007;684091
Is there a way to pin these sprites to a screen or get notification that a screen is being dragged so I can make the toolbar(the sprites) move in sync with the screen? I'm coming up blank

Don't come up blank.  Come up vertical blank. :D

Here is how u do it:
1. Determine the entry in your struct screen (or whatever) that stores the current offset of your screen.  By "offset" I do not mean memory location I mean how much Y the screen has been dragged.   I am too lazy 2 look it up 4 u :)

2. Set up a Vertical Blank Interrupt.

3. Your vblank interrupt server will automagically run 50 times a second and check if your screen has been dragged.  If so then it will call MoveSprite() appropriately.

4. Profit. :D


Later on u can use this same vblank routine to animate your sprites if u wish.
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show all replies
    • http://totalchaoseng.dbv.pl/news.php
Re: Help. sprites are making me mad.
« Reply #2 on: March 17, 2012, 04:24:01 AM »
Quote from: bbond007;684099
its no so much that the application is using overscan, just I have overscan prefs set to 728x283 because that is how I run workbench.
I understand that. :)  And I am saying that on a real Amiga you should never do that as it dramatically slows down your Amiga, eats sprites, causes jerky animations in other programs, etc.

Of course on an Unreal Amiga such as WinUAE, Natami, Minimig, etc. it might not (should not) cause any problems.
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show all replies
    • http://totalchaoseng.dbv.pl/news.php
Re: Help. sprites are making me mad.
« Reply #3 on: March 17, 2012, 04:25:55 AM »
Just to be clear.  Setting Overscan prefs on Workbench affects the whole system.  All OS-Compliant programs get affected in some way.
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show all replies
    • http://totalchaoseng.dbv.pl/news.php
Re: Help. sprites are making me mad.
« Reply #4 on: March 17, 2012, 04:55:38 AM »
Before u start loading up ur vblank with a million features, just take care that any OS functions that you call in your interrupt are "interrupt compatible".  I suspect that moving the screen cannot be called from an interrupt.  Once again, I am 2 lazy 2 look it up :)

vblanks are really great for sprites.  Sprites were designed to be manipulated during the vertical blank interrupt.

But if u r going to go Rambo and start doing a lot of other stuff then u may have to simply create a subtask (or process) that does WaitTOF() and do it that way.
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show all replies
    • http://totalchaoseng.dbv.pl/news.php
Re: Help. sprites are making me mad.
« Reply #5 on: March 17, 2012, 05:49:40 AM »
You could just disable screen dragging.  That would be a much easier solution than doing all that other stuff :)
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show all replies
    • http://totalchaoseng.dbv.pl/news.php
Re: Help. sprites are making me mad.
« Reply #6 on: March 17, 2012, 06:47:36 PM »
Does ur compiler give u any warnings about uninitialized variables?

What compiler are u using?

I have never used AddTOF()   I never knew it existed!  Or I went lame and forgot :D

I use AddIntServer() and things work for me.  I do my animated overlay sprite, music playback routine and some other stuff with it.
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show all replies
    • http://totalchaoseng.dbv.pl/news.php
Re: Help. sprites are making me mad.
« Reply #7 on: March 18, 2012, 06:52:45 PM »
I was going to mention __interrupt as soon as u said SASC but when I searched my 100,000s of lines of source code I could not find it anywhere. (?)  So I got puzzled and forgot about it.... **scratching head**

Quote
as an interesting note, i see that i don't have to worry about  screen->TopEdge it seems, MoveSprite always positions the sprites  relative to the screen. so just calling it is enough to get the desired  effect.
hehehe kewl trick.  I might possibly use that one myself.
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show all replies
    • http://totalchaoseng.dbv.pl/news.php
Re: Help. sprites are making me mad.
« Reply #8 on: March 18, 2012, 09:11:58 PM »
I found out why I have no __interrupt in my sources.

Because Real Men(tm) code their interrupts in asm! :D
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA