ggn Posted November 9, 2017 Share Posted November 9, 2017 The first object in rapinit.s is called "text/particle layer" for a reason . All print commands actually write to that layer. As long as you have that layer active you'll get transparent text on screen. If for some reason you don't want to use that mechanism you'll have to write your own text printing functions that write on other objects.... which is not really recommended So the question is: does print not work for you with the 4 scenarios? Does it work for 1 only and not for the rest? More details please! 1 Quote Link to comment Share on other sites More sharing options...
F.L Posted November 9, 2017 Author Share Posted November 9, 2017 Ok ! Yes it's for the 4 scenaries : to write the score of players and the time of each round. I must remember everithing is a sprite with jaguar I have an idea. I will make a "hole" at the right place in the 4 scenaries for seeing the text ! Quote Link to comment Share on other sites More sharing options...
Sporadic Posted November 9, 2017 Share Posted November 9, 2017 (edited) You can move the particle text layer to the bottom of the list. Then the text will appear above everything else. You must make sure you have an active object at the top though. Edited November 9, 2017 by Sporadic 4 Quote Link to comment Share on other sites More sharing options...
F.L Posted November 9, 2017 Author Share Posted November 9, 2017 You can move the particle text layer to the bottom of the list. Then the text will appear above everything else. You must make sure you have an active object at the top though. in rapinit i have moved particle text layer behind my first scenary and now i can write on it, thanks. but i have a problem with the 3 others.... Well you could define all the sprites as raptor objects but as you say it'll be a LOT of work! Also it will slow down raptor processing a bit, and we can't have that! One way to slow down your animations is to change the sprite_animspd property (either in rapinit.s or at runtime). This will make the animation slow down by frames. So if your screen displays at 60fps then you can make your animation run at 30fps, 15fps and so on. But that won't work if you want your animation to update at, say, 40fps. So here's another way of doing this. Here's a spritesheet from nyandodge, zoomed up x4: _nyancat.png Each frame is 32 pixels wide by 11 pixels high. We can use this to our advantage! If you know the address of the first frame it's very easy to find the address of the second. Basically you need to add height * ( width * no_of_bits_per_pixel ) / 8 to your address. So in the above example our picture is 4 bits per pixel so we need to add 11*(32*4)/8=176 bytes. The third frame is then 176*2 bytes from the start, etc etc. So you can keep a frame counter and when it reaches 40 calculate and set the sprite's gfxbase and set it using rsetobj (or rlist which is recommended). Hope I didn't screw up the maths above and that it helps you i am still stuck on the adress of the second frame of a sprite sheet.... for the example nyancat, each frame is 176 bytes so if i want to display the second frame of the nyancat, i must do DIM frame1% frame1=RGETOBJ(1,R_sprite_gfxbase) rsetobj(1,R_sprite_gfxbase,frame1+(176) ) it is correct ? for my 4 background, i want to use a sprite sheet.it is a good idea ? each frame is 320*200. in rapinit i load an image of 320*800 each frame does 200*(320*4)/8 = 32000 bytes but when i do +(32000) to my background , it makes glitches...at screen ??? i must have not understand something.... it is a better idea to swap my 4 background ? Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted November 9, 2017 Share Posted November 9, 2017 (edited) it is correct ? for my 4 background, i want to use a sprite sheet.it is a good idea ? each frame is 320*200. in rapinit i load an image of 320*800 each frame does 200*(320*4)/8 = 32000 bytes but when i do +(32000) to my background , it makes glitches...at screen ??? i must have not understand something.... it is a better idea to swap my 4 background ? Edited November 9, 2017 by sh3-rg Quote Link to comment Share on other sites More sharing options...
ggn Posted November 10, 2017 Share Posted November 10, 2017 i am still stuck on the adress of the second frame of a sprite sheet.... for the example nyancat, each frame is 176 bytes so if i want to display the second frame of the nyancat, i must do DIM frame1% frame1=RGETOBJ(1,R_sprite_gfxbase) rsetobj(1,R_sprite_gfxbase,frame1+(176) ) it is correct ? I just tested the following in nyandodge: - In rapinit.s change sprite_maxframe to 0 in the player's sprite - In nyandodge.bas add the following lines outside the main loop: dim frameno as int frameno=0- Inside the main loop (immediately after the DO instruction) add the following lines: frameno=(frameno+1) band 7 rsetobj(1,R_sprite_gfxbase,(int)strptr(BMP_PLAYER)+176*frameno)And that gives me control over the animation. Notice the (int)strptr() in there - that gives the address of the object. for my 4 background, i want to use a sprite sheet.it is a good idea ? each frame is 320*200. in rapinit i load an image of 320*800 each frame does 200*(320*4)/8 = 32000 bytes but when i do +(32000) to my background , it makes glitches...at screen ??? i must have not understand something.... it is a better idea to swap my 4 background ? Well, there are glitches and there are glitches , so what do you mean when you say "glitches"? I'm not sure if using a spritesheet for your backgrounds is a good idea - your backgrounds are 320x200 and the viewscreen can be 320x240 or 320x256. So I would guess that if you place the object on screen you'd see some lines from other maps as well! So probably 4 different objects that have their active attributes changed is probably better. 3 Quote Link to comment Share on other sites More sharing options...
F.L Posted November 10, 2017 Author Share Posted November 10, 2017 (edited) yes, differents objects with active attributes is better. i have done this first time. but i cant write on them. i have moved particle/text layer after them and i can write on only the scenary just before the text layer, and the other scenaries before this one are not visible... it's strange something strange too, the position of my text is not the same if i launch the rom with project tempest or virtual jaguar project tempest is 4 pixels bottom wich emulator is 100% working like the real hardware ? Edited November 10, 2017 by F.L Quote Link to comment Share on other sites More sharing options...
Shamus Posted November 10, 2017 Share Posted November 10, 2017 No emulator works 100% like real hardware, but VJ (for all its faults, which are many) is closer than PT IMNSHO. 2 Quote Link to comment Share on other sites More sharing options...
F.L Posted November 10, 2017 Author Share Posted November 10, 2017 (edited) hello good news ! i have understand how to manage the adress of a spritesheet and it works good i have updated the zip, now all the background and their trees are displayed like this ! bad news : despite all my efforts, i dont become to write text of my background... like sporadic have said to me, i moved the text layer, but it seems it works if only one simply background is before. if a spritesheet is before, or if i swap the gfx_base, there are glitches on the screen..? so, for writing my text, i have open an hole in my backgrounds. its not beautiful but and it works too enough coding for tonight good night Edited November 10, 2017 by F.L 1 Quote Link to comment Share on other sites More sharing options...
ggn Posted November 11, 2017 Share Posted November 11, 2017 (edited) Ok, so I spent a little time with your problem so here's my solution: this sets the 4 backdrops as objects 0-3, the text layer in object 4 and flips between the backdrops. The easiest way to make an object disappear that I could think about is to set its y coordinate to some high value. So I set the invisible objects to (0,700) and the visible ones to (0,16). This is really not a big performance hit on the OP because it simply checks the current scanline number it draws with the y coordinate of each object. Since it goes from 0 to 255 (roughly) the invisible objects aren't processed after a small check. Anyway, hope this helps you . background.zip Edited November 11, 2017 by ggn 4 Quote Link to comment Share on other sites More sharing options...
F.L Posted November 11, 2017 Author Share Posted November 11, 2017 Ok, i will try this ! A very big thanks to all your help, if i do cartridges of the game, i will give you one 2 Quote Link to comment Share on other sites More sharing options...
+CyranoJ Posted November 11, 2017 Share Posted November 11, 2017 it is correct ? for my 4 background, i want to use a sprite sheet.it is a good idea ? each frame is 320*200. in rapinit i load an image of 320*800 each frame does 200*(320*4)/8 = 32000 bytes but when i do +(32000) to my background , it makes glitches...at screen ??? Can you post the spritesheet and a screenshot of it glitched, because a single object and changing the gfxbase should work. 3 Quote Link to comment Share on other sites More sharing options...
F.L Posted November 11, 2017 Author Share Posted November 11, 2017 (edited) Yes it works like this. In my rom you can see it. The glitches came from the moving of text layer Today i have no time to test the code of ggn, maybe tomorrow Edited November 11, 2017 by F.L Quote Link to comment Share on other sites More sharing options...
ggn Posted November 11, 2017 Share Posted November 11, 2017 A very big thanks to all your help Hey, if there not many customers, there is better support 2 Quote Link to comment Share on other sites More sharing options...
F.L Posted November 12, 2017 Author Share Posted November 12, 2017 (edited) i have tried your background example, i like when an example is clear like that, i understand quicklly ! i will use that for my next update of the rom in my precedent release, i was using the same method than you for hiding my backgrounds, exept that i did x =400 maybe it was not a good method than y=700 for the hardware and it does the glitches..? edit : in your example your pictures are 320*200 but why you did in rapinit : dc.l 160*200 ; sprite_framesz dc.l 160 ; sprite_bytewid and it display an image of 320*200 at screen ?.... i dont understand something Edited November 12, 2017 by F.L 2 1 Quote Link to comment Share on other sites More sharing options...
Welshworrier Posted November 12, 2017 Share Posted November 12, 2017 It's a long declaration, so allocating 32 bits per element. Your image is 16 bits per element so you require half the amount. 1 Quote Link to comment Share on other sites More sharing options...
ggn Posted November 12, 2017 Share Posted November 12, 2017 dc.l 160 ; sprite_bytewid My pictures are 4 bits per pixel and 320 pixels width. So the amount of bytes per line is (320 (pixels) * 4 (bits/pixel) ) / 8 (bits/byte) = 160 bytes. dc.l 160*200 ; sprite_framesz If you understand the above, then this is easy, 160 bytes per line * 200 lines = 32000 bytes. Also if I remember correctly this variable is only used when animating sprites so it wouldn't matter even if I set it to a wrong value . 2 Quote Link to comment Share on other sites More sharing options...
F.L Posted November 12, 2017 Author Share Posted November 12, 2017 ok, i was declaring 2x and maybe it was because of that it was not working! 1 Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted November 12, 2017 Share Posted November 12, 2017 in my precedent release, i was using the same method than you for hiding my backgrounds, exept that i did x =400 maybe it was not a good method than y=700 for the hardware and it does the glitches..? IIRC, when you're sending stuff off screen to not be displayed, it's best to use y as it'll be culled from the object list. If you use x, it'll still factor into calculations each life buffer pass it is present on in y. Also, think there's a danger it will reappear back on the other side of the screen. Quote Link to comment Share on other sites More sharing options...
F.L Posted November 12, 2017 Author Share Posted November 12, 2017 hello its me again with your help those days, i have done new important update of the rom try it, you will see what's new : the 4 scenaries and their trees are here and i can write on them i have done the animation of the goblin with a sprite sheet . this is the most difficult animation of this game to reproduce and it works fine now, i have all i need to do the game (exept the sound) this week i will begin the animation of players. there is 63 animations to do.i think it will take me a few days (weeks ?) . with those animations, the rom will quickly seems like a real game i will gave you some news of the advancement see ya 7 Quote Link to comment Share on other sites More sharing options...
F.L Posted November 15, 2017 Author Share Posted November 15, 2017 (edited) hello i have found a new method to manage my spritesheet, so the work is in good advancement but i must rename many values now 6 animations are soon active in the beta rom i'm happy because the animation is fluid. for the moment ,it's the most fluid animation i've done on a game console. the jaguar is very powerful !! only 49 to do see ya Edited November 15, 2017 by F.L 4 Quote Link to comment Share on other sites More sharing options...
F.L Posted November 19, 2017 Author Share Posted November 19, 2017 (edited) hello the dev is in good way all the animations are available (some little sprites are missing) and i must down the speed of the game i have done a video of the source and the build of the new beta rom https://www.youtube.com/watch?v=dz7ewvwwccM&feature=youtu.be Edited November 19, 2017 by F.L 7 Quote Link to comment Share on other sites More sharing options...
Sporadic Posted November 19, 2017 Share Posted November 19, 2017 Looking great! Good job 1 Quote Link to comment Share on other sites More sharing options...
+CyranoJ Posted November 19, 2017 Share Posted November 19, 2017 Awesome! What's better than one Barbarian on the Jaguar? Two Barbarians on the Jaguar! 2 Quote Link to comment Share on other sites More sharing options...
F.L Posted November 20, 2017 Author Share Posted November 20, 2017 Awesome! What's better than one Barbarian on the Jaguar? Two Barbarians on the Jaguar! and why not 7 barbarians on jaguar with my engine, it will be easy to do all the others. one thing could be more cool : to have all the 7 versions in only one rom! but for the moment i will finish this one...and there is work to do 5 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.