Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Roboman on November 20, 2012, 09:32:30 pm

Title: [AXE] Bullet Hell
Post by: Roboman on November 20, 2012, 09:32:30 pm
My own project thread as my second post 8)
A bullet hell is basically filling the screen with bullets and you want to avoid dying to them.
I have been working on this for ~ 1 week before I joined Omnimaga.
Here is the game in its current state running with a run through the source code(it is open source for the moment, mabie even through finishing the project)
(http://i.imgur.com/Td7YX.gif)
I would include source code, but I have yet to reach 40 posts.
It will likely consist of a boss battle, a trip to the upgrade menu, and rinse and repeat until you die or run out of bosses to fight. 
One problem though,  I need boss routines.
The one shown in the image is the most difficult pattern of bullet spawning i have yet to discover, but difficulty is not the only goal.  They need to be sweet patterns(much like those found in the link).  I really am drawing a blank as to how to do this, so any help would be nice!

*Edit* I am using AXE 0.2.2. Is this outdated?
If you can create a boss Subroutine that gets called once a frame, that boss will be named after you :D
                                                                                           You can name that Boss


Ok... here is some documentation.
Spoiler For Spoiler:
D = # of bullets
Sprite 1 = bullet
sprite 2 = ship
h = hp*256(it is inflated for accuracy)
a = ship's x position(not inflated)
b = ships y position(also not inflated)
every bullet uses 6 bytes(2 for x pos, 2 for y pos, 1 for x speed, 1 for y speed)
f points to the start of the current bullet
{f}r =x pos
{f+2}r=y pos
{f+4}=x speed
{f+5}=y speed

will do some inline documentation with comments but for now this is what i got
Title: Re: [AXE] Bullet Hell
Post by: Geekboy1011 on November 20, 2012, 09:35:14 pm
This may sound daunting but i will suggest possibly making a miniature scripting system for coding your bullet patterns will save space in the long run.

As for help do you mind putting up documentation on how your engine handles bullets and stuff easiest way for others to help is to learn from what you have :D
Title: Re: [AXE] Bullet Hell
Post by: Roboman on November 20, 2012, 09:39:33 pm
Ok, will do the documentation.  And I am going for filling the screen with bullets much like in bullet audyssey.
*Edit* miniature scripting system?
Title: Re: [AXE] Bullet Hell
Post by: Darl181 on November 21, 2012, 12:23:00 am
Looks pretty good!
And yes Axe 0.2.2 is outdated, it's up to 1.1.2 now (http://ourl.ca/1463/228625). ;)

As for the scripting system, I'm guessing he means having the patterns stored somehow and a routine runs through the stored data and uses that to tell where to create the bullets. This sort of thing could get complicated pretty fast, tho, so feel free to ask for help :)
Title: Re: [AXE] Bullet Hell
Post by: aeTIos on November 21, 2012, 05:57:53 am
yeah axe 0.2.2 is.. kinda... outdated... :O
This sounds cool by the way :D I hope you can finish it.
Title: Re: [AXE] Bullet Hell
Post by: Roboman on November 21, 2012, 09:34:54 am
And yes Axe 0.2.2 is outdated, it's up to 1.1.2 now (http://ourl.ca/1463/228625). ;)
oh... snap...
I downloaded the wrong one.
Now i have to learn so much new and changed syntax, its almost like a transition from C++ to java.
 :banghead:
Title: Re: [AXE] Bullet Hell
Post by: aeTIos on November 21, 2012, 09:58:16 am
Well that's a bit too quick, the base syntax was left the same ;)
But yeah the transition from the last beta to 1.1.x was quite a shock to me too
Title: Re: [AXE] Bullet Hell
Post by: Roboman on November 22, 2012, 12:01:03 pm
I guess you are right.  I updated Axe on my calculator, and printed out the v1.1.2 Command List.
I tried to compile my source without modifying it at all and it works! :D.
I was just jumping to conclusions ;).

