News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_ervin

Chunky Pixel Collision

Started by ervin, 15:35, 15 December 10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ervin

#125
Quote from: arnoldemu on 09:28, 28 June 11
@ervin: Great as always.
It is good to see your progress, and I think everyone is excited to see what the future brings for your game.

Thanks Kev.
Coming from you, that's high praise indeed.

Update time!

This version adds a second bloke to the screen, along with a bit of slowdown.
However, optimisation has not yet begun. It'll be heaps faster very soon.  :(

The 2nd bloke (I won't say who he is) is from a mode 1 game, so his sprite routine needed a few subtle changes.
My "engine" can handle mode 1 and mode 0 sprites. Mode 2 sprites won't get a look-in. I'm sure no one will have a problem with this.  :)

I've also managed to make sprite memory usage more efficient.
All the scaling matrices are now stored in arrays with 29 rows.
Each row contains x columns (ie. x bytes).

Each byte contains information for 8 pixels - ie. whether or not 8 pixels should be skipped or displayed during scaling. I learned about byte-packing recently, and the technique has come in very handy indeed.

For example, Savage's entire sprite scaling matrix takes up 29*7=203 bytes.
So in the end, I've now got Savage in my program, facing left and right, with 30 scaling levels (29 scaled, 1 unscaled) only taking up 899 bytes.

If you're interested, load up the attached dsk file and have a look.
I hope you enjoy it.

Gryzor

Hahaha! The second character is totally random :D (for some reason I used to like the game, even though I didn't get anywhere with it).

So when is this starting to be the next megagame? ;)

ervin

#127
Quote from: Gryzor on 18:57, 10 July 11
Hahaha! The second character is totally random :D (for some reason I used to like the game, even though I didn't get anywhere with it).

So when is this starting to be the next megagame? ;)

Yes, Cuchulainn was the biggest mode 1 sprite I could think of at the time (along with John Marsh from Marsport of course), so he had to be the one.

It's interesting, as I was typing this reply, I decided to find out (after all these years) how to pronounce the name.
Luckily there's a "Listen" link on the wikipedia page about him.
http://en.wikipedia.org/wiki/C%C3%BA_Chulainn

The character himself is very interesting as well. I dunno why it took me this long to look into it!
(Carter and Follis would raise a collective eyebrow - I used to think Cuchulainn was a Scottish hero - he's actually Irish).

Next megagame? I hope so!
The optimisation of the sprite routines is coming along nicely.
Sprite scaling inconsistencies between flipped/unflipped sprites have been addressed, and sprite clipping has been sped up a lot as well.

Once I'm happy with the sprite routines, I'll get back into the 3D road!  8)

Bryce

Hmmm, ask anyone who's Irish, we had all that Cú Chulainn / Táin Bó Cúailnge / Tír na nÒg shite beaten into us in primary school. A seriously boring pain in the arse if you ask me, but at least it was better than Peig Sayers :D (Only Irish people will have even the slightest idea what I'm talking about).

Bryce.

MaV

Quote from: Bryce on 10:49, 11 July 11but at least it was better than Peig Sayers :D (Only Irish people will have even the slightest idea what I'm talking about).

I can imagine quite clearly what you meant: http://en.wikipedia.org/wiki/Peig_Sayers
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

Gryzor

Why bash your mythology? Granted, the wikipedia articles are too long and it's too hot for me to digest them, but usually mythologies are really fascinating (I should say so, my gal is a greek mythology buff).

Bryce

I'm not bashing the Mythology, rather the way it was taught to us in school  ::)

Bryce.

Gryzor

Seriously, how badly can mythology be taught at school? History, sure, I've seen it butchered again and again, but mythology is a collection of fairy tales for chrissakes!

Bryce

Not where I come from. Here they tend to blur the lines and teach it to you like history, having to learn every detail and relationship between characters in the end you're not sure what's real and what's not. It's also not as interesting as Greek Mythology, due to the fact that it doesn't include Gods that whack you with bolts of lightening or the Sea dwelling, Fork holding types either. In fact Cú chulainns claim-to-fame was killing some blokes dog (Culainn) and then offering to be that blokes dog as a replacement (Cú Culainn = Culainns Hound).

Peig (or Pig as we called it) is an endlessly long monotonous lifestory of a depressed woman living on a poverty-stricken baren island with crap weather, where absolutely nothing ever happens, recalling in mind-numbing detail every coma-inducing, boring detail of her fruitless existance. On top of that, you're not allowed read it in English, only in Irish. but that's just my (and most 70's/80's Irish pupils) opinion, but don't take my word for it, grab a copy and let me know what you think :D It's a real chuckle.

Bryce.

ervin

Quote from: Gryzor on 15:57, 11 July 11
Why bash your mythology? Granted, the wikipedia articles are too long and it's too hot for me to digest them, but usually mythologies are really fascinating (I should say so, my gal is a greek mythology buff).

LOVE Greek mythology. I've been into it since I was a young boy.
My all-time favourite is the story of Perseus.
As a result, I found the recent "de-make" of Clash of the Titans tremendously hurtful!  >:(

Gryzor

You watched that? The shame's on you :D

Wish someone did a tv-series about Greek mythology - it's a proper soap-opera, only with lots more blood and sex -, in the style of Spartacus/Gods of the Arena. That would be something.

@Bryce: I should really check these stories out; if nothing else, because I bet there's something deeper in there. Taking the place of a dog sounds very disturbed in a Freudian sense. Not all mythology has to feature guts and glory, after all (though it is of course better material for statues and temples and all).

Interesting trivia: depending on which myth you draw from, Zeus had a few dozens of children, of course most of them illegitimate. Now *that's* life.

ervin

#136
Quote from: Gryzor on 06:47, 12 July 11
You watched that? The shame's on you :D

Yes, when I first saw the trailer, I was jumping out of my skin with excitement.
I loved the original Clash (starring a big-haired Harry Hamlin), and I thought a modern version with CGI monsters would be excellent.

How wrong I was...  :'(

I believe Sam Worthington actually apologised for his appalling performance as Perseus.
PLANKseus, more like!

To give it some credit though, the Medusa scene was FANTASTIC.
Pity everything else in it was utter tripe.

robcfg

I only liked the Medusa Scene, Hades (specially at the end of the film when he appears in the middle of the air and show the black, smokey wings), and Gods' armors.


The rest is totally bullshit.


For god's sake! I have the DVD of the original film sing by Ray Harryhausem himself! The new film almost made cry, what a horrible movie...

ervin

I thought the idea of Hades as an evil character was ridiculous. That just didn't match with the mythology at all.

Serious?!?!?! Signed by Harryhausen himself?!?!?!
:o 8)
Awesome!

robcfg

Yep, and Jason and the Argonauts too!  8)


