English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Contest

 
 
Thread Tools
Old 06 September 2018, 19:19   #241
AChristian
Registered User
 
Join Date: Aug 2018
Location: england
Posts: 24
thanks for answering my questions. The background goes green when he is not standing on a tile?
AChristian is offline  
Old 06 September 2018, 19:59   #242
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
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.

[ Show youtube player ]

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.

mcgeezer is offline  
Old 06 September 2018, 20:30   #243
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,773
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.
Retro1234 is offline  
Old 06 September 2018, 21:15   #244
DamienD
Banned
 
DamienD's Avatar
 
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
@mcgeezer; wow!!!

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
DamienD is offline  
Old 06 September 2018, 22:54   #245
Nibbler
namm namm AMIGA
 
Nibbler's Avatar
 
Join Date: Jan 2015
Location: Austria
Age: 44
Posts: 734
Exactly what DamienD said.
I tried it once myself and it made me almost .

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

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

Bottom line, gamemaking is incredible tuff !
Nibbler is offline  
Old 06 September 2018, 23:11   #246
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
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.

[ Show youtube player ]

PS: As you can see it's not without bugs... (handy as I recorded it!)
mcgeezer is offline  
Old 06 September 2018, 23:53   #247
DamienD
Banned
 
DamienD's Avatar
 
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
Nice one, always improving things with every update
DamienD is offline  
Old 07 September 2018, 09:47   #248
buzzybee
Registered User
 
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 526
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!
buzzybee is offline  
Old 07 September 2018, 11:36   #249
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,771
Quote:
Originally Posted by mcgeezer View Post
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.
Hewitson is offline  
Old 07 September 2018, 11:43   #250
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by buzzybee View Post
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.



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

Quote:
Originally Posted by Hewitson View Post
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.

Last edited by mcgeezer; 07 September 2018 at 12:46.
mcgeezer is offline  
Old 07 September 2018, 11:54   #251
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,773
So my question is how do you do collision please say in layman's terms
Retro1234 is offline  
Old 07 September 2018, 11:58   #252
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by Retro1234 View Post
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?
mcgeezer is offline  
Old 07 September 2018, 12:26   #253
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,773
Yeah I just wondered how your hero and background collision works, Thanks.
Retro1234 is offline  
Old 07 September 2018, 12:33   #254
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by mcgeezer View Post
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..

ross is offline  
Old 07 September 2018, 13:13   #255
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by Retro1234 View Post
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.
mcgeezer is offline  
Old 07 September 2018, 13:23   #256
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by mcgeezer View Post
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..)
ross is offline  
Old 07 September 2018, 13:28   #257
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by ross View Post
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.
mcgeezer is offline  
Old 07 September 2018, 15:01   #258
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,773
Nice
Retro1234 is offline  
Old 07 September 2018, 21:54   #259
AChristian
Registered User
 
Join Date: Aug 2018
Location: england
Posts: 24
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 )
AChristian is offline  
Old 07 September 2018, 22:02   #260
dlfrsilver
CaptainM68K-SPS France
 
dlfrsilver's Avatar
 
Join Date: Dec 2004
Location: Melun nearby Paris/France
Age: 46
Posts: 10,412
Send a message via MSN to dlfrsilver
Quote:
Originally Posted by mcgeezer View Post
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
dlfrsilver is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Entry: Rygar AGA Edition mcgeezer Coders. Entries 75 28 February 2019 20:41
On the Ball - World Cup Edition AGA djcasey request.Old Rare Games 4 25 January 2013 12:39
On The Ball League Edition AGA , Player Manager 2 StarEye Games images which need to be WHDified 11 22 January 2010 18:21
The Vague #1 AGA-RTG edition is released ! kas1e Amiga scene 12 30 October 2007 00:27
On The Ball: World Cup Edition AGA CodyJarrett request.Old Rare Games 11 27 May 2003 06:14

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:15.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.15102 seconds with 16 queries