Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > [Req for help] TigerMoth performance
2017-08-02 07:56
pmprog
Account closed

Registered: Nov 2005
Posts: 54
[Req for help] TigerMoth performance

Hi all,

I'm getting to a point in TigerMoth that I'm thinking of dropping it. If you watch the video below, you can see when I start hitting a large number of bullets I get really bad performance.

https://www.youtube.com/watch?v=Lskbol7quDk

It's kind of expected, but this version doesn't even have the raster splits for dealing with the score or player, no collision detection for the TigerMoth or the player, nor any music, so performance is only going to get a lot, lot worse. I really like what I've managed to put together so far, but if it's not going to be playable, then I might as well drop it now.

So I thought I'd pop on here and see if anyone was willing to have a quick look and see if there were any points that look really bad. My code is broken down in to lots of subroutines (this might be a problem regarding performance?) with headers that hopefully explain what it's job is, and I've tried to keep all the related pieces together in aptly named files so it's easy to mooch about.

I've been working in a private git on my local server, but I've uploaded a snapshot of the current code to GitHub. The source code is MIT license, and if the project is finished, the full source will be released with the game.

https://github.com/pmprog/TigerMothC64

Also, for reference, the .spriteproject file can be opened in C64 Studio. Export to data, but change the "!byte" to ".byte"
C64 Studio 4.1

I currently use TASM as my compiler, though I was thinking of trying to move across to the ca65 assembler in the cc65 package. But that doesn't really have any baring on the life of this project.

Oh, and finally, before anyone says, yes, I've got my Sine/Cosine tables all messed up (Sine starts at the positive value, Cosine starts at zero and goes negative before positive), but I'm "okay" with that, I just count my angles anti-clockwise from the "3 o'clock" when dealing with bullets

Thanks in advance
 
... 29 posts hidden. Click here to view all posts....
 
2017-08-06 13:29
Style

Registered: Jun 2004
Posts: 498
Im wondering if, based on the moth movement and the bullet frequency, you couldnt generate a sprite with multiple bullets in it that hold the same pattern down the screen together..... if that makes sense.
2017-08-07 11:22
pmprog
Account closed

Registered: Nov 2005
Posts: 54
Things have gone a little wrong


Quoting Martin Piper
Nice idea for a bullet hell game :)

Thanks, but what really inspired me was Dragon Attack on the Amstrad

Quoting Style
Im wondering if, based on the moth movement and the bullet frequency, you couldnt generate a sprite with multiple bullets in it that hold the same pattern down the screen together..... if that makes sense.

Possibly, but the sprites are (will be) all already in use multiple times once I've got all the multiplexing in
2017-08-07 19:48
pmprog
Account closed

Registered: Nov 2005
Posts: 54
https://youtu.be/6n2zQIuYe1Y

So many bugs!!

Not quite sure why some lines move slower than others, and if I add the code that removes the bullet before redrawing, it'll only ever draw right down the centre of the screen!
2017-08-10 19:06
rexbeng

Registered: Aug 2012
Posts: 37
Quoting ChristopherJam
[...] the Amstrad version looks like it's only doing around 80 enemy bullets [...]


80 bullets? You should try a bit harder and get to the further levels :)
2017-08-14 20:43
pmprog
Account closed

Registered: Nov 2005
Posts: 54
I'm kind of getting angles now, but my maths code is still pretty poor. These videos are supposed to show an exploding circle.

https://youtu.be/hp8XVp5yeLc

The code before this looks pretty nice, it made a "star" explosion... still all wrong though.

I really can't wrap my head around why it's doing this, partly because I'm tired. Feel so close to just ditching this project and working on a simpler one... one that preferably doesn't need 8bit trigometry...
2017-08-15 04:42
JackAsser

Registered: Jun 2002
Posts: 2014
That my friend is you not having proper 2 complements math. First of all, is your sinus table signed at all?!
2017-08-17 19:04
pmprog
Account closed

Registered: Nov 2005
Posts: 54
Yeah, my tables are signed. I've clearly got something wrong though
2017-08-18 03:51
ChristopherJam

Registered: Aug 2004
Posts: 1409
It looks like you've just toggled the high bit from the absolute value to get your negative numbers, rather than flipping all the bits and adding one (or alternately just subtracting from 256).

-5 isn't %10000101 ($85), it's %11111011 ($fb)
2017-08-19 20:27
pmprog
Account closed

Registered: Nov 2005
Posts: 54
I think you're right, but at the same time, I wrote a subtract_fraction routine, so it shouldn't be a problem, as it'll be subtracting the fraction amount, rather than adding the negative version.

I think I might start a new project that is just my math code and see if I can fix all the problems there, then bring it back into my game project. Should help speed up debugging
2017-08-20 19:09
pmprog
Account closed

Registered: Nov 2005
Posts: 54
I bizarrely have 3 angles which don't work properly, and there seems to be a couple of gaps, but otherwise, I think it's looking much better

https://youtu.be/dOPoIq3K8c8
Previous - 1 | 2 | 3 | 4 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Chesser/Blazon
Fred/Channel 4
Nordischsound/Hokuto..
Scrap/Genesis Project
Dr. Doom/RAD
DuncanTwain
Guests online: 138
Top Demos
1 The Lethal Christmas..  (9.7)
2 Next Level  (9.7)
3 13:37  (9.7)
4 Mojo  (9.7)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 The Demo Coder  (9.6)
9 Uncensored  (9.6)
10 Comaland 100%  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Sulevi  (9.6)
3 The Sarge  (9.6)
4 Veto  (9.6)
5 Facet  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.041 sec.