It is currently Sun Dec 16, 2018 5:49 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 166 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11, 12  Next
Author Message
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Sun Dec 17, 2017 6:23 pm 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 123
Damn, Kasumi...you might be right :)

-Thom


Top
 Profile  
 
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Sun Dec 17, 2017 7:30 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20886
Location: NE Indiana, USA (NTSC)
What I tend to do is take the next major task and then repeat the following iteration:

1. Find the first task on the list that I expect to take longer than 15 minutes.
2. If one exists, divide it up into smaller tasks.
3. If a task was split, and there are fewer than 12 tasks, go to step 1.


Top
 Profile  
 
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Sun Dec 17, 2017 9:23 pm 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 123
if I could, I'd hug you guys. :) Thanks.

-Thom


Top
 Profile  
 
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Sun Jan 14, 2018 5:39 pm 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 123
Am back on WoW, have been so busy lately, and health issues caused me to have to take a break.

Right now, I am refactoring the code, and splitting bits out into seperate files.

In the main .h, I have a set of variables defined in my zeropage bss segment. The problem seems to be when I try to use them in other files. It seems:

Code:
#pragma bssseg (push,"ZEROPAGE")
extern unsigned char spr,i,frame_cnt;
#pragma bssseg (pop)


Produces an address mismatch:
Code:
ld65.exe: Warning: Address size mismatch for `_frame_cnt': Exported from wow.o, wow.s(25) as `zeropage', import in attract_monsters.o, attract_monsters.s(31) as `absolute'
ld65.exe: Warning: Address size mismatch for `_i': Exported from wow.o, wow.s(18) as `zeropage', import in attract_monsters.o, attract_monsters.s(30) as `absolute'
ld65.exe: Warning: Address size mismatch for `_spr': Exported from wow.o, wow.s(24) as `zeropage', import in attract_monsters.o, attract_monsters.s(29) as `absolute'


For some reason, it's ignoring my #pragma and using .import instead of .importzp :/ wtf? I know I'm doing something silly...

What's going on?

-Thom


Top
 Profile  
 
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Sun Jan 14, 2018 5:49 pm 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 123
err, turns out I literally had to do this:

Code:
extern unsigned char spr;
#pragma zpsym("spr")
extern unsigned char i;
#pragma zpsym("i")
extern unsigned char frame_cnt;
#pragma zpsym("frame_cnt")


Which is....really fucking awkward...but okay.

-Thom


Top
 Profile  
 
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Sun Jan 21, 2018 12:08 pm 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 123
Enough refactoring was done that I was able to start work on shooting the lasers for the player.

The logic has become quite complex, ensuring that all possible states are being taken care of (there are still a few stray state leaks that I need to plug up), resulting in very dense blocks of ternary conditionals...I will try to document these once they've stabilized.

I am currently using yellow's score to track his states (player left idle, player left, player left shooting, player left shooting idle, etc.), as well as his previous state, and whether the shooting latch is active.

There are still a ton of bugs, and I am working through them, but for now:

Image

-Thom


Top
 Profile  
 
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Fri Jan 26, 2018 10:43 pm 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 123
First pass of player shooting implemented, now implementing monster shooting.

Image

Latest binary here:
Attachment:
wow.nes [40.02 KiB]
Downloaded 88 times


Top
 Profile  
 
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Sat Jan 27, 2018 12:04 pm 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 123
I've now implemented the first pass of monster shooting.

Image

I initially tried to be somewhat smart about monster shooting; only shooting if the monster sees a worrior in its field of vision. This wound up taking up too many cycles, slowing down the entire game, even if all I was doing was checking for the same X or Y box through wall boundaries, especially since I didn't want them to shoot continuously....so the implementation I wound up using was far more naive:

