Do you need tutorials ?
Moderator: Stef
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Do you need tutorials ?
Best way to learn SGDK is looking into the provided samples (in the sample folder).
The "sprite" sample is specially useful for sprite / background basic operations =)
The "sprite" sample is specially useful for sprite / background basic operations =)
Re: Do you need tutorials ?
I would love a tutorial on how to use collisions.
I have found some information on the forum describing ideas how it could be done but it would be very helpful with a sample project or tutorial, lets say two cubes (sprites) moving towards each other until they collide or perhaps a demo where multiple sprites are fiire out like bullets and collide with some other sprites.
That would be very helpful for me as collison is the next learning step for me, but I feel I got stuck here.
I have found some information on the forum describing ideas how it could be done but it would be very helpful with a sample project or tutorial, lets say two cubes (sprites) moving towards each other until they collide or perhaps a demo where multiple sprites are fiire out like bullets and collide with some other sprites.
That would be very helpful for me as collison is the next learning step for me, but I feel I got stuck here.
-
- Interested
- Posts: 15
- Joined: Tue Nov 13, 2018 8:42 pm
- Location: Germany
- Contact:
Re: Do you need tutorials ?
Question is not how collision is done at all, it is how to port it to sgdk in a functional way. There is no pixelperfect Sprite A collides Sprite B function, instead you should look around for general tutorials. its all math and cleverness to find the right collision for your needs.
Simple ways fitting to the power of Mega Drive are Rectangular Intersections or measure the distance (Sprite Middle + Radius to size of sprite vs each other).
The hardest part is to establish a QUADTREE if you have to handle many Sprites on screen to reduce the calls and minimize slowdown.
http://www.euclideanspace.com/maths/geo ... /index.htm
https://www.codeproject.com/Articles/30 ... ation-in-C
Simple ways fitting to the power of Mega Drive are Rectangular Intersections or measure the distance (Sprite Middle + Radius to size of sprite vs each other).
The hardest part is to establish a QUADTREE if you have to handle many Sprites on screen to reduce the calls and minimize slowdown.
http://www.euclideanspace.com/maths/geo ... /index.htm
https://www.codeproject.com/Articles/30 ... ation-in-C
“No one in the world gets what they want and that is beautiful.” “You'd be amazed how much research you can get done when you have no life whatsoever.” “I created the OASIS because I never felt at home in the real world."
Ernest Cline
Ernest Cline
Re: Do you need tutorials ?
My guess is that what segaMars is really asking is how to organize, how to structure a game; from a top perspective.
HELP. Spanish TVs are brain washing people to be hostile to me.
-
- Interested
- Posts: 15
- Joined: Tue Nov 13, 2018 8:42 pm
- Location: Germany
- Contact:
Re: Do you need tutorials ?
I know its a little bit off sgdk but i suggest you to look into monogame. Its c# and coming out of the discontinued Microsoft xna. It has a strong comunity, lots of samples, open source, games and stuff to study game mechanics, how concepts work etc
“No one in the world gets what they want and that is beautiful.” “You'd be amazed how much research you can get done when you have no life whatsoever.” “I created the OASIS because I never felt at home in the real world."
Ernest Cline
Ernest Cline
-
- Interested
- Posts: 15
- Joined: Tue Nov 13, 2018 8:42 pm
- Location: Germany
- Contact:
Re: Do you need tutorials ?
https://jonathanwhiting.com/tutorial/collision/
Another nice one collision handling tile vs sprite.
Anyone got s good one for diagonal checks?
XXXXX
X0XX
XXX
XX 1
X
Another nice one collision handling tile vs sprite.
Anyone got s good one for diagonal checks?
XXXXX
X0XX
XXX
XX 1
X
“No one in the world gets what they want and that is beautiful.” “You'd be amazed how much research you can get done when you have no life whatsoever.” “I created the OASIS because I never felt at home in the real world."
Ernest Cline
Ernest Cline
Re: Do you need tutorials ?
This implementation has several big problems, that’s not how 2D games did it. Check for the article of one of the programmers of M.C. Kids for NES. That's a good start.
To obtain diagonal movement, move first the biggest axis in a recursive way, like previous text explains; I believe.
To obtain diagonal movement, move first the biggest axis in a recursive way, like previous text explains; I believe.
HELP. Spanish TVs are brain washing people to be hostile to me.
-
- Interested
- Posts: 15
- Joined: Tue Nov 13, 2018 8:42 pm
- Location: Germany
- Contact:
Re: Do you need tutorials ?
Do you have a link for me?
I started using math formula
(AxAy Start of the Line, BxBy End of the line, XY Point to check)
to determinate a left (-1) or right (1) of the line. It works and im half on the way but i have a hard time, very fuzzy and lots of trial and error
I started using math formula
Code: Select all
position = sign((Bx - Ax) * (Y - Ay) - (By - Ay) * (X - Ax))
to determinate a left (-1) or right (1) of the line. It works and im half on the way but i have a hard time, very fuzzy and lots of trial and error
“No one in the world gets what they want and that is beautiful.” “You'd be amazed how much research you can get done when you have no life whatsoever.” “I created the OASIS because I never felt at home in the real world."
Ernest Cline
Ernest Cline
Re: Do you need tutorials ?
I'm doing an action RPG, somewhat based on a Zelda game, and haven't used a single multiplication yet; no even accessing array like structures. It needs some thinking sometimes but on a "real time" game, or a game that there aren't jumps on time, multiplication isn't completely necessary. I use shifts for multiplication proposes do.
For a collision with terrain:
https://games.greggman.com/game/programming_m_c__kids/
For a collision with terrain:
https://games.greggman.com/game/programming_m_c__kids/
HELP. Spanish TVs are brain washing people to be hostile to me.
-
- Interested
- Posts: 15
- Joined: Tue Nov 13, 2018 8:42 pm
- Location: Germany
- Contact:
Re: Do you need tutorials ?
zelda game eh? high five
me too...
hard to believe! mine is full of math :/
You can have a look into if you dont mind "very messy places"
https://drive.google.com/open?id=1jqxbX ... iTjQgLAF51
![Very Happy :-D](./images/smilies/icon_biggrin.gif)
hard to believe! mine is full of math :/
You can have a look into if you dont mind "very messy places"
![Razz :P](./images/smilies/icon_razz.gif)
https://drive.google.com/open?id=1jqxbX ... iTjQgLAF51
“No one in the world gets what they want and that is beautiful.” “You'd be amazed how much research you can get done when you have no life whatsoever.” “I created the OASIS because I never felt at home in the real world."
Ernest Cline
Ernest Cline
Re: Do you need tutorials ?
Didn’t say anything about maths
. Look, if you understand a sum takes about 4 cycles and a mul wastes about 140 cycles, it’s fine if you use mul’s or not.
What I’m saying is…. we are not trying to calculate when the trains will collide in the future, but what a game actually does is moving the two trains in the present. It’s not exactly like in math class.
By jumping in space a lot of problems will occur, bullet through paper is only the first of them, and by applying patches you are only doing it worst. If you jump in diagonal is even worst, you can skip tiles altogether.
I tell you this because I have been there.
![Wink ;)](./images/smilies/icon_wink.gif)
What I’m saying is…. we are not trying to calculate when the trains will collide in the future, but what a game actually does is moving the two trains in the present. It’s not exactly like in math class.
By jumping in space a lot of problems will occur, bullet through paper is only the first of them, and by applying patches you are only doing it worst. If you jump in diagonal is even worst, you can skip tiles altogether.
I tell you this because I have been there.
HELP. Spanish TVs are brain washing people to be hostile to me.
-
- Interested
- Posts: 15
- Joined: Tue Nov 13, 2018 8:42 pm
- Location: Germany
- Contact:
Re: Do you need tutorials ?
Well, thats a statement! Is there a way to see how much load my routines throw up and how much cpu time is left until a "slowdown" happens? In xna/monogame you could measure times and guess what graphics part, gamelogic part etc. Consumes. But Mega Drive sadly has no clock :/
Btw my directional collisions work fine for now ;-D *does a floss dance*
Btw my directional collisions work fine for now ;-D *does a floss dance*
“No one in the world gets what they want and that is beautiful.” “You'd be amazed how much research you can get done when you have no life whatsoever.” “I created the OASIS because I never felt at home in the real world."
Ernest Cline
Ernest Cline
Re: Do you need tutorials ?
What I do is put 10/20/30/40 foes at the same time and see how it escalates.
The diagonal problem usually triggers when solid tiles are also in a diagonal fashion, like this:
XO
OX
also, not all tiles have to be only solid or hollow; could be "in between" states then it's simple laughable.
The diagonal problem usually triggers when solid tiles are also in a diagonal fashion, like this:
XO
OX
also, not all tiles have to be only solid or hollow; could be "in between" states then it's simple laughable.
HELP. Spanish TVs are brain washing people to be hostile to me.
Re: Do you need tutorials ?
The HV counter gives you a loose idea by telling you where the VDP is currently rendering in the frame (the value is kind of bogus if it's in vblank, but in that case it's either too little to care or you ran into the next frame and it's obviously over 100%). You figure out how to display this in a reasonable way.darkjoy2k2 wrote: ↑Mon Dec 03, 2018 9:47 pmWell, thats a statement! Is there a way to see how much load my routines throw up and how much cpu time is left until a "slowdown" happens? In xna/monogame you could measure times and guess what graphics part, gamelogic part etc. Consumes. But Mega Drive sadly has no clock :/
Another common trick is to change the background color as the logic runs, but that requires 1) a way to see the background color (either leave some gap where it's visible or make sure you can see border) and 2) that you aren't using raster effects (as it changes VDP state).
Sik is pronounced as "seek", not as "sick".
Re: Do you need tutorials ?
Last method is very neat Sik, the fact that you can see it visually gives it much credit.
But,
- You have to add vblank time to it
- Hope that that color is present all along the screen
Also music is very noticeable when suffers a slowdown, even very few frames.
At the end of the day all you need is some red light when frames drops, then adjust number of entities/actors/objects/scripts present and recheck difficulty.
But,
- You have to add vblank time to it
- Hope that that color is present all along the screen
Also music is very noticeable when suffers a slowdown, even very few frames.
At the end of the day all you need is some red light when frames drops, then adjust number of entities/actors/objects/scripts present and recheck difficulty.
HELP. Spanish TVs are brain washing people to be hostile to me.