English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. Contest (http://eab.abime.net/forumdisplay.php?f=130)
-   -   Discussion: Rygar AGA Edition (http://eab.abime.net/showthread.php?t=93545)

AChristian 06 September 2018 19:19

thanks for answering my questions. The background goes green when he is not standing on a tile?

mcgeezer 06 September 2018 19:59

Over the last few days I've been working on the collision detection for the platforms, believe me there's two ways to do this and I now know the easiest route.

Route a) Blind debugging or b) Visible debugging!

Games that have poor collision detection are seldom good to play so that's why I've put a lot of effort into getting this bit right.

https://youtu.be/7SfWvorbseM

I'll try and explain what is going on in the video but you'll see I've added a lot of onscreen information to help with debugging, without it I was getting nowhere fast and with it I was able to nail it really well.
  • MAPOFX shows the current pixel position in the map.
  • TLOFFX shows the pixel offset of each tile on the X Axis with respect to where the scrolling is to the nearest 16 pixels.
  • SPROFX is the same as TLOFFX but it is in relation to the Rygar sprite.
  • TLLEFT is the tile number under the sprite on the left side
  • TLRGHT is the tile number under the sprite on the right side
  • TLLMSK is the bitmask for the TLLEFT tile
  • SPLMSK is the bitmask for the left part of the sprite
  • RSLMSK is the result of TLLMSK and'd with SPLMSK
  • TLRMSK,SPRMSK and RSRMASK are the right equivalent

if the result of RSLMSK is 0 then the sprite is not standing on any tile at all.

Now toward the end of the video I'm showing the tile and sprite definitions showing the ability to have fine grained collision detection.

Believe me, this wasn't easy...and getting it right is a must. But there it is working.

Next is an exciting bit that should be fairly easy in that I will be able to make the player jump and fall from tiles. As you can see from the video, the background goes Green when Rygar is not standing on a platform.

:great

Retro1234 06 September 2018 20:30

I really like what you've done, with games where all the tiles are 16*16 for example simple bounding could be used I usually use the analogy of a map editor in reverse a map reader but with Rygar it seems not all the solid objects seem to be 16*16 or 8*8 like the branches and rocks etc they seem unprecise sizes.

DamienD 06 September 2018 21:15

@mcgeezer; wow!!! :bowdown :bowdown :bowdown

I mean, I always knew game development has many different elements / factors / layers etc. but...

Thanks to your detailed posts / information, one really does get an understanding of just how complex things are and the huge amount of time involved to get everything perfect :great

Nibbler 06 September 2018 22:54

Exactly what DamienD said.
I tried it once myself and it made me almost :crazy.

Funny, when people complain today about the smallest things like ... ohh, there is a little FrameRate drop here , or a little Bug there , or Poppin or stuff like that, or that texture could be better - pfff absoule NUTS :nuts

STFU, you could not even make a PONG GAME :mad (sorry my language)

Bottom line, gamemaking is incredible tuff !

mcgeezer 06 September 2018 23:11

Another quick vid showing that hard work on the collisions...

As you can see, Rygar now interacts with the world.

Off to bed now. tired and I won't be coding again till Sunday or Monday as tomorrow night I'm fiddling with my new A1200 and having a good supp.

https://youtu.be/ghSBZn4yGxw

PS: As you can see it's not without bugs... (handy as I recorded it!)

DamienD 06 September 2018 23:53

Nice one, always improving things with every update :great

buzzybee 07 September 2018 09:47

Great to see your structured development approach, which results in steady progress. Quite fast too, if I may say so – I wish I would get as quick results with RESHOOT R :-)

I deeply appreciate your many updates here, as I know how much time this easts up. Many more people may now understand how many small little tasks have to be completed, just to get a hero run through a landscape.

Jump curve of the player objects looks nice. Must be great to have a the hero interact with its surroundings for the first time!

Hewitson 07 September 2018 11:36

Quote:

Originally Posted by mcgeezer (Post 1265994)
Sorry I don't know what one of those is? Happy to look into it though.

The FM chip in the original game was a YM3812. I am wanting to design a card for the Amiga that has one of these (and/or the YM2612 from the Megadrive).

Imagine being able to do arcade/MD ports with the original music intact. That would be fantastic.

mcgeezer 07 September 2018 11:43

Quote:

Originally Posted by buzzybee (Post 1267384)
Great to see your structured development approach, which results in steady progress. Quite fast too, if I may say so – I wish I would get as quick results with RESHOOT R :-)

I deeply appreciate your many updates here, as I know how much time this easts up. Many more people may now understand how many small little tasks have to be completed, just to get a hero run through a landscape.

