Jump to content

Photo

[Semi Final] Monkey King (Formerly Climb the tree)


93 replies to this topic

#76 Arenafoot OFFLINE  

Arenafoot

    Stargunner

  • 1,207 posts
  • videogamestores.net
  • Location:Watson, LA

Posted Sat Sep 15, 2018 3:29 PM

 

Major AI overhaul, it now chases after stones and gives you a good challenge. 

I also changed the graphics of the UI a bit. 

 

2 bytes left, I want to add two more if statments, so need to free up space somehow. After that I think that its done.  :)

 

 

 

Oh wow! This version 23 is REAL challenging (for the 1 player game)!!!!



#77 Karl G OFFLINE  

Karl G

    Dragonstomper

  • 535 posts

Posted Sat Sep 15, 2018 3:53 PM

 

Major AI overhaul, it now chases after stones and gives you a good challenge. 

I also changed the graphics of the UI a bit. 

 

2 bytes left, I want to add two more if statments, so need to free up space somehow. After that I think that its done.  :)

 

It will only gain you a few bytes, but putting initializations of variables to the same value on the same line will save a little bit.  So, e.g.:

 

 _invisible0 = 0
 _invisible1 = 0


Should be:


 _invisible0 = 0 : _invisible1 = 0


#78 Impaler_26 OFFLINE  

Impaler_26

    Cookie Meister

  • 2,649 posts
  • Braindead
  • Location:Hueco Mundo

Posted Sat Sep 15, 2018 4:25 PM

 

Major AI overhaul, it now chases after stones and gives you a good challenge. 

I also changed the graphics of the UI a bit. 

 

2 bytes left, I want to add two more if statments, so need to free up space somehow. After that I think that its done.  :)

 

 

I just played v0.23 a bit and the AI is really challenging now. An old bug returned - the game speed doesn't reset after game over. When you start a new game it starts at high speed.



#79 Arenafoot OFFLINE  

Arenafoot

    Stargunner

  • 1,207 posts
  • videogamestores.net
  • Location:Watson, LA

Posted Sat Sep 15, 2018 4:30 PM

 

An old bug returned - the game speed doesn't reset after game over. When you start a new game it starts at high speed.

I didn't see that happen on mine.....it reset on the next game.



#80 fluxit OFFLINE  

fluxit

    Chopper Commander

  • 118 posts

Posted Sat Sep 15, 2018 7:17 PM

A way to provoke the bug is to use enough low speed powerups to flip the speed to 'hi.'  Games from from that point on will start at a hi speed.


Edited by fluxit, Sat Sep 15, 2018 7:17 PM.


#81 Impaler_26 OFFLINE  

Impaler_26

    Cookie Meister

  • 2,649 posts
  • Braindead
  • Location:Hueco Mundo

Posted Sun Sep 16, 2018 2:27 AM

I didn't see that happen on mine.....it reset on the next game.

 

The bug only happens once you reach high speed (around 200+ points).



#82 Coolcrab OFFLINE  

Coolcrab

    Moonsweeper

  • Topic Starter
  • 371 posts
  • Location:Stockholm

Posted Sun Sep 16, 2018 2:31 AM

All bugs fixed! I managed to make the framerate stable by changing the pfread to a playfieldpos check and using it at playfieldpos=1. This shifted the top block creation to playfieldpos 1 instead of 0 and for some reason that fixed everything. I think that that is a good reason to stop touching it and just tweak some starting numbers. (Unless more bugs are found of course!) I'm quite happy with the game in this state. :)

 

I also added an option to play vs the old AI (non moving one) by flipping the B/W switch. See it as a practice mode. 

 

Oh wow! This version 23 is REAL challenging (for the 1 player game)!!!!

Glad you like it. I think that the AI is quite cool no. 

 

 

 

It will only gain you a few bytes, but putting initializations of variables to the same value on the same line will save a little bit.  So, e.g.:

 

 _invisible0 = 0
 _invisible1 = 0


Should be:


 _invisible0 = 0 : _invisible1 = 0

 

I tried some of that and removed 2 pfchecks which gave me a lot. They are super heavy commands!

 

 

I just played v0.23 a bit and the AI is really challenging now. An old bug returned - the game speed doesn't reset after game over. When you start a new game it starts at high speed.

Glad you like it! Bug is fixed in v24



#83 Impaler_26 OFFLINE  

Impaler_26

    Cookie Meister

  • 2,649 posts
  • Braindead
  • Location:Hueco Mundo

Posted Sun Sep 16, 2018 6:18 AM

