Help with hardware and software graphics - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: Help with hardware and software graphics (/showthread.php?tid=226) Pages:
1
2
|
Help with hardware and software graphics - Ikerkaz - 04-27-2022 Hi to everyone! First of all, sorry for my terrible english, I'm from Spain I will try to explain myself. I am making a Star Trek space game, some kind of mix between EGATrek and ST: Armada. I don't know if I am going to finish it, but I am enjoying the creation as a hobby Currently the game displays background space, stars, planets and several ships (allies and enemies). You have 3 allied ships, and you can move them with mouse (clicking on the screen rotates and moves the ship automatically). My problem is that the game is a little slow when I paint nebulae or several things on the screen. I am using all software graphics, but I read several days ago that you can load graphics into hardware, with the "33" switch, and in theory the game would speed up. I tried to recode all the game with this option, but I failed. The game paints some things, but others don't. Also, I tried to use display order, but I don't know how to use it, and sometimes the game displays only the hardware graphics previously loaded, or it only displays some points and lines (I drew them with PSET and LINE in some parts of the code). Please can you help me? If anybody wants the source code, I will be pleased to send it to you. Thank you !!! IKZ RE: Help with hardware and software graphics - OldMoses - 04-27-2022 Hi Ikerkaz, I'm not very experienced with hardware images, having had similar results to what you are experiencing. I do recall Steve having treated the subject a bit on the old forum, which I've linked to below. They will reduce CPU usage, but I'm not sure how much that will affect speed. You generally have to limit hardware images to things that you are not changing on the fly. There are a lot of things that can be speed killers. https://qb64forum.alephc.xyz/index.php?topic=3556.msg128883#msg128883 PS. If your screen display zooms or pans around, is your code painting details that may be off screen? That was a big speed killer in one of my projects which took me months to figure out. RE: Help with hardware and software graphics - Ikerkaz - 04-27-2022 No, I tried not to paint objects that are off screen. Thank you for your help OldMoses, I will continue investigating this... RE: Help with hardware and software graphics - bplus - 04-27-2022 Hello @Ikerkaz Welcome to the forum! I could not tell from your question are you drawing objects like spaceships each time or using their image as sprite? As OldMoses said, Background is good for hard images (I hardly use Hard image either), but also allot of graphic drawing can be saved into a separate image with handle and that may save some time too. Are you doing that? RE: Help with hardware and software graphics - johnno56 - 04-27-2022 Hi @Ikerkaz, First two things... Big fan of Star Trek and Amstrad (cpc464)... Woo Hoo! I may not be of much help... But, from my experience in space games, certain things just do not move... eg: Galaxies and Nebulae (unless you are travelling 'through' them) in comparison to the relative speed of your ship... they just do not move. Stars (unless warp speed is used) should move 'slowly'. Asteroids and planets a little quicker... (Note: If you are going for accuracy, Starships are not permitted to use warp speed within a solar system - here ends today's lesson.. lol) Question: Are you using some kind of "cloud" type function to draw the nebula? If you are not flying through it, my advice would be, use a fixed image instead. If it is at all possible, may I see a screenshot, of what you have done so far? J RE: Help with hardware and software graphics - Ikerkaz - 04-28-2022 (04-27-2022, 02:07 PM)bplus Wrote: are you drawing objects like spaceships each time or using their image as sprite? Actually I have one image loaded with _LOADIMAGE, only 1 sprite, and I'm drawing objects each time. Starships are not the problem because they are small. My big problem is the nebulae. They also are images loaded, and currently I draw them with _PUTIMAGE but only a piece of them (the one that is currently visible on the screen). The other part of it and the rest of the objects are not painted. (04-27-2022, 08:02 PM)johnno56 Wrote: Hi @Ikerkaz,I have a CPC6128 and it is working almost perfectly The nebulae are big PNGs with transparency. Actually I paint a faded "galaxy" background, over this I paint starships and then I paint nebulae, in order to show some king of transparency effects. This is a current screenshot, it is totally incomplete and it have a lot of things that I have to change (among some random numbers that I use for debugging the program). Grettings! IKZ RE: Help with hardware and software graphics - bplus - 04-28-2022 Wow! you've allot going on, 1 regular looking screen and 6 screenettes! I hope you aren't redrawing the whole 7 when you update only one screenette(=tiny screen). I suspect you have a large monitor you are doing this on. RE: Help with hardware and software graphics - OldMoses - 04-28-2022 That looks amazing! I can't wait to see it working. RE: Help with hardware and software graphics - Gets - 04-28-2022 Quote: Also, I tried to use display order, but I don't know how to use it, and sometimes the game displays only the hardware graphics previously loaded, or it only displays some points and lines (I drew them with PSET and LINE in some parts of the code). The HARDWARE screen is cleared every time you use DISPLAY, so you’ll need to repaste it each time you update. This can be an issue if you were sometimes only updating mini screens to save time. The SOFTWARE page shouldn’t be cleared unless you do it yourself, so guessing why that wouldn’t display is more difficult. Could be a DISPLAYORDER issue,maybe you used it multiple times and didn’t always include the SOFTWARE layer? In general, you should set the DISPLAYORDER once and forget about it RE: Help with hardware and software graphics - johnno56 - 04-28-2022 Fascinating. Using both 'Constitution' and 'Galaxy' class starships in the same game... lol Thank you for the image. Much appreciated. J ps: My cpc464 died a natural death some decades ago... I now use an emulator. I actually still have the user manual... You just have to love hardcopy for reference... lol |