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 : PicoMiteVGA Alien Syndrome
Page 2 of 3 | |||||
Author | Message | ||||
Bleep Guru Joined: 09/01/2022 Location: United KingdomPosts: 509 |
Ok thanks Martin, I now see what you mean, you update a full 16x16 then scroll by 4 pixies, so you only have to update the 16x16 every 4 iterations of the scroll. I suppose, depending on how fast the scrolling is, you could if necessary, scroll by 8, but at the expense of smoothness, if it actually gains you any significant processing time? Regards Kevin. |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1113 |
Kevin, look at it as it is just experimental to see if the scrolling works, if the tiles are displayed correctly, and my translation CSV (which I create with TileED) to MAP works correctly, etc. Whether and which routines make it into the later program is still completely open and any improvement is welcome. A lot also depends on how well and fast the game mechanics will work. Cheers Martin Edited 2024-02-13 22:19 by Martin H. 'no comment |
||||
Bleep Guru Joined: 09/01/2022 Location: United KingdomPosts: 509 |
Hi Martin, You appear to have made some quite significant progress already :-) lets hope you can continue, I often start with a few basic ideas, then modify and or optimise as I go along. Keep up the great work. Regards Kevin. |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1113 |
Hi Volhout, I think, I have now solved this (as a test) in a similar way to how you did in Petrobot. ° I set the frame rate at the start of the program, ° divide 1000 by FPS to get the miliseconds which one Frame needs, ° I measure the time I need for one cycle and ° set a PAUSE in which I subtract the this time from Frametime. Looks quite fluent at 20 or 25 FPS Instead of wasting time with PAUSEs, program parts for the game mechanics should be executed there later. Cheers Martin Now I'm trying to add diagonal scrolling to the sub in a clever way Can I use a SELECT CASE within a SELECT CASE? Edited 2024-02-14 17:37 by Martin H. 'no comment |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4233 |
Hi Martin, I have been thinking about that also. I see 2 solutions: 1/ in stead of a generic routine that adds the new tiles, write something specific for each of the 8 directions. That could even be fastest. You could even "hard code" each individual blit. Maybe a list of 20 blits is faster that a loop of 20. But the code would be larger (not an issue I guess seeing the complexity of this game). 2/ in case the top and bottom overlays (on L) are 16+4=20 pixels minimum, you could prioritize (in case diagonal, do horizontal immediate, then next loop cycle, you do the vertical that belongs to the horizontal). So 2 successive scroll moves in stead of 1 more complex. This could also be very fast, since you only blit 20 max per loop cycle. And it would be more "smooth" on the CPU load. Spreading out graphics work over multiple loops. Maybe this is what you have though of also. Anyway, I though I would share it with you. Volhout PicomiteVGA PETSCII ROBOTS |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3801 |
I expect & hope so. Try a few examples. John |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1113 |
harm, yes, I'm thinking of a Draw_Row, Draw_Column sub, where there will only be a stack of commands without a loop. At the Moment a scrolling and Player Sprite Animation takes 2-3 ms, if it has to redraw a Row or Column it takes 8-10 ms. So @25FPS (50ms) there are 40-48 MS per Frame left for other things. Here is the smoothed version(just the Basic Program) AS02.1.zip Edited 2024-02-14 23:52 by Martin H. 'no comment |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4233 |
Hi Martin, I have (maybe) shaved a few microseconds off. But nothing essential. I am not sure what you modified, but I assume at direction 2,4,6,8 you just change pmx and pmy, and next loop (when there is no change) the 0 will load the whole background (300 sprites). At least, that is the intention. But as the graphics will show, diagonal there is no repaint of background al all. Just a wrap around of the current (which is happening in the "SPRITE SCROLL" command. Volhout AS02.1h.bas.zip Edited 2024-02-15 01:21 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1113 |
Harm, Thank you very much for your help. I haven't built in the routines for diagonal scrolling yet, so you don't need to worry. For you and the others it might be interesting, here is the small programme with which I convert the CSV files from TileED to MAP. Maybe one or the other can use it 'read csv and write to MAP cls R=0:C=0 dim integer a(10) open "Level01..csv" for Input as #1 open "Level01.MAP" For Output as #3 open "tmp.bin" for output as #2 nr$="" do n$=input$(1,1) if n$<>"," and n$<>chr$(13) then nr$=nr$+n$ else inc c print #2,chr$(val(nr$),2); print hex$(val(nr$),2);:nr$="":if n$=chr$(13) then ?: Inc r end if loop until eof (#1) close #2 close #1 C=C/R print #3,"MAP"+CHR$(C);Chr$(R); open "tmp.bin" for input as #2 do print #3,input$(1,2); loop until eof(#2) close #2 close #3 kill "tmp.bin" ? R,C Edited 2024-02-15 03:14 by Martin H. 'no comment |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4233 |
Hi Martin, Before the start of the game mechanics can begin, it would be needed that you begin with creating the tile attributes. The minimum to start with is defining the "can walk on" bit for each tile (similar to PETSCII). In this game you cannot move items, and they are not "hidden", there are no animated doors, so we may be able to avoid the numerous UNITS that exist in PETSCII. Only the 4 active enemies at a time, and the player. So the gameplay is easier (flatter). And we may be able to speed things up if we assign the game mechanics for a large part to the tile attributes. That saves us the effort of search through all UNIT attributes. As far as I can see these bits are needed, but doe not have to be defined from the start. bit 0: can walk on bit 1: has item bit 2: is an exit bit 3: can be destroyed ? bit 4,5,6,7: can hold an item index. But for start, it would be needed to have the "can walk on" bit for each tile in one level. Then we can see if smooth walking in all directions works as expected. Regards, Volhout Edited 2024-02-15 18:25 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1113 |
bit 4 , can fall into I m in the Office today so I will look at it later. But maybee paint some Aliens Here is a strategy guide and walkthrough for this Program: Alien_Syndrome/Walkthrough Edited 2024-02-15 20:33 by Martin H. 'no comment |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1113 |
Volhout, As I see it so far, there are several things that can be hidden. The map, the drones that keep your back free and the increase in weaponry. I should be able to implement the assignment reasonably quickly. There is a maximum of 128 tiles per level. In the original game, the tiles are twice as big, so I always have 4 together, which have the same properties. I'll probably manage that at the weekend. Then adapt the scroll mechanics so that you can move the player using the buttons. I just have to make sure that the player moves all the way to the edges. So his position on the screen is not fixed, unlike in Petrobot. The drawing of the enemies is progressing and the tiles and map for level 3 are also finished. Cheers Martin Edited 2024-02-17 04:22 by Martin H. 'no comment |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4233 |
In pettscii the levels where designed auch thar the outer few rows and column whwr "not walk".so the game did not need conatant coordinate comparison. You simplt could not walk off the map. Did you consider 32x32 tiles? I think that may be even faster drawing in case you have to redraw all background. Lets first try this. Volhout PicomiteVGA PETSCII ROBOTS |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1113 |
Hi Harm, I think in the next version I will attach 128 bytes with the tile attributes to each map so that they can be read with each map. like this: I also spent time this weekend working on the Tile_Row and Tile_Col subs, which I will test tomorrow and, if they work, replace the existing scroll_BG sub. -- Once the attributes and the new sub-routines have been implemented, it should be possible to walk through the worlds with the player. Cheers Martin Edited 2024-02-19 07:06 by Martin H. 'no comment |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4233 |
Hi, Nice overview Martin !! This definitely helps in development Maybe you could also add a column "C" ? (in 0,1,2...E,F, the C is missing). I am sure you wanted to see if I was awake....yes I am !! Volhout Edited 2024-02-19 22:01 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1113 |
Ups .. you're right of course, and I didn't notice. That's what happens when you do something like that (quickly) before you go to sleep. But it explains the principle of how I will assign the attributes to the tiles . I've just added the subroutine for the NES controller from Petsciirobots, which works better than the keyboard, even for testing. As long as the tiles have no attributes, I can of course move freely on the MAP. The next query always occurs after the full movement (16 pixels), but this is not unpleasantly noticeable, as a movement cycle of the Player Sprite also includes 4 animation states. Cheers Martin Edited 2024-02-19 22:48 by Martin H. 'no comment |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4233 |
Hi Martin, You run the game on the PicoGameVGA (Mixtel90/thwill's design ?). I have the same platform (I think a 1.4 "blue" board), so I could reproduce your code immediately, including NES controller (Tom send me 2 samples once, 1 of which works quite good, the other is very hard to push buttons). I have a set of home-brew ones also (4021 + 8 buttons). Volhout Edited 2024-02-19 22:58 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1113 |
I use Mixtel90s version 2.0 of PicoGame VGA and since I ordered the board myself via PCPWay, I was able to choose the color myself. That's why my version is green ---- Fortunately, I found a collection of Aliensprites that I only had to translate to RGB 121. That saved me weeks because it's much quicker than drawing from scratch. So when the time comes for them to be included in the game, I've already prepared the appropriate sprites Edited 2024-02-19 23:40 by Martin H. 'no comment |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1113 |
done 'no comment |
||||
Martin H. Guru Joined: 04/06/2022 Location: GermanyPosts: 1113 |
Update: New additions are Map and TILES for level 3 Control via keyboard or NES controller on port a (I recommend the NES controller) Free movement of the player in 8 directions. The ScrollBG sub has been replaced by the Draw_Row and Draw_col suproutines. What is still missing Tile Attributes Sound and BG Music Level 4 (in progress) - Level 6 Enemies, weapons, hostages etc. the transfer of the graphics into libraries (one library per level) I will still have to draw a lot of tiles and sprites due to the 8 directions, the key assignment of the keyboard is a bit cumbersome. 'Moving 8 Directions 'Keys: ' W E R ' _ ^ _ ' |\ | /| 'S <-- --> F ' | ' |/_ v _\| ' X C V (maybe Volhout can have a look because of the Key repeat) Have fun trying it out AS02.4.zip Edited 2024-02-25 19:15 by Martin H. 'no comment |
||||
Page 2 of 3 |
Print this page |