User Tools

Site Tools


journal:spring2019:jwilli57:start

Jimito's spring2019 Journal

One last time


Introduction

Just tryin to understand

music.txt

wine ./tools/text3data.exe -ca65 music.txt → music.s

include famitone2.h library in code

Make sure the values are the values you think they are


comporg week13


May 1st, 2019

More thoughts on BossBreaker:

So music is coming along, will try tomorrow to implement it into the game. The game itself is done, but a few minor touches I want to add are still left:

- Music (main, game over, game win)
- Secret Boss?
- Medals

So Music is obvious, I have a small tune already made. But I want it to be perfect for the game, so more revisions. I will have to do much more reading and watching tutorials for this.

Medals are already started, each one pertaining to a achievement

- Beat Boss 0
- Beat Boss 1 any%
- Beat Boss 2 any%
- Beat Boss 3/4 any%
- Beat Boss 5/6 any%
- Beat Boss 7 any%
- Beat True Boss 7
- Beat all true bosses

So beating Boss 0 is simply destroying all 7 leaders, mercy/kill ending don't matter
Beating Boss 1-7 any% is defeating the boss with any kind of minion combo, can stack with a true boss kill
Beating True Boss 7, letting all minions live and destroying no leaders, then proceed to beat the Boss
Beat all True Bosses, destroying only leaders to get the true form of lesser bosses, then beat them

Possible Medals: - Defeat Secret Boss - Get a perfect game - Defeat the True Boss in Hard mode

A perfect game is destroying all minions and leaders
Beating the True boss in hard mode, is exactly what it sounds like
Now for the secret boss, that would include using the menu sprites, the main body wont move, but tentacles will, this would take an immense amount of time and effort to implement and pull off, but why not?

To make it extra special it has to have new patterns, a lot of them, and maybe different music but that will have to be way later.

Body Sprites will be in the background, Tentacles will be sprites, maybe some minions flying about

How to access secret boss:
← ^ B V → A
either cut right to the Secret Boss
or
have player beat the true boss (any mode) to get to it.

Feedback for activated secret will be either a sound, or sprite on screen

comporg week12


4/24/19

Summary of things left for BossBreaker:

VS mode: the early stage of vs is running and a simple (but repetitive) solution is already known, implementation won't take long. Only thing left to worry about is the Boss, and point values. Bosses maybe worth 10 points, and leaders worth 4, something to that effect. Other minions are worth 1 point. Also a win screen will need proper feedback as to who won. Maybe “Game P1” as there is no “wins”, actually moving the scores to the middle of the screen sounds perfect.

"P1 08"
"P2 13" 

Music: This has been on my mind for awhile, is there enough time though? I have a simple song made but I have never used famitracker, I am currently watching tutorials and hopefully will have some sound before the end of the semester.

Bugs: WHATEVER IS IN THE TOP LEFT, reseting the game without getting hell's gate, and P2 feels clunky

Other: I am happy with the progress but I want music in the game to feel content overall. The bosses are great and provide a good challenge or impossible ones for beginners. It is more of a game you play for a little and you either drop it and forget about it, or come back to it every once and awhile, It's a fun concept that I will expand upon in future projects (BossBreaker 2). For what it is, a simple nes game, it has taught me alot about myself and what I know, and what I'm capable of. Finally the amount of lines in the script doesn't matter if the game itself isn't fun.

comporg week11


4/17/19

pct0

              AIR
       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN
        -ARITAAN
         =======
          APPTTLG
         -ASEETSS
          =======
           AANGRP

A ( 0 1 2 3 4 5 6 7 8 9 )
E ( 0 1 2 3 4 5 6 7 8 9 )
G ( 0 1 2 3 4 5 6 7 8 9 )
I ( 0 1 2 3 4 5 6 7 8 9 )
L ( 0 1 2 3 4 5 6 7 8 9 )
N ( 0 1 2 3 4 5 6 7 8 9 )
P ( 0 1 2 3 4 5 6 7 8 9 )
R ( 0 1 2 3 4 5 6 7 8 9 )
S ( 0 1 2 3 4 5 6 7 8 9 )
T ( 0 1 2 3 4 5 6 7 8 9 )

So I always start off crossing which numbers can't be 0

Since these numbers will never start with 0, I can then find the first letter of each number and cross it off

0 != A, T, S

A, T, or S start each number, so they can't be 0