Code:
void monster_shoot(void)
{
  // This is holy shit naive. The previous naive implementation took too much CPU time.
  if (rand8()>0xC0)
    {
      if (((rand8())<0x08) && lasers[LASER_SHOOTING(i)]==0 && monster_laser_count<4)
        {
          monster_laser_fire(i);
        }
    }

  if (lasers[LASER_SHOOTING(i)]==1)
    {
      get_current_laser_box();
      if (lasers[LASER_DIRECTION(i)]==STATE_MONSTER_RIGHT)
        {
          if (BOX_WALL_RIGHT(h) && lasers[LASER_X(i)]==PIXEL_BOX_X(e))
            monster_laser_stop(i);
          else
            lasers[LASER_X(i)]+=4;
        }
      else if (lasers[LASER_DIRECTION(i)]==STATE_MONSTER_LEFT)
        {
          if (BOX_WALL_LEFT(h) && lasers[LASER_X(i)]==PIXEL_BOX_X(e))
            monster_laser_stop(i);
          else
            lasers[LASER_X(i)]-=4;
        }
      else if (lasers[LASER_DIRECTION(i)]==STATE_MONSTER_DOWN)
        {
          if (BOX_WALL_DOWN(h) && lasers[LASER_Y(i)]==PIXEL_BOX_Y(f))
            monster_laser_stop(i);
          else
            lasers[LASER_Y(i)]+=4;
        }
      else if (lasers[LASER_DIRECTION(i)]==STATE_MONSTER_UP)
        {
          if (BOX_WALL_UP(h) && lasers[LASER_Y(i)]==PIXEL_BOX_Y(f))
            monster_laser_stop(i);
          else
            lasers[LASER_Y(i)]-=4;
        }
    }
}


I will definitely have to be careful with the blue worrior auto-move implementation (when playing 1 player), as it's clear that I am low on non-NMI cycles.

Latest ROM here:
Attachment:
wow-monsters-shooting.nes [40.02 KiB]
Downloaded 83 times


Top
 Profile  
 
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Sat Jan 27, 2018 12:16 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7833
Location: Seattle
I'm curious about how you were losing so many cycles on just a bounds check ... maybe memory pointers ?


Top
 Profile  
 
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Sat Jan 27, 2018 12:44 pm 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 123
lidnariq wrote:
I'm curious about how you were losing so many cycles on just a bounds check ... maybe memory pointers ?


I will revisit that later. I'm guessing that sometime soon I will need to do some significant code optimization. If you want to see where things are @ this point, the code as always is in github: http://github.com/tschak909/wow

Now i'm deliberating on whether to implement blue worrior ai logic or to implement the kill logic first.

-Thom


Top
 Profile  
 
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Sat Jan 27, 2018 7:41 pm 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 123
Initial pass of Worrior AI logic implemented. However, I need to figure out why the blue worrior's laser isn't showing...

-Thom


Top
 Profile  
 
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Sat Jan 27, 2018 8:18 pm 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 123
My 4yo daughter Nina helping me debug Wizard of Wor.

:)

-Thom


Attachments:
7GAe6zE.jpg
7GAe6zE.jpg [ 1 MiB | Viewed 2101 times ]
Top
 Profile  
 
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Sat Jan 27, 2018 11:41 pm 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 123
Ok, so first pass of blue AI is implemented. It's very naive at the moment, it simply picks a monster and starts walking toward it, shooting intermittently.

There was an odd situation where update_lasers() was short circuiting an over eager check to see if a laser should update, which was causing blue worrior's laser to not be visible. Fixed...

The random number seed is currently reset every 5 seconds and the player X position is used, to try and randomize player positions.

Currently, since no kill logic is implemented, once the blue worrior catches up to his enemy, he simply keeps chasing it, close behind, shooting intermittently.

Once kill logic is implemented, I will alter this to try and shoot any monster in path while traversing toward enemy...

There is also a very occasional intermittent slowdown when multiple lasers are visible from enemies...need to start optimizing soon.

And yes, I know, some sprite priority issues. I need to actually work on a sprite scheduler, as I don't think I have the bandwidth to put the phasors into vram updates.

Image

Latest ROM attached:
Attachment:
wow-blue-ai.nes [40.02 KiB]
Downloaded 87 times


-Thom


Top
 Profile  
 
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Sun Jan 28, 2018 2:17 pm 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 123
I've just drawn the explosion sprites. Am now implementing kill/explode logic:
Image

I'm also fast running out of CHR ROM. ;)

Image

-Thom


Top
 Profile  
 
 Post subject: Re: WIP: Wizard of Wor
PostPosted: Sun Jan 28, 2018 11:08 pm 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 123
Ok, major milestone, player to monster laser collisions implemented, along with explosions, monster death, and points.

Image

Still some weird little sprite bugs that I need to track down there, as well. I'm having to tiptoe very well to make sure I don't run out of cycles doing e.g. bounding box comparisons, but it seems to be working ok, so far...

I'm happy this is starting to resemble a game.

Latest ROM build attached, and as always, code is available on github in the original post.
Attachment:
wow-monster-splosions.nes [40.02 KiB]
Downloaded 85 times


Moving onward.
-Thom


Last edited by tschak909 on Wed Jan 31, 2018 7:08 am, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 166 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11, 12  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group