Jump to content

Coolcrab

Members
  • Posts

    427
  • Joined

  • Last visited

Posts posted by Coolcrab

  1. 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.

  2.  

    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.randomterrain.com/atari-2600-memories-batari-basic-commands.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
    • Like 1
  3. 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

    • Like 1
  4. How about this?

     

    Found 4 bytes.

     

    Made 1 drawscreen. Found 41 bytes.

     

    Is the sound broken now?

    Sound seems fine, but there is a graphics glitch now that appears when there is a gosub tree that goes more than 2 levels (it corrupts the memory apparently)

    The scanline problem is still there though. (it drives me crazy!)

     

    I'll compare the two programs for the space though, it amazes me how you squeeze so much out. :P

  5. 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. :)




    • Like 2
  6. 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. :)

     

     

    • Like 1
  7. Sorry I cant help with AI.

    Everything but game logic.

    Sound, music, samples, graphics, color, layout...

     

    I started with bB DPC+ kernel so I know that better than the standard kernel options.

     

    I can optimize even if I dont understand the code.

     

    The smartbranching will add back in a goto if it cant branch for free, but some dropped goto commands get missed even by smartbranching on and will error on compile, thats why I said it is best to write code using them, and then to remove and test compile later.

     

    That and the put as many things=(same value) on one line using : between them, are 2 large optimizations, even though it makes the code harder to read.

     

    I dont know about writing a compiler, but if I were to add a compile pass it would be to look for seperate defines to the same value and combine because it compiles like this:

     

    player1x=0

    player0x=0

    AUDV0=0

    AUDV1=0

    _apple=0

    _anything=0

     

    Compiles To (load / store):

     

    lda 0

    sta player1x

    lda 0

    sta player0x

    lda 0

    sta AUDV0

    lda 0

    sta AUDV1

    lda 0

    sta _apple

    lda 0

    sta _anything

     

    When:

     

    player1x=0: player0x=0: AUDV0=0: AUDV1=0: _apple=0: _anything=0

     

    compiles to (one load / store):

     

    lda 0

    sta player1x

    sta player0x

    sta AUDV0

    sta AUDV1

    sta _apple

    sta _anything

     

    So thats where you get ROM back by writing it differently.

    I tried some of that but im low on memory now. WOuld really be happy with a few more bytes. Want to add 2 more ifs.

    Could you take a look?

     

    EDIT: I found 22b and added them in. However the original error of this thread is back T_T

    The AI does too much I think and it just eats frames, but only when new branches are made. So a smartly placed drawscreen somewhere might fix it. If anyone sees it please tell me!

    MonkeyKing0.23.bas

    score_graphics.asm

    playerscores.asm

  8. I am trying to update the AI to be more livelike. It moves up and down to chase stones, but it seems to not always see the branches. (I think that the scroll might have to do with it?) I also tried to make it stop moving down if there is something below its butt.

    It would be cool if someone could take a look at this.

     

    slightly more commented version

    __AI
     if _invisible0 then goto __skipAIball ; he does ! work when invisible
     if !(rand & 127) then goto __skipAIball ;AI makes mistakes
    
     temp1 = (player1x - 14) / 4
     temp2 = (player1y  -1 ) / 8 
     temp3 = player1y - bally
     temp4 = %00000000
     temp5 = (player1y  + 1 ) / 8 
    
    
     if player1score = $c && bally < player1y then gosub __killbranch2 : gosub __firesound
     if player1score = $d then gosub __livesplus2 
    
     if pfread(temp1, temp2) then _left_right = _left_right ^ 32 : __skipAIball ;make AI dodge branch if any above him
     if pfread(temp1, temp5) then temp5 = 0 ; see if branch below him
    
     ; Chace missile
     if missile1y < player1y && player1y > 10 then player1y = player1y - 1 else  if player1y < 82 && temp5 then player1y = player1y + 1
    
     ; dodge coconut (broken)
     if ballx = player1x + 3 && temp3 < 30 then temp4{0} = 1 ;only dodge if coconut is there
     if !pfread(temp1,temp2) then temp4{1} = 1 ; see if nothing above
     ;if !pfread(temp1,temp2) then temp4{2} = 1 
     if !pfread(temp1,temp5) then temp4{2} = 1 ; see if its next to him
     ;if !pfread(25,9) then temp4{4} = 1 
    
     if temp4 = %00000111 then _left_right = _left_right ^ 32 ; dodge if possible
    
    
    __skipAIball
    __skipAI
    

    MonkeyKing0.23.bas

  9. You can try using smartbranching and see if it helps with saving bytes for "if - then - goto" statements:

     

    http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#smartbranching

    I went through all the goto's (got about 3 more out) and now have a staggering 90b left. THis is a good idea though.

     

    Wow.

    Save very often.

    Sometimes a file will compile, and then it will not due to some "invisible text character".

     

    For instance, I was getting an error at the " = q " which was written okay.

    Some return character or other before or after that was not letting it compile.

    That's what I mean by "invisible text character".

    As soon as I commented that out and retyped the exact same thing, it compiled.

     

    It's hard explaining something that doesn't seem to make sense! :)

    I've never ad that issue yet. (fingers crossed) Very odd though.

    Also do you have any tips on my AI btw? Trying to invest the new bytes into that, but if I add much more pfchecks It needs draw screens again.

     

    I added a 'if missile1 < player1y then player1y = player1y - 1' then I added a y and rewrote the pf pixels to read on the AI's level. Hoewever, he only looks above him now so if he goes down he hits everything. =/ I think that it would be awesome if he had this behaviour bit IDK if its doable. (Replace the AI with this to have a look at what I mean)

     ; AI controll
     if !switchleftb then __AI
     goto __skipAI
    
    __AI
     if _invisible0 then goto __skipAIball ; he does ! work when invisible
     if !(rand & 127) then goto __skipAIball 
    
     temp1 = (player1x - 14) / 4
     temp2 = (player1y ) / 8
     temp3 = player1y - bally
     temp4 = %00000000
    
    
     if player1score = $c && bally < player1y then gosub __killbranch2 : gosub __firesound
     if player1score = $d then gosub __livesplus2 
    
     if missile1y < player1y && player1y > 10 then player1y = player1y - 1 else  if missile1y > player1y && player1y < 82 then player1y = player1y + 1
    
     if pfread(temp1, temp2) then _left_right = _left_right ^ 32 : __skipAIball
     if ballx = player1x + 3 && temp3 < 30 then temp4{0} = 1 
     if !pfread(23,10) then temp4{1} = 1 
     if !pfread(25,10) then temp4{2} = 1 
     if !pfread(23,9) then temp4{3} = 1 
     if !pfread(25,9) then temp4{4} = 1 
    
     if temp4 = %00011111 then _left_right = _left_right ^ 32 	
    
    
    __skipAIball
    __skipAI
    
  10. It depends on the way old PAL TVs processed the color information. Modern LCDs probably don't show this effect at all.

    Modern tv's lose sync if you use HDMI. So I really need to kill that glitch. Trying to narrow it down but no luck yet.

     

    This is about 64 bytes returned, by re-arranging, and dropping "goto" (in "if then goto" IF "goto label" is close).

    Really you need to code "If - then - goto" and then remove the goto and recompile and see if it gives a savings or errors.

    If it errors, you need to add the "goto" back.

    If it saves bytes, you don't need the "goto".

     

    Technically assembly can jump to a label "free" if it is within 128 bytes of the "if statement".

    Usually goto jumps to the label over "collision detections" is too far away, and it will error.

     

    In the attached code you need to add back my commented out player1scorecolor and add back the "inline xxx.asm" at the end.

     

     

    No way you solved the framerate problem and freed up rom! :o

  11. The framerate is not stable if you set the left difficulty switch to "A" position by pressing F5 (default in Stella is both difficulty set to "B").

     

    Many PAL TVs will display in B/W if there's an odd number of scanlines and that's what you're seeing on your TV (it's the same on my CRT) .

     

    Stella emulates this effect: go to "Options" > "Developer Settings", then select the "Video" tab and enable "PAL color-loss". Since this is an effect that only applies to PAL TVs, you must also tell Stella to run the game in PAL60 mode: you can cycle through the various modes with CTRL+F while playing the rom, or you can set it by selecting "Options" > "Game Properites" and change the "Format" in the "Display" TAB.

     

    Once you do all these three steps (enable PAL color loss, set left difficulty to A and set Format to PAL60), you'll see the game in Stella behave like on your TV.

     

    Aha that helped! odd that its only in PAL though. I think that I narrowed it down to branch creation of destruction. Thanks!

     

    Don't know about your question, however:

     

    this is an invalid bB command:

    player1scorecolor = $fe

     

    add a space after:

    ;dim _startgame = p

     

    Then it compiles for me.

     

    How many bytes does your game have left?

    I see places in your source code that can get you back a lot of ROM if you need it for things.

    That command is from a minikernel (that I didn't add here..oops) You can find it in the MK main thread.

    Where do you see rom space? I would be very happy to have some more. I got ~17b now.

     

    Also, the B&W effect in Stella you screengrabbed is a feature in the debugger. The B&W portion is the previous frame, and the color portion indicates how much of the current frame is drawn, at this particular instant. If you hit the "scan +1" button a few times, the emulation will run for a few more scanlines, and you'll see a few more lines of color.

    Ah thats good to know! I confused that effect with the blinking. But its something else.

  12. Not sure if this is a bug, but you can't combine pfread with anything else in an if. It would be really nice if you could say 'if pfread(x,y) && pfread(z,w) then bla' or combine it with anything else.

     

    It can be solved by adding more if statements but that eats ROM.

    • Like 1
  13. Edit: Something strange is happening with the game now. It goes to 263 scanlines on seemingly random moments but always at playfieldpos = 0 and 3 lines before the top stump and branches are made. It only happens when the AI is being used. It does not seem to have to do with the missiles and coconut. (although the coconut moving up also seems to have glitched the scanlines too, but only if it also happened on this same scanline.) It also only seems to happen when AI is used. So either the AI code makes the loop too long (Which I do not expect, as then it would happen more often and regurarly?) or it does something that causes the slowdown.

     

    I am a bit at a loss here and it would be great if someone could take a look. I left the rest of this topic in tact so that the answers below make sense. Check here for latest upload: http://atariage.com/forums/topic/283009-strange-b-w-effect-in-game/?p=4114107

     

     

    Old topic:

     

    I got a strange error in my game that draws the color slowly every few? frames. The framerate seems to be OK so I am not sure what is wrong and how to google for this error. (Black and white drawing didnt bring up anything.) You don't see it at all in Stella but on real hardware it blinks.

     

    I added a screenshot of the B&W effect and the code.

    post-48701-0-36032800-1537002006_thumb.jpg

    MonkeyKing0.22.bas.bin

    MonkeyKing0.22.bas

  14. I got a strange error in my game that draws the color slowly every few? frames. The framerate seems to be OK so I am not sure what is wrong and how to google for this error. (Black and white drawing didnt bring up anything.) You don't see it at all in Stella but on real hardware it blinks.

     

    I added a screenshot of the B&W effect and the code.

  15. Maybe add game categories. Best platformer, best racer, arcade game, etc.

    Its hard to compare some categories, especially as not everybody likes everything.

     

    I'm not the greatest platformer fan myself, but love multiplayer games and the beat your own score arcade games. This is clearly not the case for many other people here and thats great because all game types get represented. (Apart from sports, nobody seems to be making sports home-brews :P)

  16. New Version is up in the main thread.

     

     

    Greetings!

     

    Just spent some time playing Monkey King. Here are my initial thoughts:

    • Allow fire button to start game, both when you first power up the system and after you've completed a game. If you were having a problem with people restarting the game immediately after ending, add a slight delay before accepting another button press, and/or make sure the button wasn't already depressed when the game ends.
    • The computer player is quite good, too good in fact. Watched him play for a while after I died and he makes very few mistakes. Pretty much the only thing that would kill him is when coconuts was dropped on him, but he'd just get the stones and give himself more lives to keep on going indefinitely.
    • It seems once the speed reaches some maximum, the game does not get any harder. This is allowing the computer to pretty much play indefinitely once you die (if you have the right difficulty set to A), especially as the computer uses the stones to give himself extra lives. Presumably a good human player could do the same thing. I think the difficulty needs to keep ramping up to just short of "impossible". Either the speed can keep going up, or other elements introduced to make it more difficult. Obviously monkeys can only climb so fast, so I'd be for new gameplay elements as you progress up the infinite tree, which would also help make the game more interesting.
    • It would be nice if the branches at the bottom don't just "disappear", but scroll off in the same fashion as the branches from the top of the screen do.
    • Once the game speeds up, I'm not sure it's even possible to get the stones that are between two branches, where there's only one space between them. I noticed the computer doesn't even try for these. :)
    • It would be nice if the tree's graphics could be improved so the trees look more like trees. Same thing with the coconuts and stones. Not sure what is possible in batari Basic, though.
    • I would prefer that the SELECT switch be used to select between single and multiplayer, with some sort of visual indicator on the screen (like showing one or two monkeys). Difficulty switches are a bit of a pain without reading the manual.
    • The computer player does not move up and down like a human player does. Since the human player can always get a bit above the computer player, the human can always get the stones first. Would be nice if that could be added to make it feel more like another player instead of a robotic AI.
    • Maybe change the background color as the difficulty ramps up? Would help add some visual variety.
    • Redefine the score digits so they aren't the stock batari Basic digits?
    I understand the game is 4K now, are you hoping to keep it at 4K? I'm guessing some of this would be difficult to do without going to 8K at a minimum.
    That's all for now. :)
    ..Al

     

    Thanks for the feedback Al!

    1. Firebutton can now be used
    2. AI now makes mistakes every now and then, but still does not move. I'm not sure if there is enough ROM to get that done.
    3. Top speed is now a lot higer, most people testing it seem happy with the new top speed.
    4. This is my main focus now.
    5. If you are fast enough you can get a stone between two branches. The AI ignores them because he does not actively go after stones.
    6. Graphics can't be improved (AFAIK) atleast in 4k.
    7. Not really enough space for this I think. Plus I am going for a more early atari look/feel. So a title screen would not fit well I think.
    8. I tried to make the AI move and it looks either unnatural or he just kills himself. Again space limitations.
    9. I might look into this, but my main problem with this is that the colors would change if players slow down. Which would be strange I think.
    10. Done! Good suggestion.

    I tried to go into 8K with the game, but the way that it is made (with a lot of gosubs) it does not fit into a bankswitch bank. (As gosubs and goto's take more bytes.)

    As far as I understand bank swiched programs (which is not very well I have to admit) I won't get a whole lot of more space for the game itself if I go there, so currently it does not seem to be worth it.

     

     

    I thought I was noticing a difference, but I wasn't sure if it was still ramping up from "top speed" :)

     

    Yeah, I like it. I'm sure that there are those who would say it's still too slow(Tetris masters perhaps.) O_o

     

    As for the ramp up, it does seem a bit abrupt. The original ramp was too gradual, IMO. Something in between would probably be best. As for the slow down, I'm not sure. I don't personally have a problem with the first power up having almost no noticeable impact at max speed, as it's easy enough to pick up two in a row if you wish to slow down. If you can't handle the speed well enough to be able to pick up a couple of power ups before you use up your hearts, you're pretty much done for anyway.

     

    The testing has been fun, and your recommendations have made it even more enjoyable. Thanks for the game. I'll definitely be wanting this on a cart when you're happy with it.

    I'm glad that you like it! I updated the game a bit to iron out all (I hope) errors.

    The game is not far from a final version now.

    • Like 1
  17. New Version is up! Bugs are fixed :) The score glitch was caused but too many gosubs.

     

     

    Yep, the trees keep scrolling when you reach 362 points so that's fixed. It's good that you can start the game with fire now, this should be a standard for all games IMO.

    The speed progression is nice and the max speed is pretty fast. I like that the game gets frantic fast enough to stay challenging and keep players going.

    The climbing sound volume is also nice now, gives a good audio cue of the game speed without being annoying.

     

    Apparently it's not possible to have no more than 3 branches in a row but it's not that important as it doesn't affect the gameplay negatively. With only 3 branches in a row it might even become too easy.

     

    You're aware of the max speed not resetting after game over and the glitch with the score minikernel so these 2 bugs still need to be squished. ;)

    I'm glad that you like it. The bugs are dead. (Now to hope no new ones pop up :P)

    • Like 2
×
×
  • Create New...