Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : PICO PETSCII
Page 9 of 38 | |||||
Author | Message | ||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4246 |
Hi Martin, Not sure if moving the player location on screen is plesing to the eye. You keep the map in location, move the player 8 pix, then another 8 pix, then it would arrive at it's new location with another 8 pix, but you move back the player with 16pix, and additionally scroll the map 24 pix. Would look very "jerky". Currently working on UNITS. That is a massive undertaking. Tipped by Lizby, the doors will be first. And I have to create few more binary files from the PLATFORM_SDL.cpp file. These involve animations. So it may be silent for few days, until I have doors working. Volhout P.S. full tile scroll is the only way to make the game playable on these SPI ILI9341 displays. Pixel scroll is too slow. Edited 2023-09-27 16:41 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1114 |
no, a misunderstanding, The player stays where he is, but the Movement of the Backgroundis split into 3 parts per tile. so if the Player moves one Tile to the right then: -- Paint Player Ani (Layer), Paint new Background x -16 (Screen) Paint next Player Ani (Layer), Paint new Background x -8 (Screen) Paint next Player Ani(Layer), Paint new Background (screen as done before) --- continue as usual if it is to slow on LCD you can use it as If VGA then Paint Player Ani (Layer), Paint new Background x -16 (Screen) Paint next Player Ani (Layer), Paint new Background x -8 (Screen) endif Paint next Player Ani(Layer), Paint new Background so LCD keeps the 24 Pixel- but on VGA it gets an 8 Pixel scrolling Edited 2023-09-27 17:05 by Martin H. 'no comment |
||||
Bleep Guru Joined: 09/01/2022 Location: United KingdomPosts: 509 |
I would say the LCD is updating at about 10Hz though I haven't accurately measured it, so at half tile per update about 5 tiles of movement per second, I don't know how fast the player could move in the original? Does his speed ramp up the longer he's going in one direction? With the LCD now being updated from the second CPU, ~10Hz should be reasonably stable, regardless of other game logic, though there will be variation between different LCDs presumably, depending on there communication speed? Regards Kevin. Edited 2023-09-27 17:55 by Bleep |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1114 |
Kevin, to compare the Speed look at the emulated MSX Version, which is online playable. I'm just noticing that this version seem to scroll 24 pixels/move and doesn't look to bad. By Now, our version runs much faster @252000, so there is headroom for the Game Logic and calculation of the Movement of the robots etc. PS: I've also noticed that the animation of the tiles like water or fans are only played as long as the player is not running. So you only have to worry about it when the player is standing still Edited 2023-09-27 18:36 by Martin H. 'no comment |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1114 |
Next Puzzle Part.. Here the Font for Use in the Game ' C64_PetsciiRobotsFont Martin Herhaus ' Font type : Full (96 Characters) ' Font size : 8x8 pixels ' Memory usage : 768 DefineFont #9 60200808 00000000 00000000 38383838 00380038 8844EEEE 00000000 62FF6200 0062FF62 FEC0F61C 0070DE06 381CEEE6 00CEEE70 7EE0E4FC 00FEE4E4 20103838 00000000 10100804 00040810 08081020 00201008 3C7E1800 0000187E FE383800 00003838 00000000 20103838 7E000000 00000000 00000000 00383800 381C0E06 00C0E070 C6C2C2FE 00FE8686 10101030 007C7C10 FE0202FE 00FEC0C0 FE0404FC 00FE0606 C6C6C0C0 000606FE FE8080FE 00FE0606 FE808CFC 00FE8686 3E0202FE 00303030 FE4C4C7C 00FEC6C6 FE8686FE 00060606 00383800 00003838 00383800 20103838 70381C0E 000E1C38 007E0000 0000007E 0E1C3870 0070381C 3E0ECEFE 00300030 41899576 36494122 FE46467E 00868686 FE8C8CFC 00FE8686 808686FE 00FE8282 C68484FC 00FEC6C6 FE8080FE 00FEC0C0 FEC080FE 00C0C0C0 9E8082FE 00FE8686 FE868686 00868686 1810107E 007E1818 06040404 00FE8686 F8848282 0086868C C0404040 00FEC0C0 8696AEC6 00868686 9EB6E6C6 0086868E 868282FE 00FE8686 FE8282FE 00C0C0C0 C4C4C4FC 00F6CECC FE8C8CFC 00C6C6C6 FEC0C2FE 00FEC202 1818187E 00181818 86868686 00FE8686 86868686 00385C8E 86868686 00C6AE96 7CC2C2C2 00868686 7E464646 00181818 380C06FE 00FEC060 10100804 00040810 3870E0C0 00060E1C 08081020 00201008 38381010 0000006C 00000000 FF000000 FC40623C 00FEE0E0 86FE0000 00F68E86 C2FEC0C0 00FEE2C2 C2FE0000 00FEE2C0 86FE0606 00FE8E86 C2FE0000 00FEE0FE C0C03E00 00E0E0F8 86FE0000 FE0EFE86 C2FEC0C0 00E2E2C2 1838001C 001C1C18 0C0C000C FE8E0E0C 86868080 008E8EFC 18181838 001C1C18 C2FE0000 00EAEACA C2FE0000 00E2E2C2 86FE0000 00FE8E86 C2FE0000 E0E0FEC2 8EFE0000 0E0EFE8E C2FE0000 00E0E0C0 C0FE0000 00FE0EFE C0F8C0C0 00FEE2C0 86860000 00FE8E86 C2C20000 0070E8C4 CACA0000 00FEE2CA 74E20000 008E5C38 86860000 FE0EFE86 06FE0000 00FEE0FE B838383A 003A3838 38383838 00383838 3E3838B8 00B83838 AA55AA55 AA55AA55 B195423C 3C4295B1 End DefineFont If we run out of memory, I have drawn the last 32 characters only for the sake of completeness. So that the font remains universally applicable. They are not needed in the game. Cheers Mart!n 'no comment |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4043 |
Hey guys, I've got the "pet8.bas" example with the "petsciiLCD.bas" addition running under RC4 on a PicoMite with an ILI9341 and I'm getting this when I RUN: Any ideas what stupid mistake I am making ? Best wishes, Tom Edited 2023-09-27 20:51 by thwill Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4043 |
OK, it's caused by the background copy of L to N; I added a PAUSE 100 after that and the problem went away. Now I just have to determine why there is no player sprite. EDIT: It's really very impressive in what has been achieved in such a short time - Well done! Best wishes, Tom Edited 2023-09-27 21:03 by thwill Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1114 |
Thank you Tom, the conversion of the Grafic to Pico took me days, not just hours. I'm not complaining, that went well while watching TV on the side on the laptop The next thing I need to find out is how the weird MOD format (Protracker V2.3A) is structured, what they use. Then find a player that can save it as a standard MOD I can not test the LCD Version by now, so i have no idea, why you dont see the player Sprite but i think Kevin can help you Edited 2023-09-27 21:35 by Martin H. 'no comment |
||||
Bleep Guru Joined: 09/01/2022 Location: United KingdomPosts: 509 |
I'm away pruning patents roses, but if you are using the version I did I don't know, because everything is put onto a layer, including the player, then that layer is copied to the screen in one go, probably need to look at where the player is ploted onto the layer. Regards Kevin Edited 2023-09-27 21:47 by Bleep |
||||
lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3150 |
We observers are looking at the number of days passed, not the (unknown) number of hours spent, and in that context it is very impressive indeed. Tom--exactly where did you put that PAUSE 100? Using pet9.bas I get the walking guy on the LCD. Regarding speed of the LCD version versus the speed of that online MSX version, the LCD is faster. One anomaly that I notice is that if I hold down the left arrow key, the guy disappears for periods, reappearing in the proper place if I release the key or run into an obstacle. I assume this is happening because the screen updating is too fast! Maybe a pause needs to be introduced if the guy is just ambling along (but where). Tom--I notice that if I put PAUSE 50 after FRAMEBUFFER COPY l,n,b, the guy disappears. A request--to accommodate the LCD users, can discrimination code be added, e.g., IF mm.device$="PicoMiteVGA" then MODE 2 ELSE FRAMEBUFFER CREATE F FlagLCD=1 ENDIF (and in the SUB writeworld_m routine--perhaps a flag should be set so that a string compare isn't done for each screen update) ~ Edited 2023-09-27 23:18 by lizby PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1114 |
More Artwork from me Converting the Music to MOD? Done music.zip copy the Music Folder into the Petrobot path Missing the Sound FX .. as this Module was empty.. So I have to put all RAW Sounds into a modfile USE play modfile Filename$ to prelisten. Have fun Martin 'no comment |
||||
lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3150 |
For the LCD version, I moved the FRAMEBUFFER COPY and PAUSE to after writeplayer: if FlagLCD then: FRAMEBUFFER copy l,n,b: Pause 50: endif Now the player always appears when an arrow key is held down, but I've lost the background underfoot (it reappears when guy moves to the next tile). Note that an arrow key (or maybe any key) is needed after RUN to bring something up on the screen. Martin--sorry I can't test your MOD file sounds--no audio output on the PCB I'm using. I hope shortly to get and build one of Tom's game-player PCBs. ~ Edited 2023-09-28 04:20 by lizby PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4246 |
Here is a version where the doors actually open.... and close There is no "key card" check. So all doors act as they where unlocked. For the LCD boys, there are some lines between 110 and 130 that can be commented out Otherwise it would be a very slow door animation. Unzip the file in the folder where you have a working pet8.bas or pet9.bas then run "pet10.bas" pet10.zip The animation is currently blocking (with delays), but will change to a state machine now I know how the mechanism works. Volhout Edited 2023-09-28 05:59 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4246 |
Thanks Martin ! It is good to notice that the largest MOD file is smaller than 128kbyte. This will allow the VGA version to run from the A: drive, with a MODBUFF of 128k. I will look at the music later, amd currently very focussed on the gameplay. Volhout PicomiteVGA PETSCII ROBOTS |
||||
lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3150 |
Pet10 on LCD: Beautiful work. One anomaly I noticed--sometimes doors open if the guy walks past them or even away from them. I did not comment out the lines between 110 and 130, and saw neither slowness nor any animation (other than the doors being instantly open). (Hmm--the reason for that was that I wasn't copying the first two steps to the LCD (since I'm doing the copy after writeplayer in the main do loop). When I put the FRAMEBUFFER COPY after those statements on which you left the comment that they should be removed, I saw the animation--and it was very fast--no interruption in gameplay feel--but the guy disappeared, so writeplayer needed to be included as well. There's still something not quite write about how I'm doing it, but there's no reason for this animation not to be part of LCD play.) It's still the case that for me on the LCD, the tile background under the guy is black. The appropriate background appears when he moves to another tile. Any idea why that may be? PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1114 |
Volhout, that is totaly fine for me. This shouldn't be pushing either. The point is to provide you and anyone else involved in the programming with everything, so that you have it at hand when you need it. Don't worry, there won't be any new artwork today. I'm having a long day today and I don't know if I'll have the time or mood to work on the samples this evening. I won't be able to test your PET10 version before. I'm really pleased to see how the program is progressing.I was also very reassured that the modules still fit in the memory.If they had been too big I would have had to start replacing the samples. The last time I worked with MOD files was in the early 90s.We can only hope that the handling of the Tracker has somehow remained in my memory. Have a nice Day.. Mart!n Edited 2023-09-28 13:53 by Martin H. 'no comment |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4246 |
Going to do a re-write of the core. To save RAM I have put all byte oriented information in strings. That is speed inefficient in PicoMite. This count for a large ammount for the UNIT attributes. You will have to scan through these 8 strings byte(char) for byte(char) and modify, and that at game speed. I checked 3 options 1/ strings 2/ packing bytes in integer array 3/ wasting RAM memory and using 64 bit integers to store 8 bits data 'speed test math vs strings option default integer 'setup dim a$(7) length 2 a$(0)="h" a$(1)="e" a$(2)="l" a$(3)="l" a$(4)="o" a$(5)=" " a$(6)="m" a$(7)="e" dim b%(7) b%(1)=asc(left$(a$(0),1)) b%(1)=b%(1)+(asc(left$(a$(1),1))<<8) b%(1)=b%(1)+(asc(left$(a$(2),1))<<16) b%(1)=b%(1)+(asc(left$(a$(3),1))<<24) b%(1)=b%(1)+(asc(left$(a$(4),1))<<32) b%(1)=b%(1)+(asc(left$(a$(5),1))<<40) b%(1)=b%(1)+(asc(left$(a$(6),1))<<48) b%(1)=b%(1)+(asc(left$(a$(7),1))<<56) dim mask%(7) mask%(0)=&hffffffffffffff00 mask%(1)=&hffffffffffff00ff mask%(2)=&hffffffffff00ffff mask%(3)=&hffffffff00ffffff mask%(4)=&hffffff00ffffffff mask%(5)=&hffff00ffffffffff mask%(6)=&hff00ffffffffffff mask%(7)=&h00ffffffffffffff 'test string speed timer=0 for i=0 to 7 next ref_t!=timer print "8 loops : ";ref_t! timer=0 for i=0 to 7 c=asc(mid$(a$(i),1,1)) next t!=timer print "string char read : ";t!-ref_t! timer=0 for i=0 to 7 mid$(a$(i),1,1))=chr$(c) next t!=timer print "string char write: ";t!-ref_t! 'test numeric speed packed 8x8 in 64 bit timer=0 for i=0 to 7 c=b%(1)>>8*i and &hff next t!=timer print "byte number read : ";t!-ref_t! timer=0 for i=0 to 7 b%(1)=(b%(1) and mask%(i)) + c<<i*8 next t!=timer print "byte number write: ";t!-ref_t! 'test numeric speed 64bit integers timer=0 for i=0 to 7 c=b%(i) next t!=timer print "integer read : ";t!-ref_t! timer=0 for i=0 to 7 b%(i)=c next t!=timer print "integer write: ";t!-ref_t! end The results are motivating me to store the UNIT attributes (512 bytes) in integer arrays in a new release (major rewrite) at cost of 4kbytes of RAM. This is 3 to 4x faster. I am only adapting the UNIT attributes, not the world map. The world map is not consulted that ofter, and .... it would eat up 64kbytes RAM in integers...ouch... RUN 8 loops : 0.075 string char read : 0.32 string char write: 0.391 byte number read : 0.198 byte number write: 0.346 integer read : 0.109 integer write: 0.126 (packing in integers is not bad, but easier to make a mistake in writing the code). Edited 2023-09-28 17:00 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9126 |
What about LONGSTRING SETBYTE and LGETBYTE ? |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4246 |
Never used it before... I'll give it a try... Could be a direct option for the world map, that is already a "long" string of 8kbyte. Volhout EDIT: it is about 50% slower than integer, but double as fast as string handling. It is a good candidate. Issue is that if I have to make a architectural change like that later on, it is a nightmare. I'll think about it. At the moment I favour integers in the UNIT attributes, but may change the world map to a longstring. Edited 2023-09-28 18:07 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1114 |
EDIT: tested in Protracker ... they are ok Edited 2023-09-29 00:15 by Martin H. 'no comment |
||||
Page 9 of 38 |
Print this page |