Jump curve of the player objects looks nice. Must be great to have a the hero interact with its surroundings for the first time!

Thanks for the feedback. Indeed coding is both rewarding and time consuming, as you'll know with assembler you'll spend most of your time troubleshooting and refining code.

Just another small insight, what I did with Bomb Jack was keep a simple project plan to keep me focused which worked really well. As these are arcade games you already have a design template to work to.

I've been doing the same thing with Rygar.

http://109.228.4.199/rygartasks.png

As you can see, lots of work to be done.

Quote:

Originally Posted by Hewitson (Post 1267402)
The FM chip in the original game was a YM3812. I am wanting to design a card for the Amiga that has one of these (and/or the YM2612 from the Megadrive).

Imagine being able to do arcade/MD ports with the original music intact. That would be fantastic.

Nice, I'm happy to support it for my project but it would be best to wait until I've coded the game before you embark on a hardware project like that as I have no idea how long something like that would take you.

Retro1234 07 September 2018 11:54

So my question is how do you do collision please say in layman's terms :)

mcgeezer 07 September 2018 11:58

Quote:

Originally Posted by Retro1234 (Post 1267412)
So my question is how do you do collision please say in layman's terms :)

Do you mean in general or how I'm doing it?

Retro1234 07 September 2018 12:26

Yeah I just wondered how your hero and background collision works, Thanks.

ross 07 September 2018 12:33

Quote:

Originally Posted by mcgeezer (Post 1267406)
Indeed coding is both rewarding and time consuming
...

Every time I think you've impressed me, you hit me even more.
This worksheet is so professional.

You have to see my 'amiga' folder, a Dante's inferno circle..

:great

mcgeezer 07 September 2018 13:13

Quote:

Originally Posted by Retro1234 (Post 1267424)
Yeah I just wondered how your hero and background collision works, Thanks.

Each 16x16 tile in the world is numbered, 0-1023. Tiles that are platforms have an attribute associated with them.

For example, Tile 363 and 362 are the clay ground platforms so their attributes will be set to $ffff, this equates in a binary hit box of %1111111111111111.

Some tiles that have ledges might only have part of the platform set, so for example %1111111111110000 would mean it is a short ledge on the right side. If a tile has no attributes then that means Rygar passes through it which is the case for the majority of the tiles.

The Rygar sprite is 32 pixels wide, however not all of those pixels are used for collision so it also has an attribute with a hitbox. For example, you might just want to collide with Rygar's legs so the collision hit box looks like this because Rygar's feet only reach to where the 1's are.

%00000000111111111111111100000000



Now when Rygar passes over each tile in the world, the hit boxes from the sprite and the tiles are ran through a logical AND.

Code:

RYGAR  %00000000111111111111111100000000
TILE  %11111111111111110000000000000000
RESULT %00000000111111110000000000000000

If the result is anything other than zero then you know Rygar is standing on a tile.

The tricky bit to getting this working is to make it work with the scrolling and sprite movements properly.

Hope this helps.

ross 07 September 2018 13:23

Quote:

Originally Posted by mcgeezer (Post 1267444)
Each 16x16 tile in the world is numbered, 0-1023. Tiles that are platforms have an attribute associated with them.

Just curious, 1024 are a self-imposed limit or you use the upper bits for something special?
(like different collision masks, tile's animation, effects on player/enemies..)

mcgeezer 07 September 2018 13:28

Quote:

Originally Posted by ross (Post 1267448)
Just curious, 1024 are a self-imposed limit or you use the upper bits for something special?
(like different masks's collision, tile's animation, effects on player/enemies..)

I think there were about 1015 tile assets so I just chose 1024 and thought I might be able to use the remaining bits for something.

At the moment they're not used for anything but the thought occured they could be handy later on.

PS - thanks for the great feedback, really appreciated.

Retro1234 07 September 2018 15:01

Nice:great

AChristian 07 September 2018 21:54

Does the collision detection only check for collisions of Rygar vs scenery to his right when he is moving right?

That is the way i did it when i made a platformer demo (for javascript canvas)

Then you always check his feet for collision because gravity..(or density :) )

dlfrsilver 07 September 2018 22:02

Quote:

Originally Posted by mcgeezer (Post 1267450)
I think there were about 1015 tile assets so I just chose 1024 and thought I might be able to use the remaining bits for something.

At the moment they're not used for anything but the thought occured they could be handy later on.

PS - thanks for the great feedback, really appreciated.

Brilliant. My instinct tells me that you're doing and writing the legend.

Future will prove me right :)


All times are GMT +2. The time now is 02:48.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.

Page generated in 0.13804 seconds with 11 queries