All bugs fixed! I managed to make the framerate stable by changing the pfread to a playfieldpos check and using it at playfieldpos=1. This shifted the top block creation to playfieldpos 1 instead of 0 and for some reason that fixed everything. I think that that is a good reason to stop touching it and just tweak some starting numbers. (Unless more bugs are found of course!) I'm quite happy with the game in this state. :)

 

 

The gamespeed works correctly now, will play some more later to check everything.

 

You probably don't need it anymore but you could save 7 bytes by drawing the playfield directly with playfield variables:

 
var1 = %00000001 : var2 = %00000001 : var5 = %00000001 : var6 = %00000001 : var9 = %00000001 : var10 = %00000001 : var13 = %00000001
var14 = %00000001 : var17 = %00000001 : var18 = %00000001 : var21 = %00000001 : var22 = %00000001 : var25 = %00000001 : var26 = %00000001
var29 = %00000001 : var30 = %00000001 : var33 = %00000001 : var34 = %00000001 : var37 = %00000001 : var38 = %00000001 : var41 = %00000001 : var42 = %00000001

http://www.randomter....html#playfield

 

 

 

 



#84 Coolcrab OFFLINE  

Coolcrab

    Moonsweeper

  • Topic Starter
  • 371 posts
  • Location:Stockholm

Posted Sun Sep 16, 2018 6:55 AM

 

The gamespeed works correctly now, will play some more later to check everything.

 

You probably don't need it anymore but you could save 7 bytes by drawing the playfield directly with playfield variables:

 
var1 = %00000001 : var2 = %00000001 : var5 = %00000001 : var6 = %00000001 : var9 = %00000001 : var10 = %00000001 : var13 = %00000001
var14 = %00000001 : var17 = %00000001 : var18 = %00000001 : var21 = %00000001 : var22 = %00000001 : var25 = %00000001 : var26 = %00000001
var29 = %00000001 : var30 = %00000001 : var33 = %00000001 : var34 = %00000001 : var37 = %00000001 : var38 = %00000001 : var41 = %00000001 : var42 = %00000001

http://www.randomter....html#playfield

 

 

 

 

Do you put that into the playfield enviroment or outside? It gives me errors. However I just tried pfvlines and that freed a lot up, got 43 now. 

 

 pfvline 8 0 10 on
 pfvline 24 0 10 on
 
I'm almost sad, it feels like I should fill it. :P


#85 Impaler_26 OFFLINE  

Impaler_26

    Cookie Meister

  • 2,649 posts
  • Braindead
  • Location:Hueco Mundo

Posted Sun Sep 16, 2018 7:51 AM

 

Do you put that into the playfield enviroment or outside? It gives me errors. However I just tried pfvlines and that freed a lot up, got 43 now. 

 

 pfvline 8 0 10 on
 pfvline 24 0 10 on
 
I'm almost sad, it feels like I should fill it. :P

 

 

You use the variables instead of the playfield - delete the playfield and paste the code from my post where your playfield was.

 

D'OH! I forgot about pfvline, that works even better for straight line playfields like yours. :D



#86 fluxit OFFLINE  

fluxit

    Chopper Commander

  • 118 posts

Posted Sun Sep 16, 2018 5:32 PM

The AI is quite aggressive, which is fun.  Where before I would take the occasional coconut to the face in order to save 'player 2,' I've now seen it bang right through a coconut, beating me to the stone.  It can be challenging at times to actually collect that third stone to replenish your life while the AI is active.



#87 Coolcrab OFFLINE  

Coolcrab

    Moonsweeper

  • Topic Starter
  • 371 posts
  • Location:Stockholm

Posted Sun Sep 16, 2018 11:51 PM

The AI is quite aggressive, which is fun.  Where before I would take the occasional coconut to the face in order to save 'player 2,' I've now seen it bang right through a coconut, beating me to the stone.  It can be challenging at times to actually collect that third stone to replenish your life while the AI is active.

I'm glad that you like it. Is the behaviour good you think? I could make it keep going for stones even after getting 3, but that seemed a bit much. 

 

Got some space left though so open for suggestions.



#88 Muddyfunster ONLINE  

Muddyfunster

    Chopper Commander

  • 118 posts

Posted Mon Sep 17, 2018 5:51 PM

 

 

It will only gain you a few bytes, but putting initializations of variables to the same value on the same line will save a little bit.  So, e.g.:

 

 _invisible0 = 0
 _invisible1 = 0


Should be:


 _invisible0 = 0 : _invisible1 = 0

 

I didn't know that tip, that's helpful, thanks Karl G.



#89 Coolcrab OFFLINE  

Coolcrab

    Moonsweeper

  • Topic Starter
  • 371 posts
  • Location:Stockholm

Posted Sat Sep 29, 2018 9:40 AM

New version up.

 

Feedback welcome!