A (   1 2 3 4 5 6 7 8 9 )
E ( 0 1 2 3 4 5 6 7 8 9 )
G ( 0 1 2 3 4 5 6 7 8 9 )
I ( 0 1 2 3 4 5 6 7 8 9 )
L ( 0 1 2 3 4 5 6 7 8 9 )
N ( 0 1 2 3 4 5 6 7 8 9 )
P ( 0 1 2 3 4 5 6 7 8 9 )
R ( 0 1 2 3 4 5 6 7 8 9 )
S (   1 2 3 4 5 6 7 8 9 )
T (   1 2 3 4 5 6 7 8 9 )

/////////////////////////////////////////////////////////////////////

              AIR
       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN
        -ARITAAN
         =======
          APPTTLG
         -ASEETSS
          =======
           AANGRP

Now I see that TENNIS is being multiplied by A first and is resulting in another TENNIS, that means that A must be 1

TENNIS * 1 = TENNIS
TENNIS * A = TENNIS
A = 1

A (   1                 )
E ( 0   2 3 4 5 6 7 8 9 )
G ( 0   2 3 4 5 6 7 8 9 )
I ( 0   2 3 4 5 6 7 8 9 )
L ( 0   2 3 4 5 6 7 8 9 )
N ( 0   2 3 4 5 6 7 8 9 )
P ( 0   2 3 4 5 6 7 8 9 )
R ( 0   2 3 4 5 6 7 8 9 )
S (     2 3 4 5 6 7 8 9 )
T (     2 3 4 5 6 7 8 9 )

/////////////////////////////////////////////////////////////////////

              AIR
       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN
        -ARITAAN
         =======
          APPTTLG
         -ASEETSS
          =======
           AANGRP

Next I see ARITAAN being subtracted from ANTIEEN

         ANTIEEN
        -ARITAAN
         =======
          APPTTLG

Since N and N are being subtracted from each other the result must
be 0, L is in that spot so L must be 0

N - N = 0
N - N = L
L = 0

A (   1                 )
E (     2 3 4 5 6 7 8 9 )
G (     2 3 4 5 6 7 8 9 )
I (     2 3 4 5 6 7 8 9 )
L ( 0                   )
N (     2 3 4 5 6 7 8 9 )
P (     2 3 4 5 6 7 8 9 )
R (     2 3 4 5 6 7 8 9 )
S (     2 3 4 5 6 7 8 9 )
T (     2 3 4 5 6 7 8 9 )

/////////////////////////////////////////////////////////////////////

              AIR
       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN
        -ARITAAN
         =======
          APPTTLG
         -ASEETSS
          =======
           AANGRP

Now that I know that L is 0 I can look at this section

          APPTTLG
         -ASEETSS
          =======
           AANGRP

T is being subtracted from T so there should be an L below, but
it is a G, and since T is equal to T it is not borrowing, but
it is being borrowed from

          ***TTL*
         -***ETS*
          =======
          ***NGR*

Since S is being subtracted from L, and L is 0, L needs to borrow
from T

               @
          ***TTL*
         -***ETS*
          =======
          ***NGR*

But now since we borrowed from T it is now less than the T being
subtracted from it, we need to borrow again

              @@
          ***TTL*
         -***ETS*
          =======
          ***NGR*

Now the orginal T we were looking at has been borrowed from and has
borrowed from something, so it is now

         10 + ( T - 1 )

Now this is has a T being subtracted from it

         10+(T-1)
        -      T
         ========

And now if we were to plug in any number for T the result would
be a 9

          10+(5-1)
          -     5
          ========
                9

And since G is in that spot, G must be 9

