+RevEng #651 Posted July 11, 2017 I'm not convince of the general utility of the idea, pretty much for the reasons that SmittyB points out here. If we had enough memory for independent palettes on each character (a mode I've been thinking about lately, for other reasons) then I'd see the merit. But as it is, it's something that's probably best tracked with game-specific code. Quote Share this post Link to post Share on other sites
Synthpopalooza #652 Posted July 12, 2017 (edited) OK, I seem to be stumped again: I can't get my animations right. I am attaching my source code, binary, and the included image files. Problems: #1. The animation seems jerky and not smooth #2. When he faces left, the head is drawn on the bottom facing the wrong direction and the feet are on the top. What have I done wrong? (Save this as level1_tileset.png) ramcharmap3b.bas walking.zip ramcharmap3b.bas.bin Edited July 12, 2017 by Synthpopalooza Quote Share this post Link to post Share on other sites
Synthpopalooza #653 Posted July 12, 2017 Also, the other problem I am having is with the 2nd sprite logic ... it is supposed to home in on the player's character whenever no block is impeding it, but it doesn't always work right. Sometimes the player stands below it and it still doesn't move. Quote Share this post Link to post Share on other sites
+RevEng #654 Posted July 12, 2017 There's 2 things that were messing up the animation. First, you were using a bitwise "&10" to reduce the animation frame to between 0 and 9, but the bitwise & generally only works with powers-of-2, less 1. There's more info here. I converted it to just use an if...then to check the range. Second, you were using "10" as the offset from the right-facing graphics to the left-facing graphics, but this should actually be 20. Your sprite layout is 10x bottom-half right-facing sprites, 10x top-half right-facing sprites, 10x bottom-half left-facing sprites, 10x top-half left-facing sprites. To skip from the first sprite to the first left-facing sprite, you need to bypass both of the right-facing 10x sets. ramcharmap3c.bas 2 Quote Share this post Link to post Share on other sites
Synthpopalooza #655 Posted July 12, 2017 Thanks, that helps alot! I also figured out the tracking logic for the 2nd sprite as well! 2 Quote Share this post Link to post Share on other sites
Synthpopalooza #656 Posted July 13, 2017 (edited) I noticed something weird last night ... I was trying to use the tsound command like this: tsound 0,mytemp+1,8,10 When I put the +1 in there after mytemp it changes the distortion quality of the sound from 8. Should it be doing that? Edited July 13, 2017 by Synthpopalooza Quote Share this post Link to post Share on other sites
+RevEng #657 Posted July 13, 2017 It shouldn't, but it's a result of the addition command in the argument - you can't do math in the middle of a command-argument like that. (In the middle of an if...then, yes. in the middle of command arguments, no) Quote Share this post Link to post Share on other sites
CPUWIZ #658 Posted July 14, 2017 I noticed something weird last night ... I was trying to use the tsound command like this: tsound 0,mytemp+1,8,10 When I put the +1 in there after mytemp it changes the distortion quality of the sound from 8. Should it be doing that? Totally off-topic, but whilst hovering over users in the list (yes, we do that), I noticed that yours is really stale. LOL 1 Quote Share this post Link to post Share on other sites
Synthpopalooza #659 Posted July 17, 2017 Yes ... I did kinda let that slide lol Quote Share this post Link to post Share on other sites
Synthpopalooza #660 Posted July 17, 2017 OK, I think I broke it again ... Attaching the source code ... when I compile, Windows barfs with the error "7800Basic.exe has stopped working" and the compile fails. This is the dump generated by 7800Basic: C:\Users\Coddington\Downloads\7800basic\ramcharmap3d.bas.asm (2063): error: Syntax Error 'plotsp ifnconst bankswitchmode'. Unrecoverable error(s) in pass, aborting assembly! Complete. Cartridge data file must be at least 4K! 7800header 0.7 Jun 6 2017 19:03:32 *** WARNING: The file size of C:\Users\Coddington\Downloads\7800basic\ramcharmap3d.bas.bin isn't correct. Attaching my source plus the images. ramcharmap3d.bas ramcharmap3d.bas.asm images.zip Quote Share this post Link to post Share on other sites
+RevEng #661 Posted July 17, 2017 The main problem was that you used "them" a couple of time instead of "then", in an if...then statement. The interpreter thought it was another variable term, and things went downhill from there. I'll see what I can do about making the error a bit obvious. I've attached the fixed source. ramcharmap3d.bas Quote Share this post Link to post Share on other sites
+frankodragon #662 Posted July 17, 2017 OK, I think I broke it again ... Attaching the source code ... when I compile, Windows barfs with the error "7800Basic.exe has stopped working" and the compile fails. That error also happens if you leave out "then" in an "if...then" statement which sometimes I forget to include. Quote Share this post Link to post Share on other sites
Synthpopalooza #663 Posted July 17, 2017 Well now that makes me feel silly. A stupid syntax error ... So a couple more questions: I am thinking of redoing the game to where the whole screen, besides the top two lines of the display, is used for the playing area. How would I modify the code so that a 40x24 level prints on the whole screen? Also: I found the example of changing the first two char lines to hi-res ... how would I be able to print readable text in the top window? Ideally I would like to be able to use the colors from the second palette (the rocket man colors) in 320B mode. I'm still debating on whether to do this, or stick with 160B on the whole screen ... because I also had an idea that when you lose a man, an explosion happens in the scoring area by your lives counter, which destroys one of your lives. Quote Share this post Link to post Share on other sites
+RevEng #664 Posted July 18, 2017 I am thinking of redoing the game to where the whole screen, besides the top two lines of the display, is used for the playing area. How would I modify the code so that a 40x24 level prints on the whole screen? Ensure the memory you're using for the character buffer (in your case, "screendata") has enough consecutive unused bytes to hold that many characters. To exceed the 7800 object 32-byte limit, you can just plot 2 character maps on the screen, with the second one offset in memory from the other... dim screendataright=screendata+32 plotmap screendata 0 0 0 32 26 plotmap screendataright 0 128 0 40 26 ...you can sidestep that last bit if you use incmapfile+plotmapfile instead, since it can handle character maps bigger than 32-bytes. You'll also need to adjust any peekchar and pokechar commands to use the new width. Also: I found the example of changing the first two char lines to hi-res ... how would I be able to print readable text in the top window? Ideally I would like to be able to use the colors from the second palette (the rocket man colors) in 320B mode. You need to import a font in the graphics mode you want to work in. Otherwise you should be able to follow the example. You need to plan the palette usage a bit if you're going to mix 160 mode graphics with 320B/C/D graphics, due to the restrictions in these modes. Quote Share this post Link to post Share on other sites
Synthpopalooza #665 Posted July 18, 2017 OK, so I tried it ... and it is still not printing on the whole screen. I must be doing something wrong: Source and binary is below. I have the first 32 printing ok, and I am trying to slot the last 8 columns after the first 32. We're in 160B mode, doublewide. ramcharmap3g.bas ramcharmap3g.bas.bin Quote Share this post Link to post Share on other sites
+RevEng #666 Posted July 18, 2017 In my previous example I assumed you were going to split the screen 20+20, instead of 32+8. I've modified the previous example to work with 32+8. You'll need to fix up the dim and the plotmap statements. (or use the attached) Quote Share this post Link to post Share on other sites
Synthpopalooza #667 Posted July 18, 2017 So, I used that ... the right half of the screenmap appears to be ok, but the left side appears jumbled. Quote Share this post Link to post Share on other sites
+RevEng #668 Posted July 18, 2017 Try the attached. I didn't realize you had split the level data up - you don't need to do that. I also used the extra parameters to plotmap, to tell it the level data is bigger than the actual plotted area. I should have advised that earlier. ramcharmap3g.bas Quote Share this post Link to post Share on other sites
Synthpopalooza #669 Posted July 19, 2017 It looks good. Only problem is it is now not detecting characters in the new zone ... my guy starts falling as soon as he walks into the right side of the screen. Quote Share this post Link to post Share on other sites
+RevEng #670 Posted July 19, 2017 Change this... if mytemp1>31 || mytemp2>25 then goto falling to this... if mytemp1>39 || mytemp2>25 then goto falling Change this... if herox>123 then herox=1 if herox<1 then herox=123 to this... if herox>157 then herox=1 if herox<1 then herox=157 it also looks like this code isn't needed, and interferes with traveling off the the larger range... if herodir=0 && herox>120 then herox=118:goto donecheckfall 1 Quote Share this post Link to post Share on other sites
Synthpopalooza #671 Posted July 19, 2017 That last line of code is needed ... tho it will need to be altered. I have the game engine set so that if the man hits a block while flying and he falls, his X position is corrected to the nearest character position. This is so that when two low platforms are together, he can thrust between them and color both platforms. The problem comes with the edges. At the right edge he wraps but it skips the left column altogether. This line of code was meant to correct that. Quote Share this post Link to post Share on other sites
Synthpopalooza #672 Posted July 19, 2017 One last question for today ... I am going to use 160B mode also for a scoring display at the top. I've designed the letters to use the rocketman's palette. To print using this set, do I include the graphic and use a different set of alpha chars every time I go to update the score? Quote Share this post Link to post Share on other sites
+RevEng #673 Posted July 19, 2017 When you want to update the score, you can use the plotvalue command. Other text stuff you can use alphachars and plotchars. For text that doesn't need to change, be sure to plot it prior to using savescreen. That way you don't need to keep plotting the same objects every frame. Quote Share this post Link to post Share on other sites
Synthpopalooza #674 Posted July 21, 2017 OK, so another q ... I would like to use different graphics each level, but all I really want to do is change the block and background graphics each level ... rather than use a whole new incgraphic and redo all the characters, is there anyway I can just do an incgraphic, design only the characters I want to change, and slot in the changed graphics into memory where the current background and block characters are now? I have deliberately placed them at the beginning of the graphics block so that they will be easy to access in this way. Quote Share this post Link to post Share on other sites
+RevEng #675 Posted July 21, 2017 No. The characters are in ROM, so the can't be moved about. You can change the characterset pointer, but that doesn't get around the need to duplicate graphics. Quote Share this post Link to post Share on other sites