|
Post by lamptonworm on Aug 26, 2015 10:28:09 GMT
Hi all, This software is excellent! Quick question, how are you guys approaching HUD graphics? Are you doing something elaborate with the char set, or using objects, or something else Cheers! LW.
|
|
|
Post by egotrip on Aug 26, 2015 15:39:00 GMT
I use char set and tiles
|
|
|
Post by lamptonworm on Aug 27, 2015 13:18:32 GMT
Hi, thanks for the reply.
Just to confirm, what do you mean by tiles in AGD? Not sure how you place a Block outside of the play window.
Cheers, LW.
|
|
|
Post by kas29 on Aug 28, 2015 15:24:03 GMT
Nothing. The block (tile) can be placed within the window. Outside, you can try through the character set. Or sprites.
|
|
|
Post by andrewvanbeck on Sept 9, 2015 11:22:51 GMT
I stick with blocks because often I find that using text will corrupt block puts - hopefully this will be fixed in the next incarnation of AGD.
Blocks also avoid having to use messages, which can cause problems on their own. You can make blocks to lay out the HUD and just PUTBLOCK them wherever on the screen on the screen initialisation. Like...
LET LINE = 0 LET COLUMN = 0 PUTBLOCK 1 REPEAT 6 PUTBLOCK 2 ENDREPEAT PUTBLOCK 3
That would effectively put block 1 at 0,0 - then 6 blocks of 2 and a block 3 at the end. The line and column always relate to the actual screen and not the defined window - so it's the way to go for HUDs I think.
I'm working on a new game, and I have a border around the score display using blocks, as well as a health bar that it 2 blocks high, I just draw the score and health bar in a main loop, seems to work fine. I once again bring up ZX Paintbrush, it's a great companion for AGD, for making title screens or sprite sheets, but also just for designing your HUD - I draw in ZX Paintbrush then copy that manually onto blocks, but just getting it looking good in Paintbrush helps a great deal, it's a lot less fiddly and saves time in the long run. Blocks also allow easy control over colouring - really if you have to change the text ink and paper colour it becomes a nightmare and takes a lot more code. The lack of a copy function in the character set editor can be a pain as well. These days I prefer to leave the character set alone and avoid displaying text messages, it avoids a few issues that can corrupt memory and make your game unstable.
You can effectively make your window with a 1 block border all around, and just PUTBLOCK the border in the game initialisation event, saving a ton of memory as well, because that border won't need to be added to every screen.
Sprites and objects can be placed in the 'dead space' as well, but I've had issues with that and find blocks far more reliable. Oddly, SHOWSCORE works great and doesn't cause the issues that DISPLAY might.
|
|
|
Post by alessandro on Sept 9, 2015 12:59:25 GMT
Why bother with blocks to make your own game frontend when you could just simply draw it with ZX Paintbrush and recall it before starting the game? I have been doing this for ages. It saves you a lot of memory and allows you to create far more elaborate designs. Some examples: Cronopios Y FamasCousin Horace (Chapter 3)
|
|
|
Post by andrewvanbeck on Sept 9, 2015 13:03:54 GMT
I've wanted to do that since starting with AGD, just don't have the Z80 skills to make it possible
|
|
|
Post by kas29 on Sept 9, 2015 16:43:29 GMT
Outside the game window, you can make this version of the framework: You must select the desired characters(edit) and indicate in the message. write in game initialisation and restart screen: colour 71 border 0 cls colour 65 let line 0 let column 0 message 0 let line 1 repeat 22 let column 0 message 1 endrepeat let line 23 let column 0 message 0 frame.szx (32.29 KB)
|
|
|
Post by Doug Bagnall on Sept 9, 2015 18:27:57 GMT
Alessandro, any chance of a short tutorial, or instructions, on how to accomplish this? I am sure it would be much appreciated, especially by me.
|
|
|
Post by alessandro on Sept 9, 2015 18:48:55 GMT
Alessandro, any chance of a short tutorial, or instructions, on how to accomplish this? I am sure it would be much appreciated, especially by me. It's quite simple: just draw an image with your favorite utility - mine is ZX-Paintbrush - leaving a blank space for the game screen layout as defined in the C menu item. Store it somewhere in an unused space in the Spectrum RAM - better if compressed, in order to take less space than the usual 6912 bytes - and recall it before starting your game with RANDOMIZE USR 32000 (or JP 32000 as you would if using a M/C routine). Generally, due to the scarce memory available to AGD, it is wise to avoid doing anything from within it that can also be done from outside it, so to speak.
|
|
|
Post by lamptonworm on Sept 13, 2015 19:10:03 GMT
Hi, I'm very interested in how to accomplish this; would you be able to provide a more detailed step-by-step so I can learn the ropes or perhaps point me at some similar reading on the topic so I can understand it please? It sounds like I need to write a basic loader that loads the SCR into memory then recalls it before the AGD code starts (or within AGD in the relevant event), but I'm new to this.. also if I go this route, I'm best handling my own loading screen also in a similar way, and avoiding the AGD basic loader/loading screen? or.. use the built in loader to generate the basics, then edit to handle this new SCR for the HUD.. I'm guessing! Cheers, LW.
|
|
|
Post by andrewvanbeck on Sept 14, 2015 10:48:13 GMT
I think the built in loading screen function works quite well, but it's real easy to do that with your own loader - plus you might want to load things before the loading screen. I made a quick Beepola tune demo, and found that loading the music routine before the loading screen was the most straightforward, like load the music, load the screen, start the music. That's how I would handle music with an AGD game as well, like play a title tune and wait for a keypress before running the AGD program. You should grab ZX Editor, which is in the same suite of speccy utilities as ZX Paintbrush - it lets you edit .TAP files however you need, swapping out screens, even making basic programs and loaders. It's so much better using ZX Editor than trying to do it with Spectaculator.
It would be cool if Alessandro could explain how he figures out which areas of memory are safe to use. A whole screen uses 6917 bytes, so it might have to be considered while developing your game, you might need to reserve that memory.
|
|
|
Post by alessandro on Sept 14, 2015 20:07:01 GMT
It would be cool if Alessandro could explain how he figures out which areas of memory are safe to use. A whole screen uses 6917 bytes, so it might have to be considered while developing your game, you might need to reserve that memory. Since Cronopios Y Famas, my housekeeping programs, that is to say those which manage control selection in case I choose to implement key definition - thus eschewing the MENUITEM command -, and/or load the title music and the game frontend screens and sound effects, are written in BASIC, then compiled in MC with HiSoft BASIC 1.2 and stored below the AGD game code. Recently I also wrote some small routines directly in MC, or adapted some existing ones to my needs, in order to perform some specific tasks, e.g. the one I posted in the thread about AY music playing in the background, and that I integrated with a small code which carries on lives and score in case of games spanned across several levels - it fetches them from the RAM after the end of each level and stores them in an unused location above the game code, to be retrieved later by three ASM commands placed in the Game Initialization event. My experiments with that have so far been successful. All of the above means that screens used during the game as frontends or congratulation messages must be stored below the AGD game code as well, and compressed from their original 6912 bytes (not 6917...) in order to take as little space in the RAM as possible. Einar Saukas's excellent ZX7 integrated compressor/decompressor is suited for both program and screen data and I recommend its use to everyone. It is also advisable to avoid going below 24200, especially if you have a BASIC program in memory to do your housekeeping with AGD.
|
|