I am going to work on getting inline documentation today(even though it is thanksgiving, I feel like doing it XD), and I want to know...  Is there any way to upload my code before 40 posts?
(aka putting a link to mediafire)
Spoiler For Spoiler:
Quote from:  the Omnimaga download section
you can link to the file info page on www.ticalc.org, www.cemetech.net or www.tiplanet.org if it is also available there, but no other sites are allowed right now
Oh... nevermind.
Or is doing anything like that against the rules?  I don't remember reading any rule like that and I don't want to dig through the rules list again x.x.
Title: Re: [AXE] Bullet Hell
Post by: lkj on November 22, 2012, 01:21:46 pm
The rule about other upload sites is only for the download section, in normal posts you can link to any upload site.
Title: Re: [AXE] Bullet Hell
Post by: Roboman on November 22, 2012, 03:36:47 pm
The rule about other upload sites is only for the download section, in normal posts you can link to any upload site.
:O That is fantastic!
Well then, here it is:  The source code with inline documentation as I promised.
http://www.mediafire.com/?cp2wmfgei3m3q8i
Title: Re: [AXE] Bullet Hell
Post by: Roboman on November 27, 2012, 09:21:15 am
I am still here! :o  Do not worry. ;D
I was having a terrible time squashing a bug that would crash it on the first frame...  I have since worked that out, but I was forced to look deep into my code again... and optimizations happened :D.
I think I know a way to add some level of skill to the game without taxing the hardware very much... Energy.
The health bar at the bottom is now Energy.  You lose Energy when you 1:Get hit by a bullet.  2:Shoot(not implemented yet).  3:Use time slow(shown in screenshots when screen inverts).
What do you think of this?
The speed significantly increased, and I decided to throw that away for a fantastical graphical effect I stumbled on! :w00t:
Why do I say "throw that away"?  The effect is impossible without drawing two sprites for every bullet.  :-\
I was also working on the 'Boss API' (a different subroutine for every boss, executed once per frame(if you wanted too you could make a boss routine that isn't a boss at all... it could handle multiple enemies instead  :crazy:)) and the boss you see in the screenie is an example boss I am not done coding yet(it only lacks health/ healthBar).
Here is screenie of before the fantastical graphical effect:
(http://i.imgur.com/WMDiT.gif?1)

And here is a screenie of after the fantastical graphical effect:
(http://i.imgur.com/lQR5X.gif?1)


What do you think?  Is it worth the speed decrease?

Ok.  That is all I have.  Here is the source code download(Fantastical graphical effect included, comment it out if u want, it IS labeled by a comment.)http://www.mediafire.com/download.php?ou3aar8po27ayrn (http://www.mediafire.com/download.php?ou3aar8po27ayrn)
Title: Re: [AXE] Bullet Hell
Post by: TIfanx1999 on November 27, 2012, 09:55:18 am
Not worth the speed decrease IMO. Work mor on making a complete product and then see how your total engine speed is. If you have a decent frame rate you can play around with adding things like that. :)
Title: Re: [AXE] Bullet Hell
Post by: pimathbrainiac on November 27, 2012, 10:07:40 am
Actually, it's up to 1.2.0

http://ourl.ca/4060/325065
Title: Re: [AXE] Bullet Hell
Post by: Roboman on November 27, 2012, 10:23:37 am
Actually, it's up to 1.2.0

http://ourl.ca/4060/325065
Actually, at the time of him posting that Axe was up to 1.1.2,Axe 1.2.0 has yet to come out.
Title: Re: [AXE] Bullet Hell
Post by: leafy on November 27, 2012, 11:10:53 am
Well to speed up each bullet you could use two rectangles to draw the back part of the bullet and one rectangle for the overlay. How much speed that would save I'm not certain, but it might be worth looking into.
Title: Re: [AXE] Bullet Hell
Post by: Roboman on November 27, 2012, 12:46:53 pm
Well to speed up each bullet you could use two rectangles to draw the back part of the bullet and one rectangle for the overlay.
Well, the bullet outline is not a square... it is meant to be a circle.
If you look closeley at it...
_**
*__*
*__*
_**
And I was thinking about using four pxl-on( commands...  Anybody know the fastest way to fill a two by two square?


*EDIT*
 :crazy:  Page#2!!!
:w00t: *.* :w00t: *.* :w00t: *.* :w00t: *.* :w00t:
Title: Re: [AXE] Bullet Hell
Post by: leafy on November 27, 2012, 01:02:25 pm
You can still make the circle with just two RectI commands.
Title: Re: [AXE] Bullet Hell
Post by: Eiyeron on November 27, 2012, 01:11:48 pm
Leafy, won't that be slower?
Title: Re: [AXE] Bullet Hell
Post by: Hayleia on November 27, 2012, 01:24:48 pm
You can still make the circle with just two RectI commands.
True, I do that in TinyCraft :P
RectI(X+1,Y,2,*2)
RectI(X,Y+1,4,/2)

But yeah, I don't know if it is faster than a sprite.
Title: Re: [AXE] Bullet Hell
Post by: Roboman on November 27, 2012, 02:22:47 pm
Ok...  Somebody ask Runer what the fastest method of drawing these two sprites... be it the sprite command, or something else...
-**-
*??*
*??*
-**-    the ?'s do not matter... they will be overwritten by the sprite below...
::::::
--
--       right now i am drawing ** after i drawInv and then drawInv after
                                            **

I am at school and omnom.omnimaga does not work here(some part of the url must be blocked) and efnet is entirely blocked.
If someone can do this b4 I get home that would be great.
Title: Re: [AXE] Bullet Hell
Post by: DJ Omnimaga on November 27, 2012, 03:01:24 pm
That looks nice but really hard O.O

It reminds me of another game called The Game, which you cannot win. Just kidding. For the special effect I wouldn't add it. Like Art said it's not worth the speed decrease and I actually prefer how it looks like without it. With it, it would do a nice job for some bubble game, though.
Title: Re: [AXE] Bullet Hell
Post by: Roboman on November 27, 2012, 03:23:22 pm
DJ_O, when I first mentioned this project to you, you sounded really excited...  and you just now posted here...  You must have a lot of topics to keep updated on all the time XD.
And when multiple bosses are done I will try to make a nice difficulty curve.
Title: Re: [AXE] Bullet Hell
Post by: DJ Omnimaga on November 27, 2012, 03:33:46 pm
Roboman I have about 2 years of posts to catch up on (about 150000 posts). >.< I usually now skip plenty of them and check threads randomly, since I wouldn't be able to keep up otherwise.
Title: Re: [AXE] Bullet Hell
Post by: leafy on November 27, 2012, 04:38:20 pm
Regardless, I think it's better off with the graphical effect. I tried doing the same thing a while ago, and I got it to work at a more than decent speed, so I'm sure that with some optimizations you should be able to get nice speeds and nice graphics at the same time :)
Title: Re: [AXE] Bullet Hell
Post by: Roboman on November 27, 2012, 05:35:01 pm
So far to create that effect I have been doing this:

DrawInv
for loop executes this for every bullet
draw a second 'bullet core' sprite(8*8!!!)
end for loop
DrawInv

I think I should instead do this:

for loop executes this for every bullet
pxl-off(B-XPos+1,B-YPos+1)
pxl-off(B-XPos+2,B-YPos+1)
pxl-off(B-XPos+1,B-YPos+2)
pxl-off(B-XPos+2,B-YPos+2)
end for loop

What do you think?
Title: Re: [AXE] Bullet Hell
Post by: Darl181 on November 27, 2012, 08:51:34 pm
I might be looking at this wrong, but have you tried masked sprites?  You could make it fill the middle with black as part of the sprite drawing itself.
The problem I see with this is they could/probably will overlap each other..also I'm not sure if it'd be faster/how much faster it would be.
Title: Re: [AXE] Bullet Hell
Post by: Roboman on November 28, 2012, 12:50:18 pm
The problem I see with this is they could/probably will overlap each other..
That is exactly why the second part must be in a second for( loop, and also why something like masked sprites will not achive this effect in one for loop

and anyways, I THINK four pxl-on('s are faster than one pt-on(



*Edit*
I have made up my mind.
I will keep the graphical effect, and until someone tells me a faster way, I will use four pxl-on commands.
Title: Re: [AXE] Bullet Hell
Post by: Roboman on November 30, 2012, 01:06:15 pm
Ok...  You are no longer without a weapon, and the boss is no longer indestructible...
I cannot upload a screenie or the code yet, I am at school.
You're weapon is a laser beam that is drawn before the bullets are drawn(is behind the bullets) but after the boss is drawn(in front of boss) and it is drawn as RectI(A+1,0,2,B).  I is now the 'greyscale' variable(I refuse to use the back buffer)  every frame I do this   :not(I)->I:  and the laser is drawn as a 'greyscale inverted rectangle' *.*.  There is a downside to shooting your laser beam...  while you shoot the laser you'r energy bar(hp bar) does not regenerate.
and if I want something drawn as 'gray'  I do if I:draw...  :end
however, I am not sure how to draw the boss health bar if different bosses have max hp...
What are you thinking about this new update?  Likes?  Dislikes? Post below  :'(
Title: Re: [AXE] Bullet Hell
Post by: leafy on November 30, 2012, 05:25:56 pm
Maybe if you posted a screenshot, we can give you some more critique - it's a lot easier to understand what you're talking about when we can see it :)
As for the greyscale, that should work since the laser shouldn't be that wide, but generally we avoid that method because the  resulting greyscale usually isn't all that great.
Title: Re: [AXE] Bullet Hell
Post by: Roboman on November 30, 2012, 09:24:11 pm
Oh...
So screenies =  :w00t: 8) :thumbsup:
And no screenies =  :-X ??? x.x
Putting up a screenie every single time can be a hassle... <_<

Here is the screenie(spoiler for what I am doing next at the end :o
(http://i.imgur.com/GJnMO.gif?1)
And I was not really going for a solid gray... I was going for a 'flickery gray'.  It makes the laser look unstable and when the ship is gray(invuln) it is a gray/black&white flashing hybrid.  It also leaves the back-buffer untouched that has to be a plus ;D
And I moved the laser rectangle to after the bullet render... I think it looks better.
And here is the sourcecode
http://www.mediafire.com/download.php?c3y2epad2kn9xzh (http://www.mediafire.com/download.php?c3y2epad2kn9xzh)
Title: Re: [AXE] Bullet Hell
Post by: Sorunome on November 30, 2012, 10:28:12 pm
Wow, this is pretty awesome! Will you add a highscore list?
Title: Re: [AXE] Bullet Hell
Post by: leafy on November 30, 2012, 10:57:51 pm
So how many bullets can your engine support? And will there be other enemies?

Also, it's generally good to provide a screenshot with your updates. It doesn't even have to be that long (maybe 10 seconds) just showing off your new feature or whatever.
Title: Re: [AXE] Bullet Hell
Post by: Sorunome on December 01, 2012, 01:55:11 am
Looks pretty good!
And yes Axe 0.2.2 is outdated, it's up to 1.1.2 now (http://ourl.ca/1463/228625). ;)
Axe 1.2.0 (http://ourl.ca/40605)
Title: Re: [AXE] Bullet Hell
Post by: Roboman on December 01, 2012, 09:44:08 am
The topic has been moved to TI Z80 calculator projects!
It is now a full fledged project! :crazy: :w00t: :crazy:

So how many bullets can your engine support?
The engine can support ~ 130 bullets, simply due to the size of L1.  Each bullet uses 6 bytes(2 for x and y position, 1 for x and y velocity)

And I think most of the clock cycles are used in controlling all the bullets so using L3 as well would probably almost halve the FPS.  This also means that optimization priority is by far highest in the bullet routine.


And will there be other enemies?
Maybe...  Keep in mind that the 'Boss API'*Still unfinished is very flexible...  The boss routines are responsible for positioning the boss, spawning the bullets, and also checking for any collisions of the laser with the boss, as well as lowering the boss health appropriately.  This means you can write the boss routine to instead of a boss, handle multiple enemies( maybe even using the still unused L3).
Once I have the API finished, I will open up to anybody writing boss routines for it. And if you feel like it you can make the enemy handler yourself.



Looks pretty good!
And yes Axe 0.2.2 is outdated, it's up to 1.1.2 now (http://ourl.ca/1463/228625). ;)
Axe 1.2.0 (http://ourl.ca/40605)
I mentioned this before... At the time he said 1.1.2, he was 100% up to date.... 1.2.0 came out a day or two later...
Title: Re: [AXE] Bullet Hell
Post by: Sorunome on December 01, 2012, 02:51:51 pm

So how many bullets can your engine support?
The engine can support ~ 130 bullets, simply due to the size of L1.  Each bullet uses 6 bytes(2 for x and y position, 1 for x and y velocity)
How much lag would there be O.o
Title: Re: [AXE] Bullet Hell
Post by: Roboman on December 01, 2012, 03:46:34 pm
Lag, what lag?
The game slows down a little bit when there is a lot of bullets, but never really lags.
Title: Re: [AXE] Bullet Hell
Post by: Sorunome on December 01, 2012, 03:47:10 pm
wow, that is pretty epic :crazy:
Title: Re: [AXE] Bullet Hell
Post by: Roboman on December 19, 2012, 12:53:15 pm
Ok, sorry I have dissapeared for so long :-[
I forgot to tell you people that I am the worst procrastinator ever :-\.

*me  ^-^ I think I should post an update
*procrastinator voice :devil: No! Too much effort to get the file onto mediafire and a the file to wabbitemu for screene then screene to imgir then mediafire-link and imgir-link and update info to post.  WAAYY TO MUCH EFFORT.  And time.  Watch Youtube instead.
*me  :-\ But...
*procrastinator voice  :mad: JUST DO IT

 :'(
I have had an update ready for about 3 weeks now(sorry :-\)
I will update when I get home.
Title: Re: [AXE] Bullet Hell
Post by: Hayleia on December 19, 2012, 01:43:52 pm
You don't need mediafire and imgur, you can attach your files to your post and screenshots will automatically be displayed at the end of your post.
Title: Re: [AXE] Bullet Hell
Post by: Roboman on December 19, 2012, 01:52:49 pm
You don't need mediafire and imgur, you can attach your files to your post and screenshots will automatically be displayed at the end of your post.
SWEET :thumbsup:
But I am not sure what this means...
Quote from: Attach_Button
Maximum attachment size allowed: 4096 KB, per post: 50
Title: Re: [AXE] Bullet Hell
Post by: leafy on December 19, 2012, 01:53:46 pm
TBH, imgur and img.removedfromgame.com are preferred, because you can stick them straight into the post, and if they should the omni servers go down for whatever reason they'll still be accessible.
Title: Re: [AXE] Bullet Hell
Post by: Hayleia on December 19, 2012, 01:55:04 pm
TBH, imgur and img.removedfromgame.com are preferred, because you can stick them straight into the post, and if they should the omni servers go down for whatever reason they'll still be accessible.
That is true, but he was talking about laziness so I only said that attaching files to his post was a very easy and quick solution :P
Title: Re: [AXE] Bullet Hell
Post by: Darl181 on December 19, 2012, 06:01:56 pm
Btw the "per post: 50" just means there's a maximum of 50 attachments per post.
Tho admittedly posts with even >5 attachments are rare unless the person's really heavy on the screenshots :P
Title: Re: [AXE] Bullet Hell
Post by: Roboman on December 19, 2012, 06:49:45 pm
Here is the update I promised.
The boss API is done.  I don't have the creative juices to make many more boss routines...  I want to see if anybody would like to make a boss routine...(like making a map, or sprite, but a code snippet for a boss's behavior).  I have three example boss routines(third one is not finished).  It requires a routine to run every frame, and a routine to initialize the boss.
*edit
(and don't worry, the gray looks MUCH better on calc)
And also I forgot to mention pressing [window] sets the 'invuln' counter to 100.  godmode for debugging specific bosses.
Title: Re: [AXE] Bullet Hell
Post by: stevon8ter on December 19, 2012, 06:53:42 pm
Looks nice...

Maybe you should make something like energy? I mean so you can't shoot laser all the time...
Title: Re: [AXE] Bullet Hell
Post by: Roboman on December 19, 2012, 06:55:18 pm
Hey stevon8ter...  I do have something like energy... In fact I CALL it energy.  Energy=life.  You regen when not shooting, and slowly drain when slow-mode.  I was holding window for unlimited health XD.

*edit
Energy...life...health...SAME THING *.* :w00t:
Title: Re: [AXE] Bullet Hell
Post by: stevon8ter on December 19, 2012, 06:58:04 pm
Ooooooh ok, sorry :p
But that's a nice idea behind the energy-life thing ;) keeep on the good work (maybe some lvl's with some objects to hide behind?)
Title: Re: [AXE] Bullet Hell
Post by: Sorunome on December 19, 2012, 07:17:37 pm
nice, my browser lagged when displaying that gif ^^ (even thought it is probably something different)
Title: Re: [AXE] Bullet Hell
Post by: Roboman on March 25, 2013, 04:27:31 pm
Thread dies.
Four months later...
update tonight(I promise)
Title: Re: [AXE] Bullet Hell
Post by: Roboman on March 25, 2013, 04:27:46 pm
Ok, so I get to work on uploading the update...
and this happens... I
                          V

its the end of the world   O.O  ??? :'( :-[ :( >:( :banghead: :mad: D: x.x :-\
Title: Re: [AXE] Bullet Hell
Post by: Keoni29 on March 25, 2013, 05:53:26 pm
Happened to me a lot. Try a graphlink cable instead if you have one. Swap out the usb plugs a couple of times and see what it does.
Title: Re: [AXE] Bullet Hell
Post by: Roboman on March 25, 2013, 05:58:09 pm
I only have a silverlink cable.
and usb cables would be impossible(83pSE)
And I swapped out both plugs many times
I don't know what to do   :'(
Title: Re: [AXE] Bullet Hell
Post by: TIfanx1999 on March 25, 2013, 06:08:58 pm
TI connect can be picky. Make sure your batteries are good. It does this sometimes if they are low, even if they have a charge.
Title: Re: [AXE] Bullet Hell
Post by: Phero on March 25, 2013, 07:19:34 pm
TI connect can be picky. Make sure your batteries are good. It does this sometimes if they are low, even if they have a charge.

Absolute truth. I've had a few panic attacks where I irrationally thought that my port was dying or that I had borked something up playing with ASM code. Every single time, it turns out to be low batteries.
Title: Re: [AXE] Bullet Hell
Post by: Roboman on April 02, 2013, 05:23:38 pm
Alright, it seems the link port is somewhat damaged... :'( :-[
But if i press the cable into it firmly while transferring it works. :-\
And that means...
UPDATE
Only one screenie with no animation... for a reason  ^-^
The song is a slightly modified ParagonX9 ChaozFantasy.