30

hine62 (./29):
Use: aSpriteSetPos(&enemy, x, y); to move position. You could also use aSpriteMovePos(&enemy, xVel, yVel); also. Set well move sprite to screen location, but Move adds a velocity to the current position.

I mean, the enemy must "stay at post" at his sroller section, but not to "get in touch" with a player's sprite, wherever it move.
avatar

31

It's not animating because aSpriteAnimate() isn't in your main loop.

It's not moving becase, well, you never update its position, why whould he ?

Virus in your archive BTW.

32

HPMAN (./31):
It's not animating because aSpriteAnimate() isn't in your main loop.

It's not moving becase, well, you never update its position, why whould he ?

Thanks. Now I solved the problems I listed previously, but problem of sprite order at the screen is left - even if player's sprite is "lower" than enemy's sprite, the enemy all the same left to stay at the foreground.

tromb Fichier joint : gfbj

Virus in your archive BTW.

I don't know how this virus could get to archive. Yandex.Disk are checking every uploaded file by Dr. Web and labels any suspicious file.
avatar

33

Bmary spr is drawn via a sprite pool using sprites 62-141.
Enemy is using allocated mode with sprites 142+

Of course it's always going to be on top.

Put it in pool with the other one(s) and Y sort them.


TBH it looks like you have no idea what you are doing grin

34

HPMAN (./33):
Put it in pool with the other one(s) and Y sort them.

I added them to pool. But how to Y sort them?
avatar

35

sortSprites() ?

confus

36

HPMAN (./35):
sortSprites() ?

confus

I see this command, but what like must look a code, responsible for sorting by Y exactly, and what part of command I need to put this code to?
avatar

37

It's used in the supplied sample code.

38

Hi HPMAN,

I'm having trouble with aSpriteHide. Could give me an example? I can create aSprite,, but at the end of animation aSpriteHide does remove the sprite. It also looks like aSpriteAnimate has to be called one more time to use aSpriteSetPos also.

Thanks.
Hine62
avatar

39

HPMAN (./37):
It's used in the supplied sample code.

Thank you. Looks like I acted very right, when I didn't delete a service functions.
Now enemy sprite works properly, and also I fixed some minor mistakes I hadn't observe earlier.

tromb Fichier joint : KmbL

tromb Fichier joint : 2SM7
avatar

40

Hi VasiliyFamiliya,

Glad to see you are back on track. The y sort is a wicked function HPMAN hooked up!
I have always wanted to play with it!

Now make us all proud and make the sickest Neo Geo Beat'em up ever made!

Hi Hine62,

I can create aSprite,, but at the end of animation aSpriteHide does remove the sprite.
I think you meant to does not remove the sprite....thinking about it you probably meant that but aSpriteHide is not part of the problem.