(10+(T-1) - T = 9
(10+(T-1) - T = G
G = 9

A (   1                 )
E (     2 3 4 5 6 7 8   )
G (                   9 )
I (     2 3 4 5 6 7 8   )
L ( 0                   )
N (     2 3 4 5 6 7 8   )
P (     2 3 4 5 6 7 8   )
R (     2 3 4 5 6 7 8   )
S (     2 3 4 5 6 7 8   )
T (     2 3 4 5 6 7 8   )

/////////////////////////////////////////////////////////////////////

              AIR
       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN
        -ARITAAN
         =======
          APPTTLG
         -ASEETSS
          =======
           AANGRP

Now for some general things, bottom numbers must be lower than
higher numbers

       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN

TENNIS is lower than STARLI, we can infer only the first letters
here because the following ones may differ, so S is greater than T

S > T

The difference between them is A which we know is 1

S - T = 1

we don't know if S is borrowed from so, we'll come back later

         ANTIEEN
        -ARITAAN
         =======
          APPTTLG

Looking here we see A - A which is 0, but N - R is of intrest,
because it follows the rule established earlier

N > R

and the difference is N-R=1, we aren't sure if N was borrowed from
yet so we won't make any assumptions

Now lets look at the bottom part

          APPTTLG
         -ASEETSS
          =======
           AANGRP

A-A=0, P-S=1, same rule

P > S

So we can combine some of these

P > S > T
N > R

N has to be at least 1 greater than R, so it must be 3 or more

R has to be at least 1 less than N, so it must be 7 or less


S has to be at least 1 greater than T, and 1 less than P
so it must be between 3 and 7

T has to be at least 1 less than S and P, so it must be 6 or less


P has to be at least 1 greater than S and T, so it must be 4 or more

A (   1                 )
E (     2 3 4 5 6 7 8   )
G (                   9 )
I (     2 3 4 5 6 7 8   )
L ( 0                   )
N (       3 4 5 6 7 8   )
P (         4 5 6 7 8   )
R (     2 3 4 5 6 7     )
S (       3 4 5 6 7     )
T (     2 3 4 5 6       )

P>S>T
N>R

/////////////////////////////////////////////////////////////////////

              AIR
       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN
        -ARITAAN
         =======
          APPTTLG
         -ASEETSS
          =======
           AANGRP

Looking at the bottom one

          APPTTLG
         -ASEETSS
          =======
           AANGRP

We know G is 9

G - S = P
9 - S = P

S (       3 4 5 6 7     )
P (         4 5 6 7 8   )

So we plug in numbers for S and see the results

9 - 7 = 2
9 - 6 = 3
9 - 5 = 4
9 - 4 = 5
9 - 3 = 6

So the only numbers for S to work here is 5,4,3
And P can only be 4,5,6

S (       3 4 5 6 7     )
P (         4 5 6       )

and since P > S

S (       3 4 5         )
P (         4 5 6       )

and since P>S>T

S (       3 4 5         )
P (         4 5 6       )
T (     2 3 4           )


So now we have

A (   1                 )
E (     2 3 4 5 6 7 8   )
G (                   9 )
I (     2 3 4 5 6 7 8   )
L ( 0                   )
N (       3 4 5 6 7 8   )
P (         4 5 6       )
R (     2 3 4 5 6 7     )
S (       3 4 5         )
T (     2 3 4           )

P>S>T
N>R

/////////////////////////////////////////////////////////////////////

              AIR
       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN
        -ARITAAN
         =======
          APPTTLG
         -ASEETSS
          =======
           AANGRP

Looking at bottom one

          APPTTLG
         -ASEETSS
          =======
           AANGRP

Since we know L is 0, it must borrow, and it also is not borrowed
from, so it becomes

(10+L) - S = R
(10+0) - S = R

10 - S = R

S (       3 4 5         )
R (     2 3 4 5 6 7     )

plug time

10 - 3 = 7
10 - 4 = 6
10 - 5 = 5

So R must be 5,6, or 7

S (       3 4 5         )
R (           5 6 7     )

and we know N>R

N (             6 7 8   )
R (           5 6 7     )
S (       3 4 5         )

So we now have

A (   1                 )
E (     2 3 4 5 6 7 8   )
G (                   9 )
I (     2 3 4 5 6 7 8   )
L ( 0                   )
N (             6 7 8   )
P (         4 5 6       )
R (           5 6 7     )
S (       3 4 5         )
T (     2 3 4           )

P>S>T
N>R

/////////////////////////////////////////////////////////////////////

              AIR
       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN
        -ARITAAN
         =======
          APPTTLG
         -ASEETSS
          =======
           AANGRP

Looking at the top

       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN

Specifically

         *T******
        -*E****
         ======
         *N*****

So we know the ranges for T and N

N (             6 7 8   )
T (     2 3 4           )

but E is still a mystery

E (     2 3 4 5 6 7 8   )

Now looking at the equation

    [2,3,4]
   -     E
    =======
    [6,7,8]

T must have had to borrow, ALSO

         STARLING
        -TENNIS
         ======
         ANTIEEN

A is 1, and N is larger so A needs to borrow from T
resulting in T needing to be 1 less, so we now have


    10 + ([2,3,4] - 1)
   -                E
    =================
              [6,7,8]

In cleaner form

      [11,12,13]
     -        E
      =========
        [6,7,8]

Now doing some number plugging

 11  11  11  12  12  12  13  13  13
- 3 - 4 - 5 - 4 - 5 - 6 - 5 - 6 - 7
 ==  ==  ==  ==  ==  ==  ==  ==  ==
  8   7   6   8   7   6   8   7   6

We can see that E has a range of 3 to 7

A (   1                 )
E (       3 4 5 6 7     )
G (                   9 )
I (     2 3 4 5 6 7 8   )
L ( 0                   )
N (             6 7 8   )
P (         4 5 6       )
R (           5 6 7     )
S (       3 4 5         )
T (     2 3 4           )

P>S>T
N>R

/////////////////////////////////////////////////////////////////////

              AIR
       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN
        -ARITAAN
         =======
          APPTTLG
         -ASEETSS
          =======
           AANGRP

Looking at the top

       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN

Specifically

         ***R****
        -***N**
         ======
         ***I***

We have some ranges

R (           5 6 7     )
N (             6 7 8   )
I (     2 3 4 5 6 7 8   )

Looking back

         STARLING
        -TENNIS
         ======
         ANTIEEN

Since L is 0, it must borrow from R
and since R is less than N, it must borrow from A, so we now have

    10 + ( R - 1 )
   -           N
    =============
               I

Ranges added

    10 + ( [5,6,7] - 1 )
   -            [6,7,8]
    ===================
                     I

Cleaner

    [14,15,16]
   -   [6,7,8]
    ==========
            I

Plug em in

 14  14  14  15  15  15  16  16  16
- 6 - 7 - 8 - 6 - 7 - 8 - 6 - 7 - 8
 ==  ==  ==  ==  ==  ==  ==  ==  ==
  8   7   6   9   8   7  10   9   8

Now here I has a range of 6 to 8 (9 taken, 10 not an option)
We now have

A (   1                 )
E (       3 4 5 6 7     )
G (                   9 )
I (             6 7 8   )
L ( 0                   )
N (             6 7 8   )
P (         4 5 6       )
R (           5 6 7     )
S (       3 4 5         )
T (     2 3 4           )

T is the only option left for 2

A (   1                 )
E (       3 4 5 6 7     )
G (                   9 )
I (             6 7 8   )
L ( 0                   )
N (             6 7 8   )
P (         4 5 6       )
R (           5 6 7     )
S (       3 4 5         )
T (     2               )

P>S
N>R

/////////////////////////////////////////////////////////////////////

             AIR
       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN
        -ARITAAN
         =======
          APPTTLG
         -ASEETSS
          =======
           AANGRP

Looking at top

       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN

Specifically

         *****I**
        -*****S
         ======
         *****E*

We have some ranges

I (             6 7 8   )
S (       3 4 5         )
E (       3 4 5 6 7     )

Now back to earlier

         STARLING
        -TENNIS
         ======
         ANTIEEN

Since I is greater than S it does not need to borrow
and since it is the last digit, it cannot have any borrowers

    [6,7,8]
   -[3,4,5]
    =======
         E

Plug em

  6   6   6   7   7   7   8   8   8
- 5 - 4 - 3 - 5 - 4 - 3 - 5 - 4 - 3
 ==  ==  ==  ==  ==  ==  ==  ==  ==
  1   2   3   2   3   4   3   4   5

so E has a range of 3 to 5 ( 1 & 2 taken )

A (   1                 )
E (       3 4 5         )
G (                   9 )
I (             6 7 8   )
L ( 0                   )
N (             6 7 8   )
P (         4 5 6       )
R (           5 6 7     )
S (       3 4 5         )
T (     2               )

P>S
N>R

/////////////////////////////////////////////////////////////////////

              AIR
       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN
        -ARITAAN
         =======
          APPTTLG
         -ASEETSS
          =======
           AANGRP

Looking at top again

         STARLING
        -TENNIS
         ======
         ANTIEEN

Specify

         S*******
        -T*****
         ======
         A******

Ranges

S (       3 4 5         )
T (     2               )
A (   1                 )

Back

         STARLING
        -TENNIS
         ======
         ANTIEEN

Since T is less than E it must borrow from S
S does not need to borrow

    (S - 1)
   -     2
    ======
         1

Values

    [2,3,4]
   -     2
    =======
         1

Plug


 (3) (4) (5)
  2   3   4
- 2 - 2 - 2
 ==  ==  ==
  0   1   2

S being 4 is the only option

A (   1                 )
E (       3   5         )
G (                   9 )
I (             6 7 8   )
L ( 0                   )
N (             6 7 8   )
P (           5 6       )
R (           5 6 7     )
S (         4           )
T (     2               )

N>R

/////////////////////////////////////////////////////////////////////

              AIR
       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN
        -ARITAAN
         =======
          APPTTLG
         -ASEETSS
          =======
           AANGRP

Looking at bottom

          APPTTLG
         -ASEETSS
          =======
           AANGRP

Specific

          ******G
         -******S
          =======
           *****P

G being larger than s, it does not need to borrow
nor is it being borrowed from

Values

    9
  - 4
   ==
    5

P must be 5

A (   1                 )
E (       3             )
G (                   9 )
I (             6 7 8   )
L ( 0                   )
N (             6 7 8   )
P (           5         )
R (             6 7     )
S (         4           )
T (     2               )

This makes E = 3

N>R

/////////////////////////////////////////////////////////////////////

              AIR
       +---------
TENNIS | STARLING
        -TENNIS
         ======
         ANTIEEN
        -ARITAAN
         =======
          APPTTLG
         -ASEETSS
          =======
           AANGRP

Bottom

          APPTTLG
         -ASEETSS
          =======
           AANGRP

we are going to plug in numbers we know

          1552209
         -1433244
          =======

Now to solve this

          1552209
         -1433244
          =======
           118965

Line it up

 AANGRP
 118965

We see N = 8 and R = 6
other letters match up

A (   1                 )
E (       3             )
G (                   9 )
I (               7     )
L ( 0                   )
N (                 8   )
P (           5         )
R (             6       )
S (         4           )
T (     2               )

This makes I = 7

Done

comporg week8


March 14, 2019

Pi things: https://www.raspberrypi.org/products/raspberry-pi-1-model-b-plus/
http://www.raspberry-pi-geek.com/howto/GPIO-Pinout-Rasp-Pi-1-Rev1-and-Rev
http://wiringpi.com/
http://wiringpi.com/pins/

BossBreaker:
Instead of having the enemy palette 0x1 and changing it for EVERY single one, I am making the enemy palette the default one.

Player palette is now 0x1

SWARM boss patterns:
Boss 0: slowly moves upwards until it is gone
Boss 1: moves around, seems to stay near edges
Boss 2: Moves kinda quick, pattern can be found out rather quick
Boss 3: Moves quickly, not as threatening pattern
Boss 4: not implemented yet
Boss 5: not implemented yet

Wanted patterns
Boss 1: stays nears edges of screen, single projectile
Boss 2: moves diagonally, 2 projectiles
Boss 3: Moves in box pattern, 3 projectiles
Boss 4: 2 patterns, straight line horizontal shooting projectiles, then spiral outwards from middle
Boss 5: all 16 sprites split apart, each has their pattern, they reconvene at certain spots for a second

Music implementation, reachable? If its possible why not
Starting screen completely possible, be made up soon
player hit detection, may be another 400 lines of if statements but totally doable, double that for player 2
score and health, implementation is easy, just needs to be done
other levels? before the deadline, probably not, as long as the SWARM level is done, I'm happy
other modes? possible, vs mode seems reachable but main game comes first
player 2, main screen will ask for players, player 2 wont spawn for 1 player

This weekend will determine how I feel on the other aspects, although:

  • Starting screen menu
  • Finished SWARM level
  • hit detection
  • score/health
  • Queen patterns

These seem the most doable

comporg break1


Break week 1

Boss Breaker Ideas:

Copy:
Pacman - pacman is huge and travels about the screen, could have the 4 ghosts as mini hazards
DigDug - Player starts out in a small area, can shoot ground to “dig” it, monsters and the digger attack
Galaga - Could remain the same, swarming aliens, capturing
Tetris - Pieces fall and damage player, if a row is cleared blow up maybe
Mario bros. - Mario level perhaps, enemies and mario bros. go about

Original:
Swarm - Already done

Forger - tiny flames go towards a furnace, forger swings at player(s) from time to time, once a set amount of flames are collected, the forger makes a new weapon/armour, after ~3 minutes, the Forger then takes all weapons and Armour he has made and proceeds to attack.

Flames - 1hp , 1.0x speed , omnidirectional but towards furnace
Forger
* Weapons: Hammer/dagger/long sword/Battle Axe/Mace/Flail/Spear
- hammer is his standard up→down attack
- dagger is a quick ranged attack, angled towards player
- Long sword is a diagonal attack, quick
- B.Axe is a sweeping arc attack, slow
- Mace is a side→side attack
- Flail is a circular attack around the Forger, deflects attacks?
- Spear is a straight forward attack, very long

* Armour: None/Boots/Leggings/Chestplate/helmet
* hp: 10hp/20hp/30hp/40hp/50hp
* speed: 2/1.75/1.5/1.25/1

As time goes on and flames continue to gather, the forger becomes more powerful
if no flames are destroyed, potentially a different form?

Factory - Robot assembly line, pieces are taken down the line and robots are assembled to attack player

Robots - 3hp , 1.0 speed , beeline to player
Lazer robots - 2hp , 1.5 speed, strafing
Boss Robot
* Weapons: Lazers, extendo arms, overclocking * hp: 3/30/60/90 * speed: 1.0

Over 3 minutes, the robot in the background slowly gets built, three machines make 1 piece for it
Legs,Body,Head
You can damage any machine at any time, if a machine gets destroyed, the piece corresponding to that machine is then “damaged” and the corresponding weapon is no longer functional.

damaged Legs means no overclocking (moving faster) damaged Body means no extendo arms (large ranged attack, slow) damaged Head means no lazers (small ranged attack, quick)

If all three machines are destroyed before 3 minutes, the robot is then completely damaged and therefore useless

comporg week7


March 7, 2019

Bossbreaker next steps, get level 1 polished, then work on levels 2 & 3

when the boss is ready to start, all the swarmlings remaining should converge unto the queen.

so far they are fairly scattered but the left side is somewhat bare when it happens.

So far: swarmlings are in patterns wanted, they stop nicely and boss updates as plan Next: Hit detection, health, and maybe score

comporg week6


March 5, 2019

I had a growing concern for the amount of sprites I am using for my levels, but a new idea dawned upon me; Reuse the sprites.

Instead of having 30+ sprites dedicated for one level, I could re-purpose each sprite for the next level.

sprite meaning sprite space within the code.

73 sprite_t swarm_m1;
74 sprite_t swarm_m2;
75 sprite_t swarm_m3;
76 sprite_t swarm_m4;
77 sprite_t swarm_b1;
78 sprite_t swarm_b2;
79 sprite_t swarm_b3;
80 sprite_t swarm_b4;
81 sprite_t swarm_b5;
82 sprite_t swarm_b6;
83 sprite_t swarm_b7;
84 sprite_t swarm_b8;
85 sprite_t swarm_b9;

instead of this i could have;

73 sprite_t enemy_m1;
74 sprite_t enemy_m2;
75 sprite_t enemy_m3;
76 sprite_t enemy_m4;
77 sprite_t enemy_b1;
78 sprite_t enemy_b2;
79 sprite_t enemy_b3;
80 sprite_t enemy_b4;
81 sprite_t enemy_b5;
82 sprite_t enemy_b6;
83 sprite_t enemy_b7;
84 sprite_t enemy_b8;
85 sprite_t enemy_b9;

so minions could have a set amount of dedicated sprite slots, and bosses could have another pool.

The largest boss so far takes 16 squares, so 16 slots will be dedicated for future bosses.

Late night thoughts: Having the swarmlings attack from different spots along the screen from different speeds and different angles

also once the base level is done, before the level starts, the screen should be black, the queen slowly decends from the top and remains in the center-top. then from around the screen, all the swarmlings slowly fade into their initial spawnpoints. giving the players a chance to position.

also possibly a different approach:

the aliens all gather onscreen, and send out different patterns before going berserk. So maybe a group of smol bois go first to show their horizontal paths, then the med bois show off their diagonal paths, large bois show the vertical paths and then the leaders show up for a sec to show theirs.

whether or not the player can move at this point is questionable, but due to the fast paced nature of the game, I think just having the swarm come in and go straight to berserk is the right choice.

comporg week5


February 13, 2019

Nintendo age tutorials

1. Core programming concepts:
Instructions - smallest command run, one after another, NES has 56
Variables - place to store modifiable data
Control flow - instead of sequential, code can jump around

2. NES System Architecture
KB - Memory size is listed in KiloBytes or KB. 1KB = 1024 bytes. Everything is powers of 2, so 2^10 = 1024 is used instead of 1000. If the capitalization is different, the meaning can change. Kb is Kilobits. Divide Kb by 8 to get KB, because 1 byte = 8 bits.

ROM - Read Only Memory, holds data that cannot be changed. This is where the game code or graphics is stored on the cart.

RAM - Random Access Memory, holds data that can be read and written. When power is removed, the chip is erased. A battery can be used to keep power and data valid.

PRG - Program memory, the code for the game

CHR - Character memory, the data for graphics

CPU - Central Processing Unit, the main processor chip

PPU - Picture Processing Unit, the graphics chip

APU - Audio Processing Unit, the sound chip inside the CPU

http://www.nesmuseum.com/images/nesarchitecture.png

http://nintendoage.com/forum/messageview.cfm?catid=22&threadid=4291

3. Code layout

PPUMASK ($2001)

76543210

——— Intensify blues (and darken other colors)

6502 references pages:
https://web.archive.org/web/20140612092301/http://https://web.archive.org/web/20140612092301/http://www.obelisk.demon.co.uk/6502/www.obelisk.demon.co.uk/6502/

misckelanois info: a load instruction can take longer than an increment 56 NES commands, learn them

Boss Breaker Ideas:
Bosses are previous retro games -
Galaga, Pacman, Mario bros., centipede, tetris, dig dug, etc.

Bosses are original:
SWARM
small - 1hp , move horizontal , fast 1.5x , 20 total
normal - 2hp , move diagonal , normal 1.0x , 15 total
large - 3hp , move vertical , slow 0.5x , 10 total
leader - 10hp , move curvally , normal 1.0x , 4 total
Boss - 1 total, 5 versions

  • hp: 1/25/50/75/100
  • omnidirectional
  • speed: 0.0x/0.5x/1.0x/1.5x/2.0x
  • V1 - small, immobile, wimpy looking
  • V2 - normal, slow, non-threatining
  • V3 - large, mobile, threatining
  • V4 - Huge, fast, scary
  • V5 - Gigantic, insane speed, you are going to die

player takes damage upon touching a swarmling
swarmlings are on a defined path
leaders will spawn once per 30 seconds, they will take 30 seconds to travel to the boss, if they are not killed in this time they will converge with the boss, the boss will then become the next version.
Other ideas: after 3 minutes, the swarmlings converge on the boss becoming one, the boss then proceeds to attack.
If no swarmlings are killed, after 3 minutes, potentially a 6th version?

comporg week4


February 7, 2019

Dealing with sprite attributes

76543210 7: vertical flip, 6: horizontal flip, 5: priority (0 front, 1 back)
4,3,2: nothing, 1,0: palette

to change palette:

COLOR_BLACK,
COLOR_DGRAY,COLOR_WHITE,COLOR_LGRAY,   // palette 0
COLOR_BLACK
COLOR_YELLOW, COLOR_GREEN, COLOR_BLUE, // palette 1

to select the other palettes:
player.attributes = player.attributes & 0x00;
player.attributes = player.attributes | 0x01;
works because its in OAM memory, look into.

Challenge: Draw more objects unto the screen WC Notes:

if(missile1.x == player2.x && missile1.y == player2.y){
    PPU_ADDRESS = 0x1A;
    PPU_ADDRESS = 0x4D;
    PPU_DATA    = 0x31;
}

this flicks the screen for a frame or so, shifting the border, background and scoreboard. changing the ppuaddress shifts the screen more. also sometimes the border is not placed in the correct spot.

if the correct address is chosen, you can replace the 0 score for player 1 with a 1. screen still shifts but the border, battleground and score will go to original spots.

Solution: use a sprite and modify that for score.

Scoreboard functional

Challenge 2: Implement functional collision detection for missiles

able to get minuscule detection, increase hitbox size

comporg week3


January 31, 2019

NTSC - North America
PAL - Europe

PPU_ADDRESS = (uint8_t)(ppu_addr » 8); upper byte
PPU_ADDRESS = (uint8_t)(ppu_addr); lower byte

PPU_ADDRESS takes addresses in twos

so the ppu_addr is 16 bytes so it must be split in two, shifting the address over by 8, we get the first byte or higher byte of ppu_address, we do this because if we gave all of ppu_addr, the lower byte of ppu_addr is taken. So shifting the higher byte down to the lower one, we give PPU_ADDRESS the higher byte of ppu_addr

Ex. if ppu_addr is 10010110 01100111
since PPU_ADDRESS can only take 8 bits at a time it needs to be fed slowly

by shifting ppu_addr by 8 we get 00000000 10010110, that goes to the higher byte of PPU_ADDRESS

then give PPU_ADDRESS, ppu_addr again, then PPU takes the lower byte of ppu_addr, 01100111

so the final PPU_ADDRESS is 10010110 01100111 the same as ppu_addr

xterm(n), something about multiple languages working together

void DrawBackground(){

PPU_ADDRESS = (uint8_t)((PPU_NAMETABLE_0 + NAMETABLE_OFFSET) >> 8);
PPU_ADDRESS = (uint8_t)((PPU_NAMETABLE_0 + NAMETABLE_OFFSET);

} Same as earlier, pushing 2 bytes of data into memory by shifting the bits around

shift loses bits as 0's, rotate keeps them
rotate is more expansive

Weekly Assignment:

comporg week2


January 24, 2019

making a rom

constants should stay together rom variables should never change

DMA: direct memory access

CPU and PPU cannot access each others memory blitting and flipping does that

6502 is big endian

when 0x2006 is used a set of instructions is set into place

24     PPU_ADDRESS = 0x3f; // upper byte
25     PPU_ADDRESS = 0x00; // lower byte

Understanding the file

#include <stddef.h>
#include <stdint.h>

these are header files that include many functions

#define PPU_CTRL    *((uint8_t*)0x2000)
#define PPU_MASK    *((uint8_t*)0x2001)
#define PPU_STATUS  *((uint8_t*)0x2002)
#define PPU_SCROLL  *((uint8_t*)0x2005)
#define PPU_ADDRESS *((uint8_t*)0x2006)
#define PPU_DATA    *((uint8_t*)0x2007)

info needed

#define COLOR_BLACK 0x0f
#define COLOR_WHITE 0x20

declaring colors that will be used

#pragma bss-name(push, "ZEROPAGE")
size_t i;
#pragma bss-name(pop)

info needed

const char TEXT[] = "Hi";

purpose of compiler is to translate code into computer language

assembly things

movl - move long
movq - move quad
call - system call

clc - forcibly turns a carry into a 0

lda - load accumulator - takes from memory puts in register
sta - store accumulator - takes from register puts in memory

Looking at reset.s

clear_oam - clears ram, predictable state jmp _main - go to main

Thoughts:

Next step would be to make another rom, with text in different spots

So I can place two pieces of text, but they are stuck together, find a way to separate them or manage them individually

comporg week 1

January 22, 2019

Microprocessor History

4004: Intel 4004→8008→8085→8086 ——————8088 ——————x86_64 / x86 (amd64)

6502: MOS First commercially successful microprocessor

6800: Motorola

?: Honeywell

Switches Relay Vacuum tube

ROM- read access memory PROM- programmable read access memory EPROM- Erasable programmable read access memory

Use of transistors → solid state Solid State: No moving parts 20nm, 10nm: the closer the transitors, less heat, less resources

ROWHAMMER: bleedthrough memory race condition: place a file before other file

Logic Gates: AND,OR,NOT,NAND,NOR,XOR,XNOR

8-bit 16-bit wordsize

Hertz,Hz: cycles per second

Clock speed: multiplier Bus speed: base

Execution of an instruction Fetch: grab instruction Decode: what was grabbed? Execute: activate decode Store: Save results

CISC: complex instruction set code RISC: Reduced instruction set code

ALU: Arithmetic Logic Unit CU: Control unit RA: Register Array

MOS 6502: Used in Commodore 64, NES 1.79 MHZ

NES Programming: Compiler, Graphics, Sounds, Emulator

CC65 Compiler https://spiro.trikaliotis.net/debian sysprog http://lazyfoo.net/tutorials/SDL/index.php



journal/spring2019/jwilli57/start.txt · Last modified: 2019/01/21 12:06 (external edit)