Alcoholics Anonymous escribió:The underlying gist of how the engine works as described in that post is still correct. And the features it describes are still in the current version of SP1. All the programs will still compile and run if the recent changes are taken into account (get rid of the tables you used to have to declare at the top of the file, change the calls to the sprite create functions, move the stack pointer lower in memory; spotting the differences from the sample program in the last post should make it clear) with the exception of the one using a screen$ as background. The current SP1 uses 16-bit tile codes, which can be a character 0-255 as used in splib2 or a memory address where a UDG is stored. So setting up a background screen involves writing 16-bit tile codes that point into a screen for each character square.
Nice. I remember that until I understood the philosophy of splib2 I could not use the library efficiently, so it's clear that my first step on learning SP1 will be understanding how the library works. I will start my reading as soon as possible, in "slow" moments at work.
The Screen$ as background thingy is an awesome feature that can come handy in games in the fashion of Pang and stuff. It can add really nice aesthetics. I understand how it is implemented and I think it's a pretty clever way of doing it!
[...]a tutorial would be great. If you spend some time understanding how the underlying engine works (a couple of posts near the beginning of that giant thread), the test programs will make a lot of sense and understanding the new features will be a lot easier.
That's what I'll do. I'll be taking notes about what I read and understand. Turning that into a tutorial isn't difficult. I love writing

Developing a game while I learn is also a good idea which connects with the next quote...
I think the first step is just to use SP1 as an improved splib2. Everything done in splib2 can be done in SP1 and you can even use the same API calls with changes only to the parameters.
That's what I'll do. I have Phantomas Saga 2: Salem completely planned and I need some of the new features of SP1 to make it look just like I want it to look. As soon as I understand how sprites work completely I think I'll be able to start it. I'll be using RAM pages as well, mainly to store compressed title screens and the map file, so I can switch pages, grab what I need, and switch pages again so SP1's structures are again present at the end of RAM. I don't need 16K of map data for this game, but the switching method will come handy with a future project we have which will feature a massive map, so I will test-drive it with Salem.
Let me comment on the improvements. They look fantastic
- SP1 is slightly faster.
- Code generated will be smaller. The data space required by SP1 is actually larger but I think in large projects the overall size will still be smaller.
I've seen the 7Kb demo you posted. The minimum footprint of splib2 was around 9Kb, so the improvement is quite visible. Plus, all those sprites move so fast. Cake
- You have complete control over the placement of SP1's data structures in memory, unlike splib2 which just attaches it all to your binary.
Awesome, specially when we are talking about page switching

It was quite possible with splib2 (Utopian did an awesome work with page switching in Cannon Bubble), but it will be easier with SP1.
- Several annoying things you've had to deal with in splib2 have been removed in SP1 (this is stuff that came up from discussions with you and from looking at your source code, so thanks!): a new sp1_MoveSprPix() function was added to move to pixel coordinates (you used to do all the % and / stuff which made the compiled code ugly), an absolute frame address can now be specified in the move functions (splib2 requires distance from last frame address which complicated matters), new members xthresh and ythresh in the struct_sp1_ss specify the minimum pixel shift required before the last column / last row of the sprite are drawn (you were using a clipping rectangle to stop colours from drawing into a neighbouring char cell caused by the sprite's blank column drawing even when it didn't need to; now the last column is not drawn when not needed).
That's simply amazing. I mean, it will come über-handy. Once you got the grip of the old method it wasn't very difficult to handle, but now it's absolutely intuitive and, as far as I can understand, much more flexible. The xthresh/ythresh stuff comes quite handy - the clipping rectangles around enemies worked fine with linear paths, but once you needed a more bumpy sprite it just didn't work.
And then I think you could start experimenting with some of the new features; I'll list some of them here and what their intended uses are:
- Sprites have attribute masks and attributes, intended to help with colour clash. SevenuP supports all of SP1's graphics and attribute formats.
Great. That way I can play with backgrounds more. Games will look better, that's for granted.
- Dedicated functions sp1_GetSprClrAddr(), sp1_PutSprClr(), sp1_GetSprClr() for quickly colouring sprites. Faster than the old way (and still valid way) involving sp1_IterateSprChar(). Intended to be used inside the game loop.
This is pretty cool, 'cause the sp_IterateSprChar() method was great for off-game loop colourings. Sprites that change color within the game loop - yay
- Quick animation of background tiles by changing tile graphics associated with a particular character code with sp1_TileArray() and then invalidating a list of affected char cells by iterating over them using sp1_IterateUpdateArr() or sp1_IterateUpdateRect(). Think flickering candles, twinkling stars, waving grass, etc.
At last! This thing was something I was quite expecting. MSX coders could do it quite easily as they have tile oriented graphic modes. In splib2 it would have been slowish and costy to manage. I'm glad this feature is now added to the library.
- Removal of individual character squares with sp1_RemoveUpdateStruct(). Draw the cell first with SP1, then remove it so that SP1 never draws to it again. Sprites will appear to move behind the cell. This can also be used to protect areas of the screen not drawn by SP1.
This has been taken in acount in the design of Saga 2: Salem

I've drawn some pretty "foreground tiles".
- Characters cells can be mapped to any character cell on the display[...]
Great. Nice way to save heaps of bytes
- Use of individual 8x8 pixel struct_sp1_cs sprite characters that are not attached to a sprite. [...]
This is pretty nice as well. I can't wait to place a nice foreground fence in Salem
- Customized draw functions for sprites or sprite characters. Maybe you want to alter background colour in a special way, or draw graphics in a different way than the standard mask, or, etc. Think draw functions that draw different graphics based on game state, mirrors and reflections in water (by controlling the order that squares are drawn you have access to a previously drawn square's final graphics).

this is simply great. Now the library is fully customizable. Man, congratulations. You've created such a clever, nice, incredibly useful piece of software! Now, with true reasons, all the sceners will hate and envy the Speccy scene!!!
Since you are already familiar with splib2, jumping into SP1 shouldn't be too much trouble since you can use it as an improved splib2. A lot more of the underlying mechanics of SP1 are exposed in order to make it a more powerful library so an understanding of how things work as described at the beginning of that giant post in WOS will make it much easier to understand and use the advanced features listed (and not listed) above!
Nice to know. Now I'm half as scared as I was before. And that helps
I was asked to post a z88dk snapshot at WOS so I'll reproduce the link here for those who don't feel like going the cvs route and would like to give it a try:
http://www.mediafire.com/?5o22ztdxwpw
THANKS. I can't make the cvs client work from where I work (ports closed and stuff like that). So thanks for the snapshot. Installing RIGHT NOW.
Cheers and thank you too. The day after you released Phantomas Infinity my web traffic went up 10 times for several months. The traffic has now settled to about 2-3x what it used to be so there has been sustained interest as a result of your games. I used to be able to tell when you were releasing a new game by a spike in interest in the site in the week prior to release but I can't do that anymore as there are now several people seriously using it.
That's great. I'm so glad

The thing is, I think there's a lot of "stubbornness" in the scene about which language you code in. It looks like that people don't consider "really usable" anything besides pure assembly. I think that it's been quite demonstrated that C + your library is an awesome combination for creating great games in half the time and with half the hassle than using pure assembly. Once people leave the general "stubbornness" I'm pretty sure that more people will be using this. C is quite easy to understand and provides easy portability among systems, so ... It's just a matter of time. Inside CEZGS there are now four coders besides me who are working using z88dk and your library
That looks incredibly sexy - but I'm still interested in that 64x48 multicolour library you talked about a while ago
Cheers and keep up the good work!