He came some years ago to the Comic Con in Barcelona and I had the chance to get my movies signed.


Even feeling not so well and coming in in a wheelchair, he was pretty charming with everybody and showed us a big smile.


Nice to see more people here that like classic movies, but that's for an off-topic thread, hehe  ;D

ervin

#140
Update time.

So close...
I'm really close to releasing what I hope will be the final version of the sprite code.

I've managed to combine all the different combinations of sprite manipulation requirements into one super-complex routine. Mode 0 sprites, mode 1 sprites, flipped, un-flipped, scaled, un-scaled. Fantastic. And it takes up much less memory than the version I had before which had the different options as separate (albeit much smaller) routines.

To make it work, I'm not using slow comparison operators inside of the big evil loop.
Nope, I'm using insane amounts of self-modifying code, performed once per sprite per frame.
This keeps the speed up, but makes the code a lot harder to read of course.
And the speed is indeed very nice now. The scaling looks great in action, and I'm looking forward to showing you all.

Anyway, this morning I had just one little bug left to fix.
When a scaled sprite was being clipped to the left side of the screen, the scaling became a bit distorted.
I sorted that out and tried it with Savage. Beautiful. Worked perfectly.

Then I tried it with Cuchulainn.

And he promptly became a dwarf.

AAAARRRRRGGGGHHHH!!!!  >:(

He was working correctly last night.
I don't know what I've done to upset him.

I'll fix him though... yes, yes I will.

[EDIT] ... and with that, he's fixed.
It's amazing what a little walk, thinking about something unrelated, can do for your programming.
The solution popped in to my head, and I had to rush back and put it in.

And voila, here it is.
I hope you enjoy it.

Now this time, I will finally move on to development of the 3D road!  ;)

redbox

That is seriously good.


Well done!  :)

ervin

Quote from: redbox on 10:51, 28 July 11
That is seriously good.

Well done!  :)

Thanks man. I'm very excited about the direction it is heading in!

robcfg

Great work!


Let's see what comes next  ;)

ervin

Hi all.

So far this project hasn't needed any sort of sprite masking, but the need to use it has reared its head.
The problem with this is that I had no idea how to do masking.

After much research, and head-scratching, I finally figured it out, and managed to throw together a little test program that masks a vertical line against all 16 inks in mode 0.

It was surprisingly tricky to work out, but I'm very happy with the result, and I'll be able to use my findings in my game now.  :)

If you're interested in checking out the test program, download the attached dsk.

TFM

It may help you do define two datasets for every sprite:

1. dataset: The mask. You AND it with the V-RAM data to mask out pixel.

2. dataset: The sprite data. You OR it with the previously masked V-RAM data, to set sprite pixel.

AND and OR only take one ys and if you use the second register set, you can create a real quick sprite routine.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

ervin

I had toyed with the idea of using a second dataset for my sprite masks, but unfortunately some of my sprites are very large. The eternal battle between speed and memory usage continues!  :)

I had to resort to using a lookup table for pixel masks.
It seems to be pretty quick. Once I have some big sprites moving around I'll have a better idea of whether or not the speed is good enough.  8)

TFM

Actually speed depends a lot on the question if you use scrolling or not. And also: Overscan or not.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

ervin

No scrolling in my game, and no overscan.

To keep the speed up, I'm only updating the parts of the screen that need to change each frame.
That helps a lot.

Any speed problems will be as a result of the huge sprites I'm using!  :)

TFM

If you are not scrolling, then you can use giant sprites ;-)

May you like to consider to switch to 32 * 32 (in Mode 1 characters) screen resolution, it make the mathematics more easy.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Powered by SMFPacks Menu Editor Mod