#90 fluxit OFFLINE  

fluxit

    Chopper Commander

  • 118 posts

Posted Mon Oct 1, 2018 3:45 PM

The 10,000s digit on one of the scores has a '1' in it at boot.  This is seen in MAME and Stella. 

 

The AI can kick my butt at speed now if I don't use 'add branch' to kill it off.  I let it play out after a silly death on my part, and it reached a high score of 7155.



#91 cimmerian OFFLINE  

cimmerian

    Moonsweeper

  • 281 posts
  • Location:Vancouver Canada

Posted Wed Oct 17, 2018 2:52 PM

We'll be featuring the NEW FINAL UNRELEASED version Monkey King LIVE on today's ZeroPage Homebrew stream on Twitch at 6PM PT/9PM ET! We'll also be playing the boxed version of Zippy the Porcupine!

Twitch Stream: https://www.twitch.t...ropagehomebrew/

Games Today:

- Alien Attack (2018) by Edward Smith (easmith)
- Alien Revenge (2018) by Edward Smith (easmith)
- Monkey King (FINAL) (2018) by Alex Pietrow (coolcrab)
- Zippy The Porcupine by (2015) by Chris Spry (Sprybug)

 

20181017-Let's Play.jpg



#92 Coolcrab OFFLINE  

Coolcrab

    Moonsweeper

  • Topic Starter
  • 371 posts
  • Location:Stockholm

Posted Thu Oct 18, 2018 1:06 AM