Keep in mind if you are not using sprite pools you need to call aSpriteAnimate in your main loop. Chances are this is your issue...
Off the top another thing is that sometimes moving something that is hidden can make it reappear. (I'm pretty sure pictures work in this way...not sure about sprites)
What I mentioned is stated better in the documentation.

Hi HPMAN!

Thank you for the idea on just clearing the sprites for hiding scrollers.
Sometimes the most straight forward idea eludes me....

I have been enjoying colour streaming and have ran into a snag.
I have a four frame filmstrip I am attempting to loop.
I have tried many variations however whatever I try I get gfx gliches on the first frame of the loop.
Curious if you can achieve a seamless loop.

The image provided should be less than 180 pals per screen.

IzxE

41

Probably you overflow the palette jobs buffer when rewinding to posion 0.

Just redo a stream init when looping.

42

Thanks HPMAN.

I'm not using sprite pools which could be the problem, I'll be looking in to them to clean up this code.
avatar

43

Hi HPMAN!

Thanks for the advice!
I have tried that technique and retried it after you mentioned it but still the damn glitch!

Wanted to make dually sure I wasn't wasting your time so I extracted images to make sure when compiled as pictures their pal counts were below 180.
The image just confirms what I stated earlier.
I will make a basic test and post the code I am using as soon as I get a chance.

Pjfd

**Edit

This code compiles and displays the glitch.....
I tried to keep it as basic as possible...sorry for the bad form...

Infinite vertical Color Stream Loop

#define TRUE 1 #define FALSE 0 #define HOLD 10 int main(void) { scroller sc; colorStream stream; short posY=0; BYTE Init_Loop = TRUE; BYTE Frame=0; initGfx(); while(1) { SCClose(); waitVBlank(); if (++Frame==HOLD)//Wait for the hold before incrementing to the next frame { Frame=0; posY+=224; } if ((Init_Loop==TRUE) || (posY==896)) //Init Loop OR Total Length of Film Strip { Init_Loop=FALSE; posY=0; Frame=0; //Scroller Init on every Loop scrollerInit(&sc,&RyuRun,1,16,0,0); colorStreamInit(&stream,&RyuRun_colorStream,16,COLORSTREAM_STARTCONFIG); } scrollerSetPos(&sc,0,posY); colorStreamSetPos(&stream,posY); } }

44

Only glitch I see is color issue because there's too much palette data being loaded (204 palettes at init)

180504054646466083.png

45

Hi HPMAN!

Thank you and sorry!
Another misunderstanding on my part.
I believed that as long as each frame was below 180 pals when compiled individually I was in the clear to make a filmstrip of those frames.

When a Vertical Scroller compiles what is the maximum number of slots that can be allocated before colour glitching occurs?
(I assume based on previous discussions anything above 180 is not safe)

Just looking to ensure I am right in my thinking moving forward.

**Edit - I reduced the image down to "colorStream [151 slots]" and if you use the code I posted above there is a small but noticeable colour glitch at the top of the image upon loop....

Curious if this can be avoided....
The optimized image I used is here...

H6ub

46

Buildchar doesn't scan the scroller on a frame basis. Even if each frame is 180 palettes, you end up with more slots as inbetween positions will require more palettes.

Available timing depends on other pending jobs (tile data etc), It takes roughly 200 cycles (100px screen time) to handle a one palette load job. So roughly you have to cut 4 palettes per badly colored line.

47

Hi HPMAN!

Thank you very much for the insight!
I intend to use the new functionality extensively.

About the issue above. I was Init'ING the Scroller per loop which caused the interference. By only doing the scrollerInit once and re-calling the colorStreamInit per loop. The example loops perfectly.

Thanks again!

48

Hi HPMAN!

I was playing in the Animator tool tonight.
First many thanks again as the tool is beautiful.
Over the years I have gathered a few suggestions I thought I might put in the ballet box.

You see you give people an awesome tool and they ask for stupid shit like this....

Here are three wishes with supporting images.

1. The ability to rename animations....I often have bad names initially and then overtime refine my animation names. I figured out the backdoor method to do this but wish the Animator tool supported this feature as it is a cumbersome task.
2. The ability to re-sequence animations....when you have several animations sometimes the order of the animations get out of hand...a nice way to order the listings would help for obsessive people....
Suggest "up" and "down" arrows to move highlighted records (Multi-selectable records would kick ass...moving one record at a time is also stellar)
3. **The ability to only move the selected frames. EX: If you have 1 frame that is placed perfectly you might want to move all but one frame....by the same token you might want to move several but not all frames at once.

The tool would be perfect in my mind if these features were added....Sorry to be a bother.

evnE
bXss

49

I'll look into that when revisiting.

I guess you figured to edit the XML file meanwhile smile

50

It's interesting, is there a sprites scaling function in DATlib?
avatar

51

Not at the moment.

52

I have been meaning to show this and ask for some advice. I tried my hand at scaling sprite pools. You will probably make fun of my technique but I managed to maintain the scale of hidden and shown sprites! Which is tricky because the pool expands and contracts meaning the sprite scale of the hidden sprite can be applied to a non-hidden sprite if you are not careful! My only issue is jitter where the scale digression progression is choppy and not smooth. A standard scale in my mind should smoothly scale on the center point of the sprite. I belive the jitter is from slightly different x,y values on my way up and way down.

I will prepare a small demo and release it on this thread in a few days. Hoping HPMAN can give me an A for effort.

53

Not sure if this is what you are looking for...

I use this to shrink sprites:

void ZoomSprite(int baseSprite, int numSprite, int x, int y) { int i; for(i = 0; i < numSprite; i++) { SC234Put(VRAM_SHRINK_ADDR(baseSprite + i), VRAM_SHRINK(x, y)); } }
baseSprite is the saved address of the first line sprite. numSprite is how many line sprites are linked together. x is the horizontal shrink factor (0-16). y is the vertical shrink factor (0-255). I still need to figure out the math, but you have to divide the y shrink by the % of the x shrink. i.e. x = 8 (shrink by half) y = about 128 (approx. half of 255)

You may want to look up shrinking on the NeoGeo Dev website to understand more.
avatar

54

hine62 (./53):
Not sure if this is what you are looking for...

I use this to shrink sprites:

void ZoomSprite(int baseSprite, int numSprite, int x, int y) { int i; for(i = 0; i < numSprite; i++) { SC234Put(VRAM_SHRINK_ADDR(baseSprite + i), VRAM_SHRINK(x, y)); } }
baseSprite is the saved address of the first line sprite. numSprite is how many line sprites are linked together. x is the horizontal shrink factor (0-16). y is the vertical shrink factor (0-255). I still need to figure out the math, but you have to divide the y shrink by the % of the x shrink. i.e. x = 8 (shrink by half) y = about 128 (approx. half of 255)

You may want to look up shrinking on the NeoGeo Dev website to understand more.

What DATlib source file we must put this piece of code in?
avatar

55

I have a file called GraphicsFunction.c that is included at the top of any source code that needs this function. You could put this at the top of whatever code file you need it in.

It doesn't need to go in any DATlib source file.
avatar

56

hine62 (./55):
I have a file called GraphicsFunction.c that is included at the top of any source code that needs this function. You could put this at the top of whatever code file you need it in.

It doesn't need to go in any DATlib source file.


Maybe, it's should to integrate this function with DATlib?
avatar

57

I have other functions that I've rewritten in asm in a file called libGamFun.s (Lib Game Function). I haven't done this function yet.
avatar

58

hine62 (./57):
I have other functions that I've rewritten in asm in a file called libGamFun.s (Lib Game Function). I haven't done this function yet.

OK, well wait till functioions necassary for scaling will be complete, and after that it's will be need to think about integration of this functions with DATlib.
avatar

59

Hi Hine62,

Thanks for sharing your method for Sprite Scaling! In my case I am trying to Scale Sprite Pools.
I have modeled my projects around Sprite Pools but the missing link is scaling.

Hi HPMAN!

My hope is you will see although very wrong I did do my best to put elbow grease into this problem.
Again very much for the record appreciate what you have done for the community with this library!
I apologize in advance.

Mame files are here: https://www.dropbox.com/s/7zqkdo5vz4599ww/DDsprdmoMAME.zip?dl=0

Driver I used is in a .txt it needs to be patched into your hash folder via neogeo.xml

Source files are here: https://www.dropbox.com/s/f029ztwuxu7xxek/DDSpritePoolDemoSOURCE.zip?dl=0

General Notes

I used banking so the syntax on functions is different than usual also NeoDev environment will need the bank stuff in place to compile the source .

*Syntax could be useful for people looking to incorporate banking into their projects.
*My projects use similar structs hoping it might be useful for someone to see how I group and declare variables.

Instructions for this broken demo

Joystick Instructions are plainly stated on the screen. Player 2 must be mapped.

Movement: Any character can be moved.
Y Sort: Function can be uncommented in "RenderSpritePool" (Compiled version has no Y sort)
Scale: Most interesting part of the demo
Hide/Show: Hide and Show Sprites and attempt to track their "way up" and "way down" sprite index. (Debug Info can be uncommented to see what I was thinking)

All these things are kinda good if you only do one of the things mentioned above.

My suggestion is to do 1 thing listed below and reset the demo and try another thing.
When you combine things the demo starts to break.

1. Attempt to only SCALE sprites on your first run on the demo.
You will see jank sprite scaling (Probably the best part of this demo)

Looking closely strips have small gaps at times.
The anchoring is garbage.
I wish I could get insight on how to adjust the anchor point of the scale.
EX: How to scale a sprite from its direct center.
EX: How to scale a sprite anchoring the scale to the position of the sprites feet.
EX: Burnov is interesting because he has a frame that expands and contracts which will reveal Abobo's toe how can that be avoided?

2. On the second run Hide/Show Sprites....This was always supported by DATLib but in my case I am trying to re-index my variables to determine where sprites are on the list.

EX: Uncomment the Debug Statement in main to see the way I thought the list was working behind the scenes.
EX: I am a liar I swear I had scaling working with hide and show but you will find this is broken.
EX: Hide/Show Billy then Scale Billy and Abobo scales I am ashamed that I suck

Any insight on better techniques, how sprite pools work, anchoring scaling would be greatly appreciated.

60

Mega Shocked (./59):
Hi Hine62,

Thanks for sharing your method for Sprite Scaling! In my case I am trying to Scale Sprite Pools.
I have modeled my projects around Sprite Pools but the missing link is scaling.

Hi HPMAN!

My hope is you will see although very wrong I did do my best to put elbow grease into this problem.
Again very much for the record appreciate what you have done for the community with this library!
I apologize in advance.

Mame files are here: https://www.dropbox.com/s/7zqkdo5vz4599ww/DDsprdmoMAME.zip?dl=0

Driver I used is in a .txt it needs to be patched into your hash folder via neogeo.xml

Source files are here: https://www.dropbox.com/s/f029ztwuxu7xxek/DDSpritePoolDemoSOURCE.zip?dl=0

General Notes

I used banking so the syntax on functions is different than usual also NeoDev environment will need the bank stuff in place to compile the source .

*Syntax could be useful for people looking to incorporate banking into their projects.
*My projects use similar structs hoping it might be useful for someone to see how I group and declare variables.

Instructions for this broken demo

Joystick Instructions are plainly stated on the screen. Player 2 must be mapped.

Movement: Any character can be moved.
Y Sort: Function can be uncommented in "RenderSpritePool" (Compiled version has no Y sort)
Scale: Most interesting part of the demo
Hide/Show: Hide and Show Sprites and attempt to track their "way up" and "way down" sprite index. (Debug Info can commented to see what I was thinking)

All these things are kinda good if you only do one of the things mentioned above.

My suggestion is to do 1 thing listed below and reset the demo and try another thing.
When you combine things the demo starts to break.

1. Attempt to only SCALE sprites on your first run on the demo.
You will see jank sprite scaling (Probably the best part of this demo)

Looking closely strips have small gaps at times.
The anchoring is garbage.
I wish I could get insight on how to adjust the anchor point of the scale.
EX: How to scale a sprite from its direct center.
EX: How to scale a sprite anchoring the scale to the position of the sprites feet.
EX: Burnov is interesting because he has a frame that expands and contracts which will reveal Abobo's toe how can that be avoided.

2. On the second run Hide/Show Sprites....This was always supported by DATLib but in my case I am trying to re-index my variables to determine where sprites are on the list.

EX: Uncomment the Debug Statement in main to see the way I thought the list was working behind the scenes.
EX: I am a liar I swear I had scaling working with hide and show but you will find this is broken.
EX: Hide/Show Billy then Scale Billy and Abobo scales I am ashamed that I suck

Any insight on better techniques, how sprite pools work, anchoring scaling would be greatly appreciated.

What do you think about idea to recode this demo to racing game engine?
avatar