|
Post by manu128k on Nov 20, 2018 21:36:34 GMT
Hello guys, my game is reaching completion at a good pace, but memory seems to be running scarce faster. This is time for me to ask some questions: - How are screens stored in memory?. Can I do something to make them use less memory? - How much memory does a typical 128k song needs? (including code for setting up interruptions and stuff) - Does AGD multiplatform allows to allocate more memory? Any tip for getting more memory is welcomed at this point Thanks in advance
|
|
|
Post by alessandro on Nov 21, 2018 15:09:10 GMT
Hi Manu.
1. Generally speaking, screens will occupy more space in memory when the game area is larger and they are composed with several different blocks. 2. It depends on several parameters, such as the overall length of the song and the number of samples and patterns employed to compose it. To that you must add the starter/silencer and player code. To give you a rough estimate, the medley song that plays in Lost In My Spectrum 2.0 is 3022 bytes long, while the total length of the music block is 5280 bytes. 3. Can't really answer that, sorry. (I am not using AGD multi platform until I know for certain that it allows CALLs to external code, performed in traditional AGD by means of the ASM 205 instruction; to me, this is a fundamental feature.)
|
|
|
Post by manu128k on Nov 21, 2018 20:35:17 GMT
That's not very good news for me but I appreciate the info.
Thanks Alessandro.
|
|
|
Post by Jonathan Cauldwell on Nov 24, 2018 23:56:45 GMT
AGD compresses consecutive blocks of the same type, left-to-right with overflow from one line to the next. If you have a block of 8x8 bricks of the same type that appears a lot, that compresses well. blanks space does too. Platforms do if they're made of a single block.
AGD uses about 34K or something like that, the editors get in the way of the rest but you can always use that for your front end. Plenty of room for BASIC. Multi-Platform AGD can use every byte of Spectrum RAM so larger games can be created.
Alessandro, I've added a CALL instruction at your request. Download version 0.7.2
|
|
|
Post by manu128k on Nov 27, 2018 23:22:28 GMT
Thanks Jonathan, it's nice to know how screens are compressed behind the curtains So it seems I could be migrating my game to the multi-platform AGD, but I have a question that I must ask ... I'm too used to check free memory every now and then in ZX Spectrum AGD, how can I check the remaining memory in the multi-platform AGD?
|
|
|
Post by Minilop on May 21, 2020 22:04:42 GMT
I'm trying to get my game finished but I am really having problems with memory, so I'm having to make some sacrifices. It says above that "Multi-Platform AGD can use every byte of Spectrum RAM so larger games can be created." At the moment the memory usage tool is showing:
Blocks 2550 Sprites 8246 Objects 1722 Screens 11163 Sprite positions 616 Font 768
Total 25065
So, obviously there are some things that aren't counted in the list above
In my messages I have about 30 lines of text
Admittedly my Sprite type events are quite bulky - I'm using all of the available sprite types with a lot of custom code (using a lot of IF Image = to make different sprites work differently)
I was using the USER code for the screen fade effect but have now uninstalled it.
Even with all this, it seems odd that I am frequently getting crashed due to memory maxing out.
When I export, the resultant TAP file is 39,285 bytes, but I can crash the game if I add just one more line of text in DEFINEMESSAGES.
Is this expected?
Any tips?, I've been dropping a lot of sprite frames, and if I had to I could probably lose a screen (I have 31 screens at present)
|
|
|
Post by Jonathan Cauldwell on May 22, 2020 15:49:06 GMT
Sounds like you're pretty close to the limit. Remember, the first 8K of Spectrum RAM is used by the screen, system variables, BASIC etc. 40K is pretty much what you get to play with on a Spectrum. If you're getting crashes the game is probably overwriting the screen address table at the end of RAM. If you like I could release a modified version of the engine that does away with that table, effectively using the slightly slower original AGD code. That would free up another 512 bytes
|
|
|
Post by Minilop on May 22, 2020 18:47:12 GMT
Hi Jonathan, thanks for the offer, I think I'm going to be OK, I'm reworking one of the enemy sprites that had way too many frames (13!)...which has saved me about 1500 bytes, luxury!
|
|