Big Update! Added new powerup and fixed the framerate. However there seem to be sound glitches. :( 

I'll work on those when I'm back from travel. 

 

New manual also up in main thread!



#93 bogax OFFLINE  

bogax

    Dragonstomper

  • 777 posts

Posted Sun Oct 21, 2018 10:56 AM

 The code wont compile (missing goto's)
 
 The invicible icon in score_graphics.asm is different than shown 
 
 You don't need pfvline here it's already in the branch clearing stuff
 
 
 ; pfvline 8 0 11 on
 ; pfvline 24 0 11 on
 
 gosub clearP0left
 gosub clearP0right
 gosub __sprite_color : drawscreen
 gosub clearP1left
 gosub clearP1right
 
 you don't need all these joy0fire clauses in the if statements
 you already tested that in the first if statement
 
 ; power up activation
 if !joy0fire then __skipfire
 ; if joy0fire && player0score > $0 then gosub __firesound
 ; if joy0fire && player0score = $a then gosub __slowdown : player0score = $0 
 ; if joy0fire && player0score = $b then gosub __killbranch1
 ; if joy0fire && player0score = $c then gosub __livesplus1
 ; if joy0fire && player0score = $d then player0score = $0 : _invisible0 = 1
 ; if joy0fire && player0score = $e then player0score = $0 : gosub __mkbranch1
 ; if joy0fire && player0score = $f then player0score = $0 : _invincible = 25 : _left_right{6} = 1 : _F0 = 25
 
 if player0score > $0 then gosub __firesound
 if player0score = $a then gosub __slowdown : player0score = $0 
 if player0score = $b then gosub __killbranch1
 if player0score = $c then gosub __livesplus1
 if player0score = $d then player0score = $0 : _invisible0 = 1
 if player0score = $e then player0score = $0 : gosub __mkbranch1
 if player0score = $f then player0score = $0 : _invincible = 25 : _left_right{6} = 1 : _F0 = 25
 
 You can flatten the killbranch routines a little (but you still need the labels for the individual routines
 since you're calling them to setup the playfield)
 
killbranch1
   player0score = $0 : bally = 100
   gosub sprite_color
   if left_right{4} then clearP0left
clearP0right  var1 = 1 : var5 = 1 : var9 = 1 : var13 = 1 : var17 = 1 : var21 = 1 : var25 = 1 : var29 = 1 : var33 = 1 : var37 = 1 : var41 = 1 : var45 = 1 : return
clearP0left   var0 = 0 : var4 = 0 : var8 = 0 : var12 = 0 : var16 = 0 : var20 = 0 : var24 = 0 : var28 = 0 : var32 = 0 : var36 = 0 : var40 = 0 : var44 = 0 : return
 
 Since you allways call the sprite_color routine before drawscreen you can move drawscreen into sprite_color and get rid of a bunch of calls to drawscreen
 and you can do it with a tail call optimization (you need the prepended dot because that's what bB assumes
 ie "goto drawscreen" becomes "jmp .drawscreen" so you need to declare .drawscreen)
 
   if startgame then sprite_color_return
   ;Check if player is invisible
   if invisible0 then invisible0 = invisible0 + 1 : COLUP1 = $C4
   if invisible0 = 200 then invisible0 = 0
 
   if invisible1 then invisible1 = invisible1 + 1 : COLUP0 = $C4
   if invisible1 = 200 then invisible1 = 0
 
 
 
   const .drawscreen = drawscreen
 
sprite_color_return
 
    goto drawscreen
 
 I think you're calling drawscreen a lot more than you need to
 
 
 Since your pfreads are with constants, just use the screen variables
 
  ; if pfread(9,1) then return
  ; if pfread(25,1) then return
 
  if var5{1} || var7{1} then return

Edited by bogax, Sun Oct 21, 2018 11:00 AM.


#94 Coolcrab OFFLINE  

Coolcrab

    Moonsweeper

  • Topic Starter
  • 371 posts
  • Location:Stockholm

Posted Sun Oct 21, 2018 3:57 PM

 

 The code wont compile (missing goto's)
 
 The invicible icon in score_graphics.asm is different than shown 
 
 You don't need pfvline here it's already in the branch clearing stuff
 
 
 ; pfvline 8 0 11 on
 ; pfvline 24 0 11 on
 
 gosub clearP0left
 gosub clearP0right
 gosub __sprite_color : drawscreen
 gosub clearP1left
 gosub clearP1right
 
 you don't need all these joy0fire clauses in the if statements
 you already tested that in the first if statement
 
 ; power up activation
 if !joy0fire then __skipfire
 ; if joy0fire && player0score > $0 then gosub __firesound
 ; if joy0fire && player0score = $a then gosub __slowdown : player0score = $0 
 ; if joy0fire && player0score = $b then gosub __killbranch1
 ; if joy0fire && player0score = $c then gosub __livesplus1
 ; if joy0fire && player0score = $d then player0score = $0 : _invisible0 = 1
 ; if joy0fire && player0score = $e then player0score = $0 : gosub __mkbranch1
 ; if joy0fire && player0score = $f then player0score = $0 : _invincible = 25 : _left_right{6} = 1 : _F0 = 25
 
 if player0score > $0 then gosub __firesound
 if player0score = $a then gosub __slowdown : player0score = $0 
 if player0score = $b then gosub __killbranch1
 if player0score = $c then gosub __livesplus1
 if player0score = $d then player0score = $0 : _invisible0 = 1
 if player0score = $e then player0score = $0 : gosub __mkbranch1
 if player0score = $f then player0score = $0 : _invincible = 25 : _left_right{6} = 1 : _F0 = 25
 
 You can flatten the killbranch routines a little (but you still need the labels for the individual routines
 since you're calling them to setup the playfield)
 
killbranch1
   player0score = $0 : bally = 100
   gosub sprite_color
   if left_right{4} then clearP0left
clearP0right  var1 = 1 : var5 = 1 : var9 = 1 : var13 = 1 : var17 = 1 : var21 = 1 : var25 = 1 : var29 = 1 : var33 = 1 : var37 = 1 : var41 = 1 : var45 = 1 : return
clearP0left   var0 = 0 : var4 = 0 : var8 = 0 : var12 = 0 : var16 = 0 : var20 = 0 : var24 = 0 : var28 = 0 : var32 = 0 : var36 = 0 : var40 = 0 : var44 = 0 : return
 
 Since you allways call the sprite_color routine before drawscreen you can move drawscreen into sprite_color and get rid of a bunch of calls to drawscreen
 and you can do it with a tail call optimization (you need the prepended dot because that's what bB assumes
 ie "goto drawscreen" becomes "jmp .drawscreen" so you need to declare .drawscreen)
 
   if startgame then sprite_color_return
   ;Check if player is invisible
   if invisible0 then invisible0 = invisible0 + 1 : COLUP1 = $C4
   if invisible0 = 200 then invisible0 = 0
 
   if invisible1 then invisible1 = invisible1 + 1 : COLUP0 = $C4
   if invisible1 = 200 then invisible1 = 0
 
 
 
   const .drawscreen = drawscreen
 
sprite_color_return
 
    goto drawscreen
 
 I think you're calling drawscreen a lot more than you need to
 
 
 Since your pfreads are with constants, just use the screen variables
 
  ; if pfread(9,1) then return
  ; if pfread(25,1) then return
 
  if var5{1} || var7{1} then return

 

 

Strange it worked when I uploaded it, but I was in a rush so maybe I messed up :S I'm stuck on a mountaintop on a island until the end of the month (looking at the Sun, or trying at least), but maybe I can get bB to work on my Mac. All my saves are on my home PC though, so I can't access them. I'm hoping that its just the .asm files that are wrong. I'll get back to you asap. 

 

Thanks for the upgrades also, this should shave off quite some bits again